Learn R Programming

growthrate (version 1.3)

new.growth: recovery of growth velocity for a new subject

Description

Computes the posterior mean and covariance kernel for a new subject having data at observation times newtobs different from tobs (apart from the first and the last). growth needs to be run first.

Usage

new.growth(newdata, newtobs, sigma, d, muhatcurve, Khat, tgrid)

Arguments

newdata
Row vector of p heights for the new subject.
newtobs
Row vector of p observation times for the new subject (in increasing order; must include the first and last time points in tobs).
sigma
Infinitessimal standard deviation of the Brownian motion prior (same as in growth).
d
Number of time points on the fine grid.
muhatcurve
Output from growth.
Khat
Output from growth.
tgrid
The fine grid (output from growth).

Value

muhatcurvenew
Posterior mean (on tgrid) for the new subject.
Khatnew
Posterior covariance kernel (on tgrid) for the new subject.

References

Lopez-Pintado, S. and McKeague, I. W. (2013). Recovering gradients from sparsely observed functional data. Biometrics 69, 396-404 (2013). http://www.columbia.edu/~im2131/ps/growthrate-package-reference.pdf

Examples

Run this code
## Not run: 
# ## example using the height data provided in the package 
# ##    (after first running growth to obtain the output g):
# ## suppose a new subject has 5 observation times (including 0 and 7)
# 	data(height_data);
# 	tobs=c(0,1/3,2/3,1,3,4,7);
# 	d=200;
# 	sigma=1;
# 	g=growth(height_data,tobs,sigma,d);
# 
# 	newtobs=c(0, 2, 3, 5, 7);
# 	newdata=t(as.vector(c(50,70,87,100,115)));
# 	ng=new.growth(newdata,newtobs,sigma,d,g$muhatcurve,g$Khat,g$tgrid);
# 
# ## plot of the posterior mean growth velocity for the new subject:
# 	plot(g$tgrid,ng$muhatcurvenew,xlab="Age (years)",ylab="Growth
# 	velocity (cms/year)");
# ## End(Not run)

Run the code above in your browser using DataLab