predict.sparseSpline: Extract fitted values from a 'sparseSpline' object

Description Usage Arguments Value Examples

Description

Extract fitted values from a sparseSpline object

Usage

1
2
## S3 method for class 'sparseSpline'
predict(object, newdata = NULL, which.lam = 10, ...)

Arguments

object

an object of class sparseSpline, as produced by spam

newdata

if NULL, returns predictions at original values, otherwise an N1 x p matrix with new X values at which to form predictions

which.lam

an optional value for the index of the tuning parameter sequence to produce. If NULL, predicted values for all values of the tuning parameter.

...

optional additional arguments for method compatability

Value

A matrix of dimension Nxd or an array of dimension N x nlambda x d if which.lam=NULL.

Examples

1
2
3
4
5
6
7
someData = generateSPASM(100,3,4)
SPAMfit = spam(someData$y, someData$x, returnall=TRUE)
filt = lgf1(someData$y, SPAMfit, someData$Tt,
  solve(someData$HHt), someData$GGt, rep(0,3), diag(1,3))
SPAMpreds = predict(SPAMfit, filt$xtt)
matplot(someData$y, ty='l', col=1, lty=1)
matlines(SPAMpreds, col=4, lty=3)

dajmcdon/spasm documentation built on May 6, 2019, 1:31 a.m.