crit.sparse_odpc: Automatic Choice of Regularization Parameters for Sparse...

View source: R/sparseODPC.R

crit.sparse_odpcR Documentation

Automatic Choice of Regularization Parameters for Sparse One-Sided Dynamic Principal Components using a BIC type criterion

Description

Computes Sparse One-Sided Dynamic Principal Components, choosing the number of components and regularization parameters automatically, using a BIC type criterion.

Usage

crit.sparse_odpc(
  Z,
  k_list = 1:3,
  max_num_comp = 1,
  nlambda = 20,
  tol = 1e-04,
  niter_max = 500,
  eps = 0.001,
  ncores = 1
)

Arguments

Z

Data matrix. Each column is a different time series.

k_list

List of values of k to choose from.

max_num_comp

Maximum possible number of components to compute.

nlambda

Length of penalty sequence.

tol

Relative precision. Default is 1e-4.

niter_max

Integer. Maximum number of iterations. Default is 500.

eps

Between 0 and 1, used to build penalty sequence

ncores

Number of cores to use in parallel computations

Details

First crit.odpc is called to choose the number of lags and of components to use. Each component is then computed using a regularized version of the odpc objective function (see odpc), where the L1 norm of the \mathbf{a} vector is penalized. The penalization parameter λ is chosen from a grid of candidates of size nlambda, seeking to minimize the following BIC type criterion

\log(MSE(\mathbf{a}_{λ},\mathbf{α}_{λ}, \mathbf{B}_{λ} )) + \frac{\log(T^{\ast} m)}{T^{\ast}m} \Vert \mathbf{a}_{λ}\Vert_{0},

where \mathbf{a}_{λ},\mathbf{B}_{λ} are the estimates associated with a given λ, m is the number of series and T^{\ast} is the number of periods being reconstructed.

Value

An object of class odpcs, that is, a list of length equal to the number of computed components, each computed using the optimal value of k. The i-th entry of this list is an object of class odpc, that is, a list with entries

f

Coordinates of the i-th dynamic principal component corresponding to the periods k_1 + 1,…,T.

mse

Mean squared error of the reconstruction using the first i components.

k1

Number of lags used to define the i-th dynamic principal component f.

k2

Number of lags of f used to reconstruct.

alpha

Vector of intercepts corresponding to f.

a

Vector that defines the i-th dynamic principal component

B

Matrix of loadings corresponding to f. Row number k is the vector of k-1 lag loadings.

call

The matched call.

conv

Logical. Did the iterations converge?

lambda

Regularization parameter used for this component

components, fitted, plot and print methods are available for this class.

References

Peña D., Smucler E. and Yohai V.J. (2017). “Forecasting Multiple Time Series with One-Sided Dynamic Principal Components.” Available at https://arxiv.org/abs/1708.04705.

See Also

odpc, crit.odpc, forecast.odpcs

Examples

T <- 50 #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 <- crit.sparse_odpc(x, k_list = 1, ncores = 1)

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