Skip to contents

\(f_{n\varepsilon}\) (5.25) and \(f_{nU}\) (5.26) together. The pair is returned together because the two bandwidths are NOT interchangeable: Theorem 5.4 treats them separately, and \(f_{n\varepsilon}\) needs no division at all – it is built from \(|\psi_{n\eta}|^{1/2}\) directly – while \(f_{nU}\) divides by it. That asymmetry is why they take different bandwidths in practice. Mirrors morie.fn.hrzfneps.

Usage

morie_panel_densities(
  y,
  x,
  beta,
  nu_U = NULL,
  nu_eps = NULL,
  grid_u = NULL,
  grid_z = NULL,
  kernel = "fourfold"
)

Arguments

y

numeric matrix (n, T) of responses.

x

numeric array (n, T, d) or matrix (n*T, d).

beta

root-n consistent coefficients.

nu_U, nu_eps

the two bandwidths; sigma_eps / sqrt(log n) for f_U and 0.5 sigma_eps N^(-1/5) for f_eps when NULL, sigma_eps = sd(eta) / sqrt(2).

grid_u, grid_z

evaluation points.

kernel

"fourfold" (default; the book's characteristic function, assumption PHU7) or "flattop" (indicator of \([-1, 1]\): outside PHU7, higher-order bias, 2-3 times smaller errors in simulation). Each has its own default bandwidths.

Value

list: grid_u, f_U, grid_z, f_eps, nu_U, nu_eps, f_eps_requires_division, f_U_requires_division, bandwidths_independent, n, T, method.

References

Horowitz, Sec. 5.2.1-5.2.2, eqs. (5.25)-(5.26), P1-P4, Theorem 5.4.

Examples

set.seed(1)
n <- 60
tt <- 3
x <- array(rnorm(n * tt * 2), dim = c(n, tt, 2))
y <- matrix(rnorm(n * tt), n, tt)
morie_panel_densities(y, x, c(1, -0.5))$f_U_requires_division
#> [1] TRUE