extract_factors: Extract factors and loadings at an arbitrary coefficient...

View source: R/asymptotic.R

extract_factorsR Documentation

Extract factors and loadings at an arbitrary coefficient vector

Description

Given an estimated pvarife_result and an arbitrary coefficient vector beta, runs the inner EM loop to extract common factors and factor loadings. Useful for advanced users (e.g., bootstrap procedures that need factor estimates at a perturbed beta).

Usage

extract_factors(beta, fit, n_in = 10L)

Arguments

beta

Numeric vector of VAR coefficients (same length as fit$beta).

fit

An object of class "pvarife_result".

n_in

Number of inner iterations (default 10).

Details

Faithful translation of Inner_Iteration.m from Tugan (2021).

Value

A list with ff (T x r factor matrix) and loadings (Kr x I loading matrix).

Examples

sim <- sim_pvarife(n_units = 20, n_time = 15, n_vars = 2,
                   n_lags = 1, n_factors = 1, seed = 2)
fit <- pvarife(sim$y, n_lags = 1, n_factors = 1, n_out = 5, n_in = 3)
ef  <- extract_factors(fit$beta * 0.9, fit)
dim(ef$ff)       # T x r


pvarife documentation built on June 13, 2026, 5:06 p.m.