fitted.odpcs | R Documentation |
Get reconstructed time series from an odpcs object.
## S3 method for class 'odpcs' fitted(object, num_comp = 1, ...)
object |
An object of class |
num_comp |
Integer indicating how many components to use for the reconstrucion. Default is 1. |
... |
Additional arguments for compatibility. |
A matrix that is the reconstruction of the original series.
odpc
, crit.odpc
, cv.odpc
T <- 200 #length of series m <- 10 #number of series set.seed(1234) f <- rnorm(T + 1) x <- matrix(0, T, m) u <- matrix(rnorm(T * m), T, m) for (i in 1:m) { x[, i] <- 10 * sin(2 * pi * (i/m)) * f[1:T] + 10 * cos(2 * pi * (i/m)) * f[2:(T + 1)] + u[, i] } fit <- odpc(x, ks = matrix(c(1, 1, 1, 0), 2, 2)) recons <- fitted(fit, num_comp = 2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.