% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/lam_yao.R
\name{.lam_yao}
\alias{.lam_yao}
\title{Lam and Yao (2012) Eigenvalue Ratio Estimator}
\usage{
.lam_yao(X, kmax, h = 1)
}
\arguments{
\item{X}{Numeric matrix of dimensions T x N, typically preprocessed by
\code{.prepare_matrix()}.}

\item{kmax}{Integer. Maximum number of factors to consider.}

\item{h}{Integer. Number of lags to use in constructing the auto-covariance
matrix M. Defaults to \code{1}. The paper suggests small values are
sufficient; increasing h may improve performance when factors have
strong serial correlation.}
}
\value{
A named list with the following elements:
\describe{
\item{k}{Integer. Selected number of factors.}
\item{ratios}{Numeric vector of length kmax. Full eigenvalue ratio
sequence of M.}
\item{eigenvalues}{Numeric vector of length kmax + 1. Leading
eigenvalues of M in descending order.}
}
}
\description{
Estimates the number of factors using the eigenvalue ratio estimator of
Lam and Yao (2012). Unlike estimators based on the contemporaneous
covariance matrix, this estimator uses lagged auto-covariance matrices,
exploiting the fact that the factor loading space is spanned by the
eigenvectors of the summed lagged auto-covariance matrix M corresponding
to its nonzero eigenvalues.
}
\details{
The estimator constructs the N x N matrix:
\deqn{M = \sum_{k=1}^{h} \hat{\Sigma}_k \hat{\Sigma}_k'}
where \eqn{\hat{\Sigma}_k = T^{-1} \sum_{t=k+1}^{T} x_t x_{t-k}'} is
the lag-k sample auto-covariance matrix.

The factor loading space is spanned by the eigenvectors of M
corresponding to its nonzero eigenvalues, and the number of nonzero
eigenvalues equals the number of factors r (Lam and Yao, 2012,
Proposition 1). In finite samples, the ratio of adjacent eigenvalues
of M spikes at r because eigenvalues r+1 onward are theoretically zero.

The number of factors is estimated as:
\deqn{\hat{r} = \arg\max_{1 \leq k \leq k_{max}} \frac{\lambda_k(M)}{\lambda_{k+1}(M)}}
}
\references{
Lam, C. and Yao, Q. (2012). Factor Modelling for High-Dimensional
Time Series: Inference for the Number of Factors.
\emph{The Annals of Statistics}, 40(2), 694-726.
}
\seealso{
\code{.ahn_horenstein()}, \code{\link{select_factors}}
}
