This function fits a model to the given measured data of a population.
Usage
growthfd(
data,
x,
y,
id,
model,
verbose = 1,
bounds = "negative",
filename = "",
startFromId = NULL,
parallel = F,
scores.filename = "parallel.txt"
)
Arguments
- data
Data frame containing age, height and id of individuals
- x
Age at measured data points
- y
Height at measured data points
- id
Corresponding individual's id at measured data points
- model
FPCA growth model to be fitted
- verbose
Verbosity
- bounds
Limitation of the interval for milestones estimation, 'negative' or 'inverse'
- filename
File name for saving results after each individual
- startFromId
Start the evaluation from this id
- parallel
(Experimental) Parallel evaluation of the model fitting
- scores.filename
File name for continuous saving of the scores
Examples
filename <- system.file("extdata", "data.csv", package="growthfd", mustWork=TRUE)
csv <- read.csv(filename)
d <- data.frame('id'=as.factor(csv[,'id']), 'x'=csv[,'age'], 'y'=csv[,'height'])
fit<-growthfd(data=d, x=x, y=y, id=id, model=model.bgs.m)
#> Model apv=13.740415, atf=11.090431
#> Processing individual with id 'John' (1/2), containing 18 measurements
#> It. 0, RSS = 1622.04, Par. = 0 0 0 0 0 0 0 0 0 0 0 0
#> It. 1, RSS = 18.1131, Par. = -0.92853 0.590792 -0.0452606 0.629458 -0.52361 0.26631 -1.27108 -0.373017 -0.594539 -0.407316 -0.646637 -0.966524
#> It. 2, RSS = 12.9352, Par. = -1.23456 0.460783 -0.0701897 0.196413 -0.300864 0.03997 -1.0801 -0.363923 -0.652776 -0.179065 -0.230554 0.0378657
#> It. 3, RSS = 12.8861, Par. = -1.25334 0.458501 0.020703 0.123401 -0.280285 0.00272613 -1.07024 -0.359267 -0.689483 -0.221977 -0.0976082 -0.00740067
#> It. 4, RSS = 12.8853, Par. = -1.25988 0.461212 0.0263142 0.113366 -0.275931 0.00162186 -1.06702 -0.363682 -0.696376 -0.216871 -0.0922423 -0.00318999
#> It. 5, RSS = 12.8853, Par. = -1.25988 0.461215 0.0263632 0.11343 -0.275896 0.00377413 -1.06702 -0.363685 -0.696385 -0.216863 -0.0921115 -0.0028257
#> It. 6, RSS = 12.8853, Par. = -1.25989 0.461225 0.0264735 0.113505 -0.275862 0.0028931 -1.06702 -0.363692 -0.696408 -0.216869 -0.0918255 -0.00305245
#> It. 7, RSS = 12.8853, Par. = -1.2599 0.461231 0.0265137 0.113583 -0.275826 0.00184796 -1.06702 -0.363696 -0.696421 -0.216887 -0.0916078 -0.00300673
#> It. 8, RSS = 12.8853, Par. = -1.2599 0.461233 0.0265305 0.113604 -0.275821 0.00233049 -1.06702 -0.363697 -0.696425 -0.21689 -0.0915695 -0.00281314
#> It. 9, RSS = 12.8853, Par. = -1.2599 0.461233 0.0265305 0.113604 -0.275821 0.00233049 -1.06702 -0.363697 -0.696425 -0.21689 -0.0915695 -0.00281314
#> Processing individual with id 'Paul' (2/2), containing 11 measurements
#> It. 0, RSS = 244.688, Par. = 0 0 0 0 0 0 0 0 0 0 0 0
#> It. 1, RSS = 16.589, Par. = -0.328057 0.686218 0.45778 -0.170158 -0.847792 0.228481 -0.640518 -0.562002 -0.161986 -0.579127 -0.190229 0.231424
#> It. 2, RSS = 16.0412, Par. = -0.490699 0.903307 0.413326 -0.157529 -0.765587 0.209984 -0.584074 -0.848742 -0.26959 -0.451951 0.0151945 -0.0261874
#> It. 3, RSS = 16.0053, Par. = -0.49888 0.979968 0.389935 -0.144722 -0.750883 0.214861 -0.597127 -0.916197 -0.30158 -0.406239 0.0743616 -0.0806142
#> It. 4, RSS = 16.0028, Par. = -0.499582 1.00125 0.3889 -0.140481 -0.747863 0.216019 -0.600498 -0.935129 -0.304353 -0.391568 0.0895829 -0.094349
#> It. 5, RSS = 16.0027, Par. = -0.499829 1.00729 0.38813 -0.139788 -0.74675 0.21633 -0.601462 -0.940439 -0.305399 -0.387886 0.0912642 -0.0981778
#> It. 6, RSS = 16.0026, Par. = -0.499806 1.00894 0.387941 -0.139416 -0.746537 0.216093 -0.601778 -0.941769 -0.305667 -0.386679 0.0916887 -0.100214
#> It. 7, RSS = 16.0026, Par. = -0.499749 1.00955 0.388153 -0.139246 -0.746324 0.216411 -0.601852 -0.942323 -0.305415 -0.386094 0.0933618 -0.10029
#> It. 8, RSS = 16.0026, Par. = -0.499749 1.00955 0.388153 -0.139246 -0.746324 0.216411 -0.601852 -0.942323 -0.305415 -0.386094 0.0933618 -0.10029
#> Fitting time:
#> user system elapsed
#> 152.23 8.56 160.84
#> Warped apv=14.796922, atf=12.409030
#> Refined apv=14.616361, atf=12.327334
#> Warped apv=14.139222, atf=11.855192
#> Refined apv=13.890756, atf=11.820839
#> Total time:
#> user system elapsed
#> 162.67 9.15 171.89