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

Description Usage Arguments Value Author(s) References Examples

View source: R/new.growth.R

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

1
	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.

Author(s)

Sara Lopez-Pintado and Ian W. McKeague

Maintainer: Ian W. McKeague <im2131@columbia.edu>

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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
## 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)

growthrate documentation built on May 2, 2019, 3:43 p.m.