sm {BNSP}R Documentation

Smooth terms in mvrm formulae

Description

Function used to define smooth effects in the mean and variance formulae of function mvrm. The function is used internally to construct the design matrices.

Usage

sm(..., k = 10, knots = NULL, bs = "rd")

Arguments

...

one or two covariates that the smooth term is a function of. If two covariates are used, they may be both continuous or one continuous and one discrete. Discrete variables should be defined as factor in the data argument of the calling mvrm function.

k

the number of knots to be utilized in the basis function expansion.

knots

the knots to be utilized in the basis function expansion.

bs

a two letter character indicating the basis functions to be used. Currently, the options are "rd" that specifies radial basis functions and is available for univariate and bivariate smooths, and "pl" that specifies thin plate splines that are available for univariate smooths.

Details

Use this function within calls to function mvrm to specify smooth terms in the mean and/or variance function of the regression model.

Univariate radial basis functions with qq basis functions or q1q-1 knots are defined by

B1={ϕ1(u)=u,ϕ2(u)=uξ12log(uξ12),,ϕq(u)=uξq12log(uξq12)}, \mathcal{B}_1 = \left\{\phi_{1}(u)=u , \phi_{2}(u)=||u-\xi_{1}||^2 \log\left(||u-\xi_{1}||^2\right), \dots, \phi_{q}(u)=||u-\xi_{q-1}||^2 \log\left(||u-\xi_{q-1}||^2\right)\right\},

where u||u|| denotes the Euclidean norm of uu and ξ1,,ξq1\xi_1,\dots,\xi_{q-1} are the knots that are chosen as the quantiles of the observed values of explanatory variable uu, with ξ1=min(ui),ξq1=max(ui)\xi_1=\min(u_i), \xi_{q-1}=\max(u_i) and the remaining knots chosen as equally spaced quantiles between ξ1\xi_1 and ξq1\xi_{q-1}.

Thin plate splines are defined by

B2={ϕ1(u)=u,ϕ2(u)=(uξ1)+,,ϕq(u)=(uξq)+}, \mathcal{B}_2 = \left\{\phi_{1}(u)=u , \phi_{2}(u)=(u-\xi_{1})_{+}, \dots, \phi_{q}(u)=(u-\xi_{q})_{+}\right\},

where (a)+=max(a,0)(a)_+ = \max(a,0).

Radial basis functions for bivariate smooths are defined by

B3={u1,u2,ϕ3(u)=uξ12log(uξ12),,ϕq(u)=uξq12log(uξq12)}. \mathcal{B}_3 = \left\{u_1,u_2,\phi_{3}(u)=||u-\xi_{1}||^2 \log\left(||u-\xi_{1}||^2\right), \dots, \phi_{q}(u)=||u-\xi_{q-1}||^2 \log\left(||u-\xi_{q-1}||^2\right)\right\}.

Value

Specifies the design matrices of an mvrm call

Author(s)

Georgios Papageorgiou gpapageo@gmail.com

See Also

mvrm

Examples

#see \code{mvrm} example

[Package BNSP version 2.2.3 Index]