Learn R Programming

TRMF (version 0.1.5)

retrain: Retrain TRMF objects.

Description

Continue training on a pretrained TRMF object.

Usage

retrain(obj, numit, fit_xm_first = TRUE)

Arguments

obj

Pretrained 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.

Value

A trained TRMF object.

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.

See Also

train.TRMF

Examples

Run this code
# NOT RUN {
# 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)
# }

Run the code above in your browser using DataLab