impute_TRMF: Impute missing values in a matrix

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/TRMF.R

Description

Impute missing values in matrix from a pre-trained TRMF object.

Usage

1

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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
# 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)

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