estimate_eta: Estimate eta from MLE coef.

View source: R/estimate_eta.R

estimate_etaR Documentation

Estimate eta from MLE coef.

Description

Use an extension of the SLOE estimator to estimate \eta = \var(X_{\mathrm{new}}^\top \hat{\beta})^{1/2}, where X_{\mathrm{new}} is a new obs. and \hat{\beta} is the MLE.

Usage

estimate_eta(X, y, beta_hat, family)

Arguments

X

A covariate matrix of size n*p.

y

A vector of responses of length n.

beta_hat

The MLE vector of length p.

family

A GLM family, with family and link. See also [compute_deriv()].

Details

Let f_y(t) be the negative log-likelihood when the response is y and linear predictor is t. Define w_i = x_i^\top H^{-1}x_i and t_i = \ x_i^\top \hat{\beta}, where x_i is the i-th obs., and H is the Hessian of the negative log-likelihood evaluated at the \hat{\beta}. Let

S_i = x_i^\top \hat{\beta} + q_i f'_{y_i}(t_i),

where

q_i = \frac{w_i}{1-w_i f''_{y_i}(t_i)}.

Then, the SLOE estimator is defined to be

\hat{\eta}^2 = \frac{1}{n}\sum_{i=1}^n S_i^2 - \left(\frac{1}{n}\sum_{i=1}^n S_i\right)^2.

Value

A numeric value of the estimated \hat{\eta}.


zq00/glmhd documentation built on April 7, 2023, 7:45 a.m.