predict.TRMF: Predict method for TRMF model fit

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/Methods.R

Description

Predict values based on the TRMF fit

Usage

1
2
## S3 method for class 'TRMF'
predict(object,newdata=NULL, ...)

Arguments

object

A trained TRMF object

newdata

A list with slot Xm and possibly with slots cXreg and gXreg

...

other arguments, ignored.

Details

If newdata is NULL, returns fitted model. If newdata doesn't have the term Xm or if it has a different number of columns than the number of latent time series, it will throw an error. If the object also contains a global regression, gXreg must be present and appropriately sized. If the object also contains a column-wise regression, cXreg must be present and appropriately sized.

Value

Returns a matrix of predictions.

Author(s)

Chad Hammerquist

See Also

create_TRMF, TRMF_columns, TRMF_trend,train.TRMF

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
xm = poly(x = (-10:10)/10,degree=4)
fm = matrix(runif(40),4,10)
Am = xm%*%fm+rnorm(210,0,.2)

# create model
obj = create_TRMF(Am)
out = train(obj)
fitted(out)
newXm = 1:5
predict(out,newdata=list(Xm=newXm))

TRMF documentation built on Aug. 16, 2021, 5:06 p.m.