R/vcov_alpha.R

Defines functions vcov_alpha

################################################################################
#
# Function to extract unconstrained vcov of alpha
#
################################################################################

vcov_alpha <- function(object){
  # Compute Jacobian
  dgz <- object$dg[,object$index]
  Vmat <- object$x * dgz
  
  # Unscaled covariance matrix
  unsc.vcov <- qr.solve(crossprod(Vmat * sqrt(object$weights)))
  
  # Sigma estimator
  sigsq <- residual_sd(object)
  
  # Compute vcov matrix
  unsc.vcov * sigsq
}

Try the cgaim package in your browser

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

cgaim documentation built on June 30, 2025, 9:07 a.m.