predict.TRMF {TRMF} | R Documentation |
Predict method for TRMF model fit
Description
Predict values based on the TRMF fit
Usage
## S3 method for class 'TRMF'
predict(object,newdata=NULL, ...)
Arguments
object |
A trained TRMF object |
newdata |
A list with slot |
... |
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
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))
[Package TRMF version 0.2.1 Index]