fitted.odpcs: Get Reconstructed Time Series From an odpcs Object

View source: R/methodsODPC.R

fitted.odpcsR Documentation

Get Reconstructed Time Series From an odpcs Object

Description

Get reconstructed time series from an odpcs object.

Usage

  ## S3 method for class 'odpcs'
fitted(object, num_comp = 1, ...)

Arguments

object

An object of class odpcs, usually the result of odpc.

num_comp

Integer indicating how many components to use for the reconstrucion. Default is 1.

...

Additional arguments for compatibility.

Value

A matrix that is the reconstruction of the original series.

See Also

odpc, crit.odpc, cv.odpc

Examples

  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)

esmucler/odpc documentation built on March 28, 2022, 5:39 a.m.