Learn R Programming

assist (version 2.0)

intervals.slm: Calculate Predictions and Posterior Standard Deviations of Spline Estimates From a slm Object

Description

Provide a way to calculate approximate posterior standard deviations and fitted values at any specified values for any combinations of elements of the spline estimate of nonparametric functions from a slm object, based on which approximate Bayesian confidence intervals may be constructed.

Usage

intervals.slm(object, level=0.95, newdata=NULL, terms, pstd=TRUE, ...)

Arguments

object
an object inheriting from class "slm", representing a semi-parametric nonlinear regression model fit.
level
set as 0.95, unused currently
newdata
an optional data frame on which the fitted spline estimate is to be evaluated.
terms
an optional vector of 0's and 1's collecting a combination of components, or a matrix of 0's and 1's collecting several combinations of components, in a fitted ssr object. All components include bases on the right side of $\mbox{\textasciitilde}$ in t
pstd
an optional logic value. If TRUE (the default), the posterior standard deviations are calculated. Orelse, only the predictions are calculated. Computation required for posterior standard deviations could be intensive.
...
other arguments, currently unused.

Value

  • an object of class bCI is returned, which is a list of length 2. Its first element is a matrix which contains predictions for combinations specified by terms, and second element is a matrix which contains corresponding posterior standard deviations.

Details

The standard deviation returned is based on approximate Bayesian confidence intervals as formulated in Wang (1998).

References

Wang, Y. (1998). Mixed-effects smoothing spline ANOVA. Journal of the Royal Statistical Society, Series B 60, 159-174.

See Also

slm, plot.bCI, predict.ssr

Examples

Run this code
data(dog)
# fit a SLM model with random effects for dogs
dog.fit<-slm(y~group*time, rk=list(cubic(time), shrink1(group),
    rk.prod(kron(time-0.5),shrink1(group)),rk.prod(cubic(time), 
    shrink1(group))), random=list(dog=~1), data=dog)

intervals(dog.fit)

Run the code above in your browser using DataLab