Learn R Programming

TRMF (version 0.1.5)

TRMF_simple: 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

Value

Returns an updated object of class TRMF.

Details

This is called by train_TRMF if the TRMF object doesn't have any time series models.

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

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

Run the code above in your browser using DataLab