Type: Package
Title: Robust Exponential Factor Analysis
Date: 2025-12-06
Version: 0.2.0
Author: Jiaqi Hu [cre, aut], Xueqin Wang [aut]
Maintainer: Jiaqi Hu <hujiaqi@mail.ustc.edu.cn>
Description: A robust alternative to the traditional principal component estimator is proposed within the framework of factor models, known as Robust Exponential Factor Analysis, specifically designed for the modeling of high-dimensional datasets with heavy-tailed distributions. The algorithm estimates the latent factors and the loading by minimizing the exponential squared loss function. To determine the appropriate number of factors, we propose a modified rank minimization technique, which has been shown to significantly enhance finite-sample performance. For more detail of Robust Exponential Factor Analysis, please refer to Hu et al. (2026) <doi:10.1016/j.jmva.2025.105567>.
Imports: fMultivar
Depends: R (≥ 3.5.0)
License: GPL (≥ 3)
Encoding: UTF-8
RoxygenNote: 7.3.3
NeedsCompilation: no
Packaged: 2025-12-06 17:07:33 UTC; hujiaqi
Repository: CRAN
Date/Publication: 2025-12-07 00:40:20 UTC

Estimation of errors for common component

Description

Estimation of errors for common component

Usage

ECC(Chat, C0)

Arguments

Chat

The estimated common component.

C0

The true common component.

Value

A numeric value of the ECC.

Author(s)

Jiaqi Hu

References

Robust factor analysis with exponential squared loss. Jiaqi Hu, Tingyin Wang, Xueqin Wang. Journal of Multivariate Analysis 2026, 213 105567; doi:10.1016/j.jmva.2025.105567

Examples


dat = gendata()
Y = dat$Y
F0 = dat$F0
L0 = dat$L0
C0 = F0 %*% t(L0)
res = REFA(dat$Y, r = 3)
Fhat = res$Fhat
Lhat = res$Lhat
Chat = Fhat %*% t(Lhat)
ECC(Chat, C0)


Principal Component Analysis for Factor Models

Description

Principal Component Analysis for Factor Models

Usage

FA(X, r)

Arguments

X

Input matrix, of dimension T\times N. Each row is an observation with N features at time point t.

r

A positive integer indicating the factor numbers.

Value

A list containing:

Fhat

The estimated factor matrix.

Lhat

The estimated loading matrix.

Author(s)

Jiaqi Hu

Examples


dat = gendata()
FA(dat$Y, r = 3)


Robust Exponential Factor Analysis

Description

Robust Exponential Factor Analysis

Usage

REFA(Y, r = 3, tau = 0.75, q = 0.05, eps = 1e-05, init = TRUE)

Arguments

Y

Input matrix, of dimension T\times N. Each row is an observation with N features at time point t.

r

A positive integer indicating the factor numbers.

tau

Hyper parameter in selecting \gamma of the loss function.

q

Hyper parameter used in the initializations, truncated PCA.

eps

The stopping criterion parameter. The default is 1e-5.

init

Warm start of the algorithm. If init = TRUE, use truncated PCA initialization. If init is a list contains F0 and L0, we will use this initialization. Otherwise, use traditional PCA initialization.

Value

A list containing:

Fhat

The estimated factor matrix.

Lhat

The estimated loading matrix.

loss

The value of the loss function.

Author(s)

Jiaqi Hu

References

Robust factor analysis with exponential squared loss. Jiaqi Hu, Tingyin Wang, Xueqin Wang. Journal of Multivariate Analysis 2026, 213 105567; doi:10.1016/j.jmva.2025.105567

Examples


# Assuming gendata() is defined in your package
dat = gendata()
REFA(dat$Y, r = 3)


Estimating Factor Numbers via Modified Rank Minimization

Description

Estimating Factor Numbers via Modified Rank Minimization

Usage

REFA_FN(Y, rmax = 8, tau = 0.75, q = 0.1, eps = 1e-04, init = TRUE)

Arguments

Y

Input matrix, of dimension T\times N. Each row is an observation with N features at time point t.

rmax

The bound of the number of factors.

tau

Hyper parameter in selecting \gamma of the loss function.

q

Hyper parameter used in the initializations, truncated PCA. Default is 0.05.

eps

The stopping criterion parameter. Default is 1e-5.

init

Warm start by truncated PCA algorithm. Default is TRUE.

Value

A list containing:

rhat

The estimated factor number.

Fhat

The estimated factor matrix.

Lhat

The estimated loading matrix.

loss

The value of the loss function.

Author(s)

Jiaqi Hu

References

Robust factor analysis with exponential squared loss. Jiaqi Hu, Tingyin Wang, Xueqin Wang. Journal of Multivariate Analysis 2026, 213 105567; doi:10.1016/j.jmva.2025.105567

Examples


# Assuming gendata() is defined in your package
dat = gendata()
REFA_FN(dat$Y, rmax = 8)


Trace ratios

Description

Trace ratios

Usage

TR(Fhat, F0)

Arguments

Fhat

The estimated factors.

F0

The true factors.

Value

A numeric value of the trace ratios.

Author(s)

Jiaqi Hu

References

Robust factor analysis with exponential squared loss. Jiaqi Hu, Tingyin Wang, Xueqin Wang. Journal of Multivariate Analysis 2026, 213 105567; doi:10.1016/j.jmva.2025.105567

Examples


dat = gendata()
Y = dat$Y
F0 = dat$F0
res = REFA(dat$Y, r = 3)
Fhat = res$Fhat
TR(Fhat, F0)


Estimating Factor Numbers Corresponding PCA

Description

Estimating Factor Numbers Corresponding PCA

Usage

est_num(X, kmax = 8, type = "BIC3")

Arguments

X

Input matrix, of dimension T\times N. Each row is an observation with N features at time point t.

kmax

The user-supplied maximum factor numbers.

type

The method used. Options include "PC1", "PC2", "PC3", "IC1", "IC2", "IC3", "AIC3", "BIC3", "ER", "GR".

Value

The estimated factor numbers.

Author(s)

Jiaqi Hu

Examples


dat = gendata()
est_num(dat$Y, kmax = 8, type = "BIC3")


Data generation process

Description

Generate heavy-tailed data.

Usage

gendata(seed = 1, T = 50, N = 50, type = "1a")

Arguments

seed

The seed used in the data generation process.

T

Time dimension.

N

Cross-sectional dimension.

type

The type of the data generation process. Options include "1a", "1b", "1c", "1d", "2a", "2b", "2c", "2d", "3a", "3b".

Value

A list containing:

Y

The observed matrix.

F0

The true factor matrix.

L0

The true loading matrix.

Author(s)

Jiaqi Hu

References

Robust factor analysis with exponential squared loss. Jiaqi Hu, Tingyin Wang, Xueqin Wang. Journal of Multivariate Analysis 2026, 213 105567; doi:10.1016/j.jmva.2025.105567

Examples

dat = gendata()
Y = dat$Y
head(Y)