gammaToBeta {WALS}R Documentation

Internal function: Transform gammas back to betas

Description

Transforms posterior means \hat{\gamma}_2 and variances corresponding to transformed auxiliary regressors Z_2 back to regression coefficients \hat{\beta} of original regressors X_1 and X_2.

Usage

gammaToBeta(
  posterior,
  y,
  Z1,
  Z2,
  Delta1,
  D2,
  sigma,
  Z1inv,
  method = "original",
  svdZ1
)

Arguments

posterior

Object returned from computePosterior.

y

Response y.

Z1

Transformed focus regressors Z_1.

Z2

Transformed auxiliary regressors Z_1.

Delta1

\Delta_1 or \bar{\Delta}_1.

D2

From semiorthogonalize, if postmult = FALSE was used, then D2 = \Delta_2 T \Lambda^{-1/2}, where T are the eigenvectors of \Xi and \Lambda the diagonal matrix containing the corresponding eigenvalues. If postmult = TRUE was used, then D2 = \Delta_2 T \Lambda^{-1/2} T^{\top} = \Delta_2 \Xi^{-1/2}.

sigma

Prespecified or estimated standard deviation of the error term.

Z1inv

(Z_{1}^{\top} Z_{1})^{-1}.

method

Character. \hat{\gamma}_1 is obtained from a linear regression of Z_1 on pseudo-responses y - Z_2 \hat{\gamma}_2. If method = original, then we use lm.fit to perform the linear regression, if method = "svd", then reuse the SVD of Z_1 in svdZ1 to perform the regression.

svdZ1

Optional, only needed if method = "svd". SVD of Z_1 computed using svd.

Details

The same transformations also work for GLMs, where we replace X_1, X_2, Z_1 and Z_2 with \bar{X}_1, \bar{X}_2, \bar{Z}_1 and \bar{Z}_2, respectively. Generally, we need to replace all variables with their corresponding "bar" version. Further, for GLMs sigma is always 1.

See Magnus and De Luca (2016), De Luca et al. (2018) and Huynh (2024b) for the definitions of the variables.

References

De Luca G, Magnus JR, Peracchi F (2018). “Weighted-average least squares estimation of generalized linear models.” Journal of Econometrics, 204(1), 1–17. doi:10.1016/j.jeconom.2017.12.007.

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

Magnus JR, De Luca G (2016). “Weighted-average least squares (WALS): A survey.” Journal of Economic Surveys, 30(1), 117-148. doi:10.1111/joes.12094.


[Package WALS version 0.2.5 Index]