Description Usage Arguments Value Author(s) References Examples
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.
1 | new.growth(newdata, newtobs, sigma, d, muhatcurve, Khat, tgrid)
|
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 |
sigma |
Infinitessimal standard deviation of the Brownian motion prior (same as in |
d |
Number of time points on the fine grid. |
muhatcurve |
Output from |
Khat |
Output from |
tgrid |
The fine grid (output from |
muhatcurvenew |
Posterior mean (on |
Khatnew |
Posterior covariance kernel (on |
Sara Lopez-Pintado and Ian W. McKeague
Maintainer: Ian W. McKeague <im2131@columbia.edu>
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
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.