Learn R Programming

FARS (version 0.7.1)

compute_initial_factors: Compute Initial Factors for Multi-Level Dynamic Factor Model

Description

Computes the initial set of global, middle-layer, and local factors using either PCA or CCA.

Usage

compute_initial_factors(
  data,
  num_vars,
  num_obs,
  num_blocks,
  ranges,
  r_list,
  method
)

Value

A list with two elements:

initial_factors

Matrix of all initial factors (T × total number of factors).

factor_list

Named list of factors for each node in the hierarchy.

Arguments

data

A numeric matrix or data frame containing the time series data (T × N).

num_vars

Integer vector. Number of variables in each block.

num_obs

Integer. Number of time observations (T).

num_blocks

Integer. Number of blocks.

ranges

A list of vectors with the column indices for each block.

r_list

A named list specifying the number of factors to extract for each node (from build_factor_structure).

method

Integer. Method for factor extraction: 0 = Canonical Correlation Analysis (CCA), 1 = Principal Component Analysis (PCA).