next up previous
Next: Semi-parametric Nonlinear Mixed-Effects Models Up: Semi-parametric Nonlinear Regression Models Previous: Estimation

The snr Function

The S function for fitting a SNR model is snr. A typical call is

    snr(formula, func, params, start, data)
The first four arguments are required. Arguments formula and func are the same as in nnr. params and start specify models for parameters $\mbox{\boldmath$\phi$}$ and their initial values for the iterative procedure.

Method for selecting smoothing parameters is specified by the argument spar. spar=''v'', spar=''m'' and spar=''u'' correspond to GCV, GML and UBR methods respectively, with GCV as the default. Other options include correlation, weights, and control. They all have the same function as in ssr.

An object of snr class is returned. Generic functions summary, predict and intervals can be applied to extract further information. See help files for details.

Example 9. Projection Pursuit models assume that $\eta(\mbox{\boldmath$\phi$},\mbox{\boldmath$f$};\mbox{\boldmath$t$})=\sum_{j=1}^q f_j(\mbox{\boldmath$\phi$}_j^T \mbox{\boldmath$t$})$. They are also known as the multiple index models. Note that our estimation procedure is similar to that used in Roosen and Hastie (1994). For example, suppose that $q=2$, $d=r=3$, and both $f_1$ and $f_2$ are modeled using TPS on $R$ with $m=2$. Instead of polynomial splines, we use TPS's to avoid the limitation on the domain. For identifiability, we need the side condition $\phi_{j1}^2+\phi_{j2}^2+\phi_{j3}^2=1$. We can fit such a model by

   snr(y~f1(a11*t1+a12*t2+sqrt(1-a11**2-a12**2)*t3)
       + f2(a21*t1+a22*t2+sqrt(1-a21**2-a22**2)*t3),
       func=list(f1(z)+f2(z)~list(~z,rk=tp.pseudo(z)),
       params=list(a11+a12+a21+a22~1),
       start=c(a110,a120,a210,a220))

Example 10. Nonlinear partial splines assume that $\eta(\mbox{\boldmath$\phi$},\mbox{\boldmath$f$};\mbox{\boldmath$t$})=f(\mbox{\boldmath$t$})+g(\mbox{\boldmath$\phi$};\mbox{\boldmath$t$})$, where $g$ is a known function depends nonlinearly on parameters $\mbox{\boldmath$\phi$}$. For example, suppose that $\mbox{\boldmath$t$}=(t_1,t_2)$, $f$ is a function of $t_1$ modeled using a periodic spline, and $g(\mbox{\boldmath$\phi$};\mbox{\boldmath$t$})=\phi_1 \exp (\phi_2 t_2)$. we can fit such a model by

    snr(y~f(t1)+a*exp(b*t2), func=list(f(z)~list(~1,rk=periodic(z)),
        params=list(a+b~1), start=c(a0,b0))
The function $g$ can also be input as an outside S function as in gnls.

Example 11. Monotone spline. Consider model ([*]) where $f$ is assumed to be a strictly increasing function. Nychka and Ruppert (1995) used the following transformation

\begin{displaymath}
f(t)=\eta(\mbox{\boldmath$\phi$},g;t)=\phi_1+\int_0^t \exp (g(s)) ds,
\end{displaymath}

where $g \in W_2([0,1])$. We can fit such a model by
    snr(y~a+h(g), func=list(g(z)~list(~z,rk=cubic(z)),
        params=list(a~1), start=c(a0))
where $h$ is an S function calculating the integral $\int_0^t \exp (g(s)) ds$.

For monotone $f$ (either increasing or decreasing), Ramsay (1998) suggested the following transformation

\begin{displaymath}
f(t) = \eta(\mbox{\boldmath$\phi$},g;t)=\phi_1+\phi_2\int_0^t \exp (\int_0^s g(u) du) ds,
\end{displaymath}

where $g \in W_2([0,1])$. We can fit such a model by
    snr(y~a+b*h(g), func=list(g(z)~list(~z,rk=cubic(z))),
        params=list(a~1,b~1), start=c(a0,b0))
where $h$ is a S function calculating the integral $\int_0^t \exp (\int_0^s g(u) du) ds$.

Example 12. Positive monotone spline. Consider model ([*]) where $f$ is assumed to be a strictly positive and increasing function. One may use the following transformation

\begin{displaymath}
f(t)=\eta(\mbox{\boldmath$\phi$},g;t)=\exp(\phi_1+\int_0^t \exp (g(s)) ds),
\end{displaymath}

where $g \in W_2([0,1])$. We can fit such a model by
    snr(y~exp(a+h(g)), func=list(g(z)~list(~z,rk=cubic(z)),
        params=list(a~1), start=c(a0))
where $h$ is a S function calculating the integral $\int_0^t \exp (g(s)) ds$.

Example 13. Varying coefficient models. Suppose that $\mbox{\boldmath$t$}=(\mbox{\boldmath$x$},\mbox{\boldmath$z$})$. The varying coefficient models in Hastie and Tibshirani (1993) assume that

\begin{displaymath}
\eta(\mbox{\boldmath$\phi$},\mbox{\boldmath$f$};\mbox{\boldmath$t$})=\phi_1+\sum_{j=1}^q f_j(\mbox{\boldmath$z$}) x_j .
\end{displaymath}

Suppose that $q=2$, both $f_1$ and $f_2$ are univariate functions of a continuous variable $z$ and are modeled using cubic splines. We can fit such a model by
    snr(y~a+f1(z)*x1+f2(z)*x2, func=list(f1(z)+f2(z)~list(~z,cubic(z))),
        params=list(a~1), start=c(a0))

Example 14. Self-modeling nonlinear regression (SEMOR) models were first proposed by Lawton et al. (1972) to fit repeated measures data. They assumed that there exists a common curve $f$ for all subjects and that a particular subject's response curve is some parametric transformation of the common curve. We consider a more general SEMOR model

$\displaystyle y_{ij}= \alpha(\mbox{\boldmath$\phi$}_i; t_{ij}) + \delta(\mbox{\...
...math$\phi$}_i; t_{ij})) + \epsilon_{ij},
~~~~i=1, \cdots, m, ~~j=1,\cdots, n_i,$     (40)

where $\alpha$, $\delta$ and $\gamma$ are known functions of $t$ with unknown parameters $\mbox{\boldmath$\phi$}_i$. Usually $t$ is a continuous variable such as time. $f$ is a function of a univariate continuous variable. Depending on the range of $\gamma$, polynomial splines or univariate TPS may be used to model $f$. Most often, a SEMOR model is in the form of
$\displaystyle y_{ij}= \phi_{i1} + \exp(\phi_{i2}) f((t_{ij}-\phi_{i3})/\exp(\phi_{i4}))
+ \epsilon_{ij},
~~~~i=1, \cdots, m, ~~j=1,\cdots, n_i .$     (41)

Model ([*]) is referred to as a shape invariant model (SIM). Suppose we model $f$ with a TPS on $R$ with $m=2$ and random errors are iid normal. Note that we used exponential transformation to force the amplitude parameter and the scale parameter to be positive. It is clear that model ([*]) is not identifiable without side conditions. We now illustrate two approaches to make it identifiable. The first approach uses the following side conditions: $\phi_{11}=\phi_{12}=\phi_{13}=\phi_{14}=0$. Correspondingly these set-to-zero conditions free $f$ from confounding with a vertical shift, a vertical stretch, a horizontal shift and a horizontal stretch. Then model ([*]) can be fitted by
    snr(y~a1+exp(a2)*f((t-a3)/exp(a4)),
        func=list(f(z)~list(~z,tp.pseudo(z))),
        params=list(a1+a2+a3+a4~subject-1),
        start=c(a10,a20,a30,a40))

We may also impose side conditions on $f$. For example, we may remove the constant functions from the model space of $f$ to make it identifiable with $\phi_{i1}$'s. We may use the constraint $\sup \vert f(t)\vert=1$ to make $f$ identifiable with $\phi_{i2}$'s. Under these alternative side conditions and $\phi_{13}=\phi_{14}=0$, model ([*]) can be fitted by

    snr(y~a1+exp(a2)*f((t-a3)/exp(a4)), 
        func=list(f(z)~list(~z-1,tp.pseudo(z))),
        params=list(a1+a2~subject,a3+a4~subject-1), 
        start=c(a10,a20,a30,a40), constraint=list(maxValue=1))
Note that the ``constraint'' option is not available in the current version.


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