change_cor_mat_tdpca: Draw a changed correlation matrix for use in dynamic TPCA.

Description Usage Arguments Details Value

View source: R/tdpca_change_handlers.R View source: R/tdpca_change_handlers.R


Changes an input correlation matrix that is based on lagged samples. This function assumes that the correlation matrix is based on observations X_t = vec(x_{t - l}, x_{t - l + 1}, …, x_t).


change_cor_mat_tdpca(cor_mat, lag, affected_dims, do_nearPD = TRUE,
  draw_cor = NULL, draw_sd = NULL)



A correlation matrix of lagged observations to be changed.


The lag used to obtain the lagged observations.


A vector specifying which unlagged dimensions (dimensions of x_t) that should be changed.


A logical indicating whether the Matrix::nearPD function should be run on the changed correlation matrix to find the closest positve definite matrix to it. Highly recommended, as the changes in correlation are not guaranteed to result in a valid correlation matrix.


A function to draw n (any natural number) changes in correlation from.


A function to draw n (any natural number) changes in standard deviation from.


The lagged observations X_t imposes a block structure on its correlation matrix, where the l + 1 diagonal blocks are all estimates of the correlation matrix of x_t. change_cor_mat_tdpca takes a set of indices indicating affected dimensions of x_t, and translates this into corresponding changes in the input correlation matrix of X_t. A change in one dimension of x_t (the unlagged, original data) corresponds to changes in (lag + 1) dimensions of X_t. See change_cor_mat for additional information.


A changed correlation matrix, guaranteed to be positive definite if do_nearPD = TRUE.

Tveten/tpca documentation built on June 10, 2021, 8:43 p.m.