intervals.slm {assist} | R Documentation |
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.
## S3 method for class 'slm'
intervals(object, level=0.95, newdata=NULL, terms, pstd=TRUE, ...)
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 |
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. |
The standard deviation returned is based on approximate Bayesian confidence intervals as formulated in Wang (1998).
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.
Chunlei Ke chunlei_ke@yahoo.com and Yuedong Wang yuedong@pstat.ucsb.edu
Wang, Y. (1998). Mixed-effects smoothing spline ANOVA. Journal of the Royal Statistical Society, Series B 60, 159-174.
## Not run:
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)
## End(Not run)