estimate_gamma: Estimate the signal strength

View source: R/estimate_gamma.R

estimate_gammaR Documentation

Estimate the signal strength

Description

Estimating gamma using the SLOE estimator and parametric bootstrap

Usage

estimate_gamma(s_seq, eta_hat, eta_obs, sd_obs, verbose = T, filename = NA)

Arguments

s_seq

A sequence of shrinkage factors s.

eta_hat

A matrix. The number of rows is equal to the length of s_seq, the number of columns is equal to the number of parametric bootstrap samples at each s.

eta_obs

\hat{\eta} computed using observed samples.

sd_obs

Observed standard deviation of the linear predictors evaluated at \hat{\beta}, i.e., sd(x_i^\top \hat{\beta}).

verbose

Plot \gamma versus shrinkage factors s if TRUE.

filename

If a file name is provided, then save the plot of \hat{\eta}(s) versus \gamma to filename.

Details

We estimate \gamma by the standard deviation of sd(x_i^\top \beta(s_{\star})), where \beta(s_\star) = s_\star \cdot \hat{\beta}. We use the following relationship: if sd(x_i^\top \beta(s_{\star}))\approx \gamma, then \hat{\eta}(s_\star) \approx \hat{\eta}. In this equation, \hat{\eta} is the estimated \hat{\eta} from the observations, \eta(s) is \eta when the model coefficient is \beta(s) = s\cdot\hat{\beta}. We estimate \eta(s) by parametric bootstrap, fixing the covariates at the observed values and setting the model coefficients as \beta(s) (see [estimate_variance] on how to estimate \eta(s)).

We pick a sequence of shrinkage factors s, and then compute \hat{\eta}(s) for each of them. Then, we fit a LOESS curve of \eta(s) as a function of s using the sequence of s and the estimated \hat{\eta}(s) at each bootstrap sample. Finally, we choose the shrinkage factor s_\star on the curve such that the fitted value is equal to the observed \hat{\eta}.

The estimated \hat{\gamma} is sd(x_i^\top \beta(s_{\star})).

Value

s_hat

A numeric value of the estimated shrinkage factor s that satisfies \hat{s} \mathrm{sd}(X^\top \hat{\beta}) = \hat{\gamma}.

gamma_hat

A numeric value of the estimated signal strength.


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