computeX2M1X2 {WALS}R Documentation

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

Description

Exploits the SVD of Zˉ1\bar{Z}_1 to compute Xˉ2Mˉ1Xˉ2\bar{X}_{2}^{\top} \bar{M}_{1} \bar{X}_{2} to avoid directly inverting Zˉ1Zˉ1\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 Xˉ2=Ψˉ1/2X2\bar{X}_{2} = \bar{\Psi}^{1/2} X_{2}.

qStart

Vector qˉ\bar{q}, see section "One-step ML estimator" of Huynh (2024a) for definition.

U

UU of SVD of Z1Z_1. See details.

UellStart

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

ellStart

Vector ˉ\bar{\ell} see details.

psiStart

Diagonal matrix Ψˉ\bar{\Psi}, see section "One-step ML estimator" of Huynh (2024a) for definition.

gStart

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

epsilonStart

Scalar ϵˉ\bar{\epsilon}, see section "One-step ML estimator" of Huynh (2024a) for definition.

geB

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

Details

See section "Simplification for computing Xˉ2Mˉ1Xˉ2\bar{X}_{2}^{\top} \bar{M}_{1} \bar{X}_{2}" in the appendix of Huynh (2024b) 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 Huynh (2024a) for details.

References

Huynh K (2024a). “Weighted-Average Least Squares for Negative Binomial Regression.” arXiv 2404.11324, arXiv.org E-Print Archive. doi:10.48550/arXiv.2404.11324.

Huynh K (2024b). “WALS: Weighted-Average Least Squares Model Averaging in R.” University of Basel. Mimeo.


[Package WALS version 0.2.5 Index]