retrain: Retrain TRMF objects.

Description Usage Arguments Details Value See Also Examples

View source: R/Methods.R

Description

Continue training on a pretrained TRMF object.

Usage

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

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.

Value

A trained TRMF object.

See Also

train.TRMF

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
# 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)

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