---
title: 'FARS Package: Factor Augmented Regression in R'
url: https://www.emergentmind.com/topics/fars-package
type: topic
---

# FARS Package: Factor Augmented Regression in R

FARS is an R package for **factor-augmented regression scenarios** that integrates latent-factor extraction, quantile-based forecasting, density recovery, and factor stressing into a single workflow for scenario design in macroeconomic and financial applications. In the formulation of "FARS: Factor Augmented Regression Scenarios in R" [2507.10679], the package is intended to model and design scenarios for the distribution of key economic variables by combining **multi-level dynamic factor models (ML-DFMs)** with **factor-augmented quantile regressions (FA-QRs)**, and then converting quantile forecasts into full conditional densities. Its canonical use cases include baseline **Growth-at-Risk (GaR)** estimation and stressed **Growth-in-Stress (GiS)** analysis.

## 1. Statistical scope and design objective

FARS addresses a familiar problem in empirical macro-finance: a target variable of interest must be forecast conditionally on a large predictor panel whose dependence structure is too rich to handle through low-dimensional regression alone. The package resolves this by first extracting latent common components from a high-dimensional panel and then using those factors as covariates in quantile regressions for the target series [2507.10679].

The package workflow is explicitly sequential. It:  
1. estimates latent factors from a large predictor panel using a dynamic factor model, possibly with a multi-level block structure;  
2. quantifies factor uncertainty through asymptotic confidence regions corrected for loading uncertainty;  
3. fits factor-augmented quantile regressions for the target variable;  
4. recovers a full conditional density from the estimated conditional quantiles by fitting a skew-\(t\) distribution; and  
5. optionally stresses the factors by searching along the boundary of a confidence ellipsoid for values that minimize or maximize a target quantile.

This design makes FARS a scenario-construction package rather than only a factor-modeling package or only a quantile-regression package. Its distinctive feature is the explicit linkage between **factor extraction**, **uncertainty quantification**, **tail-oriented prediction**, and **stress testing**. In the paper’s terminology, the package is designed to produce scenarios for “the distribution of key economic variables” under both ordinary and adverse factor realizations [2507.10679].

## 2. Multi-level dynamic factor models

The factor-extraction layer of FARS is built around dynamic factor models, beginning with the standard representation

\[
X_t = P F_t + \epsilon_t,
\]

