R/calc_sphered_resid.R

Defines functions calc_sphered_resid

calc_sphered_resid <-
function(raw_residuals, Q){
  # Calculate sphered residuals. First verify that raw_residuals is a numeric
  # vector.
  stopifnot(is.vector(raw_residuals), is.numeric(raw_residuals), is.numeric(Q))
  if(is.matrix(Q)){
    sphered_residuals <- as.vector(Q %*% raw_residuals)
  } else {
    sphered_residuals <- Q * raw_residuals
  }
  return(sphered_residuals)
}

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.