retrain | R Documentation |
Continue training on a pre-trained TRMF object.
retrain(obj, numit, fit_xm_first = TRUE,Xm=NULL,Fm=NULL,Z=NULL)
obj |
Pre-trained TRMF object |
numit |
Number of training iterations |
fit_xm_first |
Fit the Xm factor first? This could be useful it modifications are made to one of the factors that we don't want to be overwritten. |
Xm |
Optional update to Xm matrix. See details |
Fm |
Optional update to Fm matrix. See details |
Z |
Optional update to Z vector. See details |
This is basically the same function as train()
but it doesn't create any of the constraint matrices and doesn't do any initialization. train() must be called on obj before this function. If external regressors are in the model and Fm is provided, the number of rows of columns must equal number of regressors plus columns of Xm. The format of Fm in this case is: [column_xreg_parameters,global_xreg_parameters,Fm_parameters]^T.
A trained TRMF object.
train.TRMF
# create test data
tm = 3*poly(x = (-20:20)/10,degree=3)
sm = diffinv(rnorm(29,0,.1),lag=12,xi=(-5:6)/6)
xm = cbind(sm,tm)
fm = matrix(runif(40),4,10)
Am = xm%*%fm+rnorm(410,0,.1)
# create model
obj = create_TRMF(Am)
obj = TRMF_columns(obj,reg_type ="interval")
obj = TRMF_trend(obj,numTS=3,order=2)
obj = TRMF_seasonal(obj,numTS=1,freq=12,lambdaD=5)
# train
out = train(obj,numit=0) # intialize
plot(out)
new_out = retrain(out,numit=10)
plot(new_out)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.