optimal_g: Computes the value of g such that width of the 1-alpha...

View source: R/av.R

optimal_gR Documentation

Computes the value of g such that width of the 1-\alpha confidence interval at sample size n is minimized

Description

Computes the value of g such that width of the 1-\alpha confidence interval at sample size n is minimized

Usage

optimal_g(n, number_of_coefficients, alpha)

Arguments

n

A positive sample size integer.

number_of_coefficients

A positive integer of coefficients in the full model

alpha

A positive numeric scalar in (0,1) for nominal Type I error.

Value

A positive numeric scalar representing the optimal g that minimizes the CI width.

Examples

n <- 10000
alpha <- 0.05
g_star <- optimal_g(n, 5, alpha)
cat("The optimal g is:", g_star, "\n")


avlm documentation built on June 8, 2025, 1:53 p.m.