% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/ife.R
\name{.bias_correct_mw}
\alias{.bias_correct_mw}
\title{Compute Bias-Corrected Coefficients for the Dynamic IFE Estimator}
\usage{
.bias_correct_mw(
  beta,
  F_hat,
  Lambda_hat,
  X_dm_arr,
  X_tilde,
  e_mat,
  N,
  TT,
  p,
  r,
  M1 = 1L
)
}
\arguments{
\item{beta}{p-vector of uncorrected IFE coefficients}

\item{F_hat}{T x r factor matrix}

\item{Lambda_hat}{N x r loading matrix}

\item{X_dm_arr}{T x N x p array of demeaned covariates (after additive FE)}

\item{X_tilde}{T x N x p double-projected covariates (M_Lambda M_F applied)}

\item{e_mat}{T x N matrix of full-model residuals}

\item{N, TT, p, r}{panel dimensions}

\item{M1}{lag bandwidth for B1 (number of lags to include; default 1)}
}
\value{
list:
beta_bc  p-vector: bias-corrected coefficients
B1_hat   p-vector: dynamic bias term (pre-multiplied by D0_inv; scaled by 1/(NT))
B2_hat   p-vector: cross-section heteroscedasticity bias (same as Bai B_hat)
B3_hat   p-vector: time heteroscedasticity bias (same as Bai C_hat)
}
\description{
Applies the three-term asymptotic bias correction from Moon and
Weidner (2017) Corollary 4.5 to the raw dynamic IFE coefficient vector:
\deqn{\hat{\beta}^* = \hat{\beta} + W^{-1}\!\left(\hat{B}_1/T + \hat{B}_2/N + \hat{B}_3/T\right)}
where \eqn{\hat{B}_1} corrects for the Nickell-type bias arising from
predetermined (lagged) regressors using a lag-truncation bandwidth \code{M1},
and \eqn{\hat{B}_2}, \eqn{\hat{B}_3} correct for cross-sectional and
time-series heteroskedasticity respectively. The latter two terms are
algebraically equivalent to the Bai (2009) \eqn{\hat{B}} and \eqn{\hat{C}}
terms.
}
\keyword{internal}
