next up previous
Next: Vector Spline Models Up: Semi-parametric Nonlinear Mixed-Effects Models Previous: Model and Estimation

The snm Function

The S function for fitting a SNM model is snm. A typical call is

    snm(formula, func, fixed, start, random, data)
The first 4 arguments are required. Arguments formula and func are the same as in nnr. Following syntax in nlme, the fixed and random arguments specify the fixed and random effects models in the second stage model ([*]). The option start specifies initial values for all parameters in the fixed effects.

snm inherits most of the options in nlme. See documents of nlme and the help file of snm for details. Generic functions summary, predict and intervals can be applied to extract further information. intervals provides approximate posterior means and variances which can be used to construct Bayesian confidence intervals for the $\mbox{\boldmath$f$}$. Derivatives of $\eta$ with respect to random effects are needed to compute these quantities (Ke and Wang, 2001). In interval.snm, numerical derivatives are to be used.

Example 15. Mixed-effects SIMs. In the SIM ([*]) for repeated measure data, it is more appropriate to consider parameters as random variables (Ke and Wang, 2001):

$\displaystyle y_{ij} = \beta_1 + b_{1i} + \exp (b_{2i})
f((t_{ij}-b_{3i})/\exp (b_{4i}))
+ \epsilon_{ij}, ~~i=1,\cdots,m; j=1,\cdots,n_i ,$     (47)

where $\mbox{\boldmath$b$}_i=(b_{1i}, b_{2i}, b_{3i}, b_{4i})^T\sim
\mbox{N} (0, \Sigma)$ and $\Sigma$ is an unstructured positive-definite matrix. Suppose that we want to model f using a TPS on $R$ with $m=2$. Note that no identifiability condition is necessary for $f$ since $\mbox{E}(b_{2i})=0$. We can fit model ([*]) with independent random errors by
    snm(y~b1+exp(b2)*f((t-b3)/exp(b4)), 
        func=list(f(u)~list(u,tp.pseudo(u))), 
        fixed=list(b1~1), random=list(b1+b2+b3+b4~1), start=b10)


next up previous
Next: Vector Spline Models Up: Semi-parametric Nonlinear Mixed-Effects Models Previous: Model and Estimation
Yuedong Wang 2004-05-19