TRMF_ar {TRMF} | R Documentation |
Add an Auto-Regressive Regularization Model to a TRMF Object.
Description
Creates a regularization scheme that constrains latent time-series based on auto-regressive parameters and adds it to a TRMF object.
In matrix optimization form, it adds the following term to the TRMF cost function: R(x) = lambdaD^2||w(DX_s)||^2 + lambdaA^2||X_s||^2
where X_s
is sub-set of the Xm matrix controlled by this model and D is a matrix that corresponds to an auto-regressive model.
Usage
TRMF_ar(obj,numTS = 1,AR,lambdaD=1,lambdaA=0.0001,weight=1)
Arguments
obj |
A TRMF object |
numTS |
number of latent time series in this model |
lambdaD |
regularization parameter for temporal constraint matrix |
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) = lambdaD^2*||w*(D%*%X)||^2 |
AR |
vector of autoregressive parameters. No checks are performed |
Details
Setting AR = c(1) gives a random walk model, same as TRMF_trend(..., order=1)
.
Value
Returns an updated object of class TRMF.
Note
Unlike TRMF_columns()
, these lambdas are squared in the code.
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_trend
Examples
# create test data
xm = matrix(rnorm(80),20,4)
fm = matrix(rnorm(40),4,10)+1
Am = xm%*%fm+rnorm(200,0,.1)
# create model
obj = create_TRMF(Am)
obj = TRMF_columns(obj,reg_type ="interval")
obj = TRMF_ar(obj,numTS=2,AR=c(0.5),lambdaD=4)
out = train(obj)
plot(out)