impute_TRMF {TRMF} | R Documentation |
Impute missing values in a matrix
Description
Impute missing values in matrix from a pre-trained TRMF object.
Usage
impute_TRMF(obj)
Arguments
obj |
a trained TRMF object |
Details
Essentially an accessor function. Replaces the missing values in data matrix with values from the fitted TRMF object.
Value
data matrix with missing values imputed
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
train.TRMF
, create_TRMF
, TRMF_trend
Examples
# create test data
xm = poly(x = (-10:10)/10,degree=4)
fm = matrix(rnorm(40),4,10)
Am = xm%*%fm+rnorm(210,0,.2)
Am[sample.int(210,20)] = NA
# create model
obj = create_TRMF(Am)
obj = TRMF_trend(obj,numTS=4,order=2)
out = train(obj)
impute_TRMF(out)
[Package TRMF version 0.2.1 Index]