Learn R Programming

convergenceDFM (version 0.1.4)

estimate_DFM: Estimate Dynamic Factor Model with VAR dynamics

Description

Estimates a Dynamic Factor Model by extracting factors via PLS and modeling their dynamics with a Vector Autoregression. Includes automatic lag selection, robust inference, and optional out-of-sample evaluation.

Usage

estimate_DFM(
  factors_data,
  p = 2,
  compute_oos = TRUE,
  hc_type = "HC3",
  verbose = TRUE
)

Value

List with components:

var_fit

Fitted VAR model on combined factors.

p_used

VAR lag order used.

robust_se

Matrices of robust standard errors.

diagnostics

List of diagnostic tests (stability, serial correlation).

oos_metrics

Out-of-sample forecast evaluation (if requested).

Arguments

factors_data

List containing PLS-extracted factor scores (scores_X, scores_Y) and related objects.

p

Integer. VAR lag order. If NULL, selected automatically. Default is 2.

compute_oos

Logical. Should out-of-sample diagnostics be computed? Default is TRUE.

hc_type

Character string. Heteroskedasticity-consistent SE type. Default is "HC3".

verbose

Logical; print progress and diagnostic information. Default TRUE.

Details

This function models the joint dynamics of X and Y factors using a VAR. It performs stability checks, tests for serial correlation, computes robust standard errors, and optionally evaluates forecast performance out-of-sample.