mldfm {FARS} | R Documentation |
Estimate Multilevel Dynamic Factor Model
Description
Estimates a multilevel dynamic factor model from time series data. Supports both single-block and hierarchical multi-block structures with customizable factor extraction settings.
Usage
mldfm(
data,
blocks = 1,
block_ind = NULL,
global = 1,
local = NULL,
middle_layer = NULL,
method = 0,
tol = 1e-06,
max_iter = 1000,
verbose = TRUE
)
Arguments
data |
A numeric matrix or data frame containing the time series data. Rows represent time points; columns represent observed variables. |
blocks |
Integer. Number of blocks into which the data is divided. |
block_ind |
Integer vector. End column indices for each block. Must be of length |
global |
Integer. Number of global factors extracted from the entire dataset. |
local |
Integer vector of length |
middle_layer |
Named list. Each name is a string specifying a group of blocks (e.g., |
method |
Integer. Method used to initialize the factors: |
tol |
Numeric. The tolerance level for the residual sum of squares (RSS) minimization process. Used as a convergence criterion. |
max_iter |
Integer. The maximum number of iterations allowed for the RSS minimization process. |
verbose |
Logical. If |
Value
An object of class mldfm
, which is a list containing the following components:
- Factors
Matrix of estimated factors.
- Lambda
Matrix of factor loadings.
- Residuals
Matrix of residuals.
- Iterations
Number of iterations before convergence.
- Factors_list
List of estimated factors for each node.
Examples
data <- matrix(rnorm(1000), nrow = 100, ncol = 519)
block_ind <- c(63, 311, 519) # Defines 3 blocks
local <- c(1, 1, 1) # One local factor per block
middle_layer <- list("1-3" = 1)
result <- mldfm(data, blocks = 3, block_ind = block_ind, global = 1,
local = local, middle_layer = middle_layer)
summary(result)