Learn R Programming

TRMF (version 0.1.5)

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

Value

data matrix with missing values imputed

Details

Essentially an accessor function. Replaces the missing values in data matrix with values from the fitted TRMF object.

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

Run this code
# NOT RUN {

# 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)

# }

Run the code above in your browser using DataLab