estimate_variance: Estimate std.dev. of the linear predictor evaluated at the...

View source: R/estimate_variance.R

estimate_varianceR Documentation

Estimate std.dev. of the linear predictor evaluated at the MLE

Description

Estimates \eta = sd(X_\mathrm{new}^\top \hat{\beta}) where X_{\mathrm{new}} is a new obs. and \hat{\beta} is the MLE when the true coefficient is \beta

Usage

estimate_variance(x, beta, family, b_var)

Arguments

x

A covariate matrix of size n*p.

beta

A vector of true model coef. (used to sample y)

family

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

b_var

Numeric. Number of bootstrap samples

Details

Generate b_var parametric bootstrap samples by sampling new responses y at the observed covariates and when the model coef. is beta. Use SLOE to estimate \eta in each bootstrap sample.

Value

A vector of length b_var of \hat{\eta} in each bootstrap sample. if the GLM function reports an error in more than 50


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