predict.TRMF | R Documentation |
Predict values based on the TRMF fit
## S3 method for class 'TRMF'
predict(object,newdata=NULL, ...)
object |
A trained TRMF object |
newdata |
A list with slot |
... |
other arguments, ignored. |
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.
Returns a matrix of predictions.
Chad Hammerquist
create_TRMF
, TRMF_columns
, TRMF_trend
,train.TRMF
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))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.