plot.gdpc: Plot Generalized Dynamic Principal Components

View source: R/classGDPC.R

plot.gdpcR Documentation

Plot Generalized Dynamic Principal Components

Description

Plots a gdpc object.

Usage

## S3 method for class 'gdpc'
plot(x, which = 'Component', which_load = 0, ...)

Arguments

x

An object of class gdpc, usually the result of gdpc or one of the entries of the result of auto.gdpc.

which

String. Indicates what to plot, either 'Component' or 'Loadings'. Default is 'Component'.

which_load

Lag number indicating which loadings should be plotted. Only used if which = 'Loadings'. Default is 0.

...

Additional arguments to be passed to the plotting functions.

Author(s)

Daniel Peña, Ezequiel Smucler, Victor Yohai

See Also

gdpc, auto.gdpc, plot.gdpcs

Examples

T <- 200 #length of series
m <- 200 #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]
}
#Choose number of lags using the LOO type criterion.
#k_max=3 to keep computation time low
autofit <- auto.gdpc(x, k_max = 3) 
plot(autofit[[1]], xlab = '', ylab = '')

gdpc documentation built on Nov. 19, 2023, 5:12 p.m.

Related to plot.gdpc in gdpc...