TRMF_simple {TRMF} | R Documentation |
Add L2 regularization model to a TRMF object
Description
Creates an L2 regularization and adds it to a TRMF object. In matrix optimization form, it adds the following term to the TRMF cost function: R(x) = lambdaA^2||w(X_s)||^2
where X_s
is sub-set of the Xm matrix controlled by this model.
Usage
TRMF_simple(obj,numTS = 1,lambdaA=0.0001,weight=1)
Arguments
obj |
A TRMF object |
numTS |
number of latent time series in this model |
lambdaA |
regularization parameter to apply simple L2 regularization to this time series model |
weight |
optional vector of weights to weight constraints, i.e. R(x) = lambdaA^2*||w*X||^2 |
Details
This is called by train_TRMF
if the TRMF object doesn't have any time series models.
Value
Returns an updated object of class TRMF.
Author(s)
Chad Hammerquist
References
Yu, Hsiang-Fu, Nikhil Rao, and Inderjit S. Dhillon. "High-dimensional time series prediction with missing values." arXiv preprint arXiv:1509.08333 (2015).
See Also
create_TRMF
, TRMF_columns
,TRMF_seasonal
, TRMF_trend
Examples
# create test data
xm = matrix(rnorm(160),40,4)
fm = matrix(runif(40),4,10)
Am = xm%*%fm+rnorm(400,0,.1)
# create model
obj = create_TRMF(Am)
obj = TRMF_simple(obj,numTS=4,lambdaA=0.1)
out = train(obj)
plot(out)