computeX2M1X2: Internal function: Computes X2M1X2 for walsNB when SVD is...

View source: R/tools.R

computeX2M1X2R Documentation

Internal function: Computes X2M1X2 for walsNB when SVD is applied to Z1

Description

Exploits the SVD of \bar{Z}_1 to compute \bar{X}_{2}^{\top} \bar{M}_{1} \bar{X}_{2} to avoid directly inverting \bar{Z}_{1}^{\top} \bar{Z}_{1}.

Usage

computeX2M1X2(
  X2,
  X2start,
  qStart,
  U,
  UellStart,
  ellStart,
  psiStart,
  gStart,
  epsilonStart,
  geB
)

Arguments

X2

Design matrix for auxiliary regressors

X2start

Transformed design matrix for auxiliary regressors. Refers to \bar{X}_{2} = \bar{\Psi}^{1/2} X_{2}.

qStart

Vector \bar{q}, see section "One-step ML estimator" of \insertCitehuynhwalsnb;textualWALS for definition.

U

U of SVD of Z_1. See details.

UellStart

Vector U \bar{\ell}, see details.

ellStart

Vector \bar{\ell} see details.

psiStart

Diagonal matrix \bar{\Psi}, see section "One-step ML estimator" of \insertCitehuynhwalsnb;textualWALS for definition.

gStart

Derivative of dispersion parameter \rho of NB2 with respect to \alpha = \log(\rho) evaluated at starting values of one-step ML. gStart is a scalar. See section "ML estimation" of \insertCitehuynhwalsnb;textualWALS.

epsilonStart

Scalar \bar{\epsilon}, see section "One-step ML estimator" of \insertCitehuynhwalsnb;textualWALS for definition.

geB

\bar{g} \bar{\epsilon} / (1 + B). In code gStart*epsilonStart / (1+B). See details for definition of B. gStart is \bar{g} and epsilonStart is \bar{\epsilon}.

Details

See section "Simplification for computing \bar{X}_{2}^{\top} \bar{M}_{1} \bar{X}_{2}" in the appendix of \insertCitehuynhwals;textualWALS for details of the implementation and for the definitions of arguments Uellstart, ellStart, and geB.

All parameters that contain "start" feature the starting values for the one-step ML estimation of submodels. See section "One-step ML estimator" of \insertCitehuynhwalsnb;textualWALS for details.

References

\insertAllCited

WALS documentation built on June 22, 2024, 9:42 a.m.

Related to computeX2M1X2 in WALS...