where \(X_t=(x_{1t},\ldots,x_{Nt})'\) is the observed predictor vector, \(F_t\) is the vector of latent common factors, \(P\) is the loading matrix, and \(\epsilon_t\) contains idiosyncratic components [2507.10679].

The package emphasizes **multi-level dynamic factor models** because many macro-financial datasets are naturally partitioned into blocks. In the non-overlapping case, FARS distinguishes **pervasive/global factors** \(G_t\) from **block-specific factors** \(F_{k,t}\), writing

\[
X_t=P^{*}F_t^{*}+\epsilon_t, \qquad F_t^{*}=\left(G_t',F_{1,t}',\ldots, F_{K,t}'\right)'.
\]

The associated loading matrix is block-structured with zero restrictions, so only the relevant factors affect each block.

For overlapping blocks, the package supports a richer hierarchy with **global factors**, **pairwise semipervasive factors**, and **block-specific factors**. For three blocks, the paper gives

\[
\begin{aligned}
\begin{bmatrix}
X_{1,\cdot t} \\
X_{2,\cdot t} \\
X_{3,\cdot t}
\end{bmatrix}
&=
\begin{bmatrix}
\boldsymbol\mu_1 & \boldsymbol\kappa_{12_1} & \boldsymbol\kappa_{13_1} & 0 & \boldsymbol\lambda_1 & 0 & 0 \\
\boldsymbol\mu_2 & \boldsymbol\kappa_{12_2} & 0 & \boldsymbol\kappa_{23_2} & 0 & \boldsymbol\lambda_2 & 0 \\
\boldsymbol\mu_3 & 0 & \boldsymbol\kappa_{13_3} & \boldsymbol\kappa_{23_3} & 0 & 0 & \boldsymbol\lambda_3
\end{bmatrix}
\begin{bmatrix}
G_t \\
F_{12,t} \\
F_{13,t} \\
F_{23,t} \\
F_{1,t} \\
F_{2,t} \\
F_{3,t}
\end{bmatrix}
+
\begin{bmatrix}
\epsilon_{1,\cdot t} \\
\epsilon_{2,\cdot t} \\
\epsilon_{3,\cdot t}
\end{bmatrix}.
\end{aligned}
\]

This architecture allows the package to represent shocks that are fully common, partially shared, or strictly local.

Estimation is performed through the **sequential least squares** estimator of Breitung and Eickmeier. The paper describes the residual sum of squares objective as

\[
S(\hat{F_t}, \hat{P}) = \sum_{t=1}^{T} \left( X_t - \hat{P} \hat{F_t} \right)' \left( X_t - \hat{P} \hat{F_t} \right),
\]

and states that the algorithm iteratively initializes factors using CCA or PCA, filters out higher-level factors, extracts lower-level factors sequentially, updates loadings by least squares, and repeats until convergence. FARS also applies a **Gram–Schmidt-style orthogonalization** of factor layers so that global, semipervasive, and block-specific factors are ordered and separated [2507.10679].

## 3. Factor uncertainty and confidence regions

A central methodological feature of FARS is that it does not treat estimated factors as error-free. Instead, it computes **asymptotically valid confidence regions** for factors and corrects them for loading uncertainty [2507.10679].

For the standard dynamic factor model, the asymptotic distribution of the principal-components factor estimator is given as

\[
\sqrt{N} \left(\widehat{F}_t - F_t \right)
\overset{d}{\rightarrow } N\left( 0,\Sigma _{P}^{-1}\Gamma _{t}\Sigma _{P}^{-1}\right),
\]

where

\[
\Sigma_P=\lim_{N \rightarrow \infty} \frac{P^{\prime}P}{N}.
\]

The corresponding finite-sample covariance approximation is

\[
MSE_t=\left(\frac{\hat{P}^{\prime}\hat{P}}{N} \right)^{-1}\frac{\hat{\Gamma}_t}{N}
\left(\frac{\hat{P}^{\prime}\hat{P}}{N} \right) ^{-1}.
\]

The package implements two estimators for \(\Gamma_t\). Under cross-sectionally uncorrelated idiosyncratic components, it uses the **Bai–Ng estimator**

\[
\widehat{\Gamma }^{BN}_{t}=\frac{1}{N}\sum_{i=1}^{N}\hat{p}_{i}\hat{p}_{i}^{\prime }\hat{\varepsilon}_{it}^{2},
\]

with residuals \(\hat{\varepsilon}_{it}=x_{it}-\hat{p}_{i}'\hat{F_t}\). To allow weak cross-sectional dependence, it also implements the **Fresoli–Poncela–Ruiz estimator** with adaptive thresholding,

\[
\widetilde{\Gamma}^{FPR}= \frac{1}{N} \sum_{i=1}^N \sum_{j=1}^N \hat{p}_i \hat{p}^{\prime}_j \frac{1}{T} \sum_{t=1}^T \hat{\varepsilon}_{it} \hat{\varepsilon}_{jt} I\left(\mid \hat{\sigma}_{ij}\mid \geq c_{ij} \right).
\]

The package then adds a **subsampling correction** for loading uncertainty, following Maldonado and Ruiz:

\[
MSE^{\ast}_t =\frac{1}{N}\left(\frac{\hat{P}^{\prime}\hat{P}}{N} \right)^{-1}
\hat{\Gamma}_t \left(\frac{\hat{P}^{\prime}\hat{P}}{N} \right)^{-1}
+ \frac{N^*}{NS}\sum_{s=1}^{S}\left( \left( \hat{F}_{t}^{\ast (s)}-\hat{F}_{t}\right) \left( \hat{F}_{t}^{\ast (s)}-\hat{F}_{t} \right)^{\prime }\right).
\]

Using this corrected covariance, FARS constructs confidence ellipsoids of the form

\[
g(F_t,\alpha)=\{F_t\in{\rm I\!R}^r \mid (F_t-\hat{F_t}) MSE_t^{*-1}(F_t-\hat{F_t})\leq \chi^2_{r(\alpha)}\}.
\]

These ellipsoids are not merely inferential summaries. They are the geometric objects that define the admissible stress set used later in scenario generation. For one factor they reduce to intervals; for two factors the package uses `ellipse`; for higher dimensions it uses `SyScSelection` mesh-based hyperellipsoids [2507.10679].

## 4. Factor-augmented quantile regressions and density recovery

After factor extraction, FARS estimates **factor-augmented quantile regressions** for the target variable \(y_t\). The paper writes the \(h\)-step-ahead conditional quantile as

\[
q_{\tau^*}(y_{t+h} \mid y_t, F_t) = \mu(\tau^*, h) + \phi(\tau^*, h) y_t + \sum_{k=1}^{r} \beta_k(\tau^*, h) F_{kt}.
\]

In practice, the unknown factors are replaced with their estimates. Estimation uses standard quantile regression, specifically the Koenker–D’Orey algorithm through the R package `quantreg`. By default, the package estimates quantiles at

\[
0.05,\ 0.25,\ 0.50,\ 0.75,\ 0.95,
\]

with an `edge` argument allowing other extremes such as \(0.01\) and \(0.99\) [2507.10679].

Quantile forecasts alone do not provide a full predictive density. FARS therefore fits a **skew-\(t\) distribution** to the estimated quantiles. The density is written as

\[
f(y ; \mu, \sigma, \alpha, v)=\frac{2}{\sigma} st\left(\frac{y-\mu}{\sigma} ; v\right)sT\left(\alpha \frac{y-\mu}{\sigma} \sqrt{\frac{v+1}{v+\left(\frac{y-\mu}{\sigma}\right)^2}} ; v+1\right),
\]

where \(\mu\) is location, \(\sigma\) is scale, \(\alpha\) is shape, and \(v\) governs tail thickness.

The fitted parameters are obtained by minimizing squared discrepancy between estimated conditional quantiles and skew-\(t\)-implied quantiles:

\[
(\hat{\mu}_{t+h}, \hat{\sigma}_{t+h}, \hat{\alpha}_{t+h}, \hat{v}_{t+h})=
\arg\min_{\mu, \sigma, \alpha, v} \sum_{t=1}^{T-h}\left(\widehat{q}_{\tau^*}(y_{t+h} \mid y_t, F_t)-q_{\tau^*}(y_t ; \mu, \sigma, \alpha, v)\right)^2.
\]

This step converts a finite set of regression quantiles into a smooth conditional distribution from which risk measures can be extracted. The package’s `quantile_risk()` function is then used to obtain quantities such as the 1% GaR from the fitted density [2507.10679].

## 5. Stress scenarios, workflow, and software interface

The stressed-scenario functionality is the package’s most distinctive operational feature. Given a confidence ellipsoid \(g(F_t,\alpha)=0\), FARS searches its boundary for factor values that minimize or maximize a selected conditional quantile. For a lower-tail stress, the paper states the problem as

\[
\min_{F_t^{(S)}} \widehat{q}_{0.05}(y_{t+h}\mid y_t,F_t^{(S)})
\quad \text{s.t.} \quad g(F_t^{(S)},\alpha)=0.
\]

The resulting stressed factors \(F_t^{(S)}\) are substituted back into the FA-QR, producing **stressed quantiles**, and the same skew-\(t\) smoothing step is applied to recover a **stressed conditional density** [2507.10679].

The package exposes this pipeline through a small number of functions.

| Function | Role |
|---|---|
| `mldfm()` | Estimate ML-DFMs |
| `mldfm_subsampling()` | Generate subsample-based factor estimates |
| `create_scenario()` | Construct factor confidence ellipsoids |
| `compute_fars()` | Estimate FA-QRs; optionally stressed quantiles |
| `compute_density()` | Fit skew-\(t\) conditional densities |
| `quantile_risk()` | Extract risk quantiles from fitted densities |

The principal interfaces are structured around S3 objects. `mldfm()` returns an object of class `mldfm` containing `Factors`, `Lambda`, `Residuals`, `Method`, `Iterations`, and `Factors_list`. `compute_fars()` returns an object of class `fars` containing `Quantiles`, `Coeff`, `StdError`, `Pvalue`, and `Levels`, and in stressed mode also `Stressed_Factors` and `Stressed_Quantiles`. `compute_density()` returns a `fars_density` object with `density`, `distribution`, `optimization`, and `x_vals`.

The package also specifies several key arguments. For `mldfm()`, these include `data`, `global`, `blocks`, `block_ind`, `local`, `middle_layer`, `method`, `tol`, and `max_iter`. For `compute_density()`, the main inputs are `quantiles`, optionally `levels`, `est_points`, `random_samples`, `support`, and `nl`, where `nl = TRUE` invokes nonlinear optimization through `nloptr` rather than the default `optim()` route. This organization reflects the package’s intended use as a reproducible end-to-end scenario pipeline rather than an ad hoc collection of unrelated routines [2507.10679].

## 6. Empirical use, economic interpretation, and nomenclature

The paper’s worked application uses **U.S. GDP growth** with a quarterly dataset from **2005Q3 to 2020Q1** containing **63 global macro variables**, **248 domestic macro variables**, and **208 global financial variables** [2507.10679]. The example estimates an ML-DFM with **one global factor**, **one pairwise factor for blocks 1 and 3**, and **one local factor per block**, then proceeds through baseline GaR estimation, construction of a **99% stressed scenario**, and estimation of GiS.

The reported economic interpretation is that **GiS can be substantially more negative than GaR**, implying that densities conditional on average factor realizations may understate downside risk relative to densities conditioned on stressed but statistically plausible factor realizations. This is the policy and risk-management rationale for combining factor models with quantile regression and ellipsoidal stressing in a single package.

Within recent arXiv literature, the acronym **FARS** is not unique. It has also denoted **“Fuzzy Logic Theory-based Adaptive Reward Shaping”** in reinforcement learning [2604.15772] and **“Fully Automated Research System”** in AI-for-AI research automation [2606.31651]. In the present package context, however, FARS specifically denotes **Factor Augmented Regression Scenarios in R** [2507.10679]. That distinction matters because the econometric package is centered on ML-DFMs, FA-QRs, skew-\(t\) density recovery, and stress testing, rather than on reinforcement-learning reward shaping or autonomous scientific workflows.

Taken as a whole, FARS provides a unified statistical framework for extracting hierarchical latent factors, attaching confidence regions to those factors, projecting them into conditional quantiles of a target series, and translating those quantiles into baseline and stressed predictive densities. Its methodological significance lies in making **factor modeling**, **quantile-based tail analysis**, and **scenario design under factor uncertainty** operational within a single R package [2507.10679].

Source: https://www.emergentmind.com/topics/fars-package