Computes the initial set of global, middle-layer, and local factors using either PCA or CCA.
compute_initial_factors(
data,
num_vars,
num_obs,
num_blocks,
ranges,
r_list,
method
)A list with two elements:
Matrix of all initial factors (T × total number of factors).
Named list of factors for each node in the hierarchy.
A numeric matrix or data frame containing the time series data (T × N).
Integer vector. Number of variables in each block.
Integer. Number of time observations (T).
Integer. Number of blocks.
A list of vectors with the column indices for each block.
A named list specifying the number of factors to extract for each node (from build_factor_structure).
Integer. Method for factor extraction: 0 = Canonical Correlation Analysis (CCA), 1 = Principal Component Analysis (PCA).