sm {BNSP}R Documentation

Smooth terms in mvrm formulae


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.


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



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.


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


the knots to be utilized in the basis function expansion.


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.


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 q basis functions or q-1 knots are defined by

\mathcal{B}_1 = ≤ft\{φ_{1}(u)=u , φ_{2}(u)=||u-ξ_{1}||^2 \log≤ft(||u-ξ_{1}||^2\right), …, φ_{q}(u)=||u-ξ_{q-1}||^2 \log≤ft(||u-ξ_{q-1}||^2\right)\right\},

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

Thin plate splines are defined by

\mathcal{B}_2 = ≤ft\{φ_{1}(u)=u , φ_{2}(u)=(u-ξ_{1})_{+}, …, φ_{q}(u)=(u-ξ_{q})_{+}\right\},

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

Radial basis functions for bivariate smooths are defined by

\mathcal{B}_3 = ≤ft\{u_1,u_2,φ_{3}(u)=||u-ξ_{1}||^2 \log≤ft(||u-ξ_{1}||^2\right), …, φ_{q}(u)=||u-ξ_{q-1}||^2 \log≤ft(||u-ξ_{q-1}||^2\right)\right\}.


Specifies the design matrices of an mvrm call


Georgios Papageorgiou

See Also



#see \code{mvrm} example

[Package BNSP version 2.1.6 Index]