R/confband_radii.R

Defines functions confband_radii

confband_radii <- function(N, Sigma_hat, df, conf.level, n, matsqrt_tol){
  rho_hat <- cov2cor(Sigma_hat)
  t <- rmvt(n = N, SqrtSigma = matsqrt(rho_hat*(df - 2)/df, tol = matsqrt_tol),
            df = df)
  t_max <- apply(t, MARGIN = 1, FUN = function(x) max(abs(x)))
  t_alpha_rho_hat <- quantile(t_max, probs = conf.level)
  radii <- t_alpha_rho_hat*sqrt(diag(Sigma_hat)/n)
  return(radii)
}

Try the distfreereg package in your browser

Any scripts or data that you put into this service are public.

distfreereg documentation built on April 4, 2025, 12:30 a.m.