R/mshift.R

Defines functions mshift

#' Apply mode shift for use in random variable generation.
#'
#' @param z quantile.
#' @param a degrees-of-freedom parameter.
#' @param m location parameter.
#' @param shift logical; should the argument be shifted by multiplying by
#' `z` minus the mode
#'
#' @return Shifted square root of the kernel.
#'
#' @noRd
mshift <- function(z, mode, alpha, mu, shift = TRUE){
  if (shift) {
    x <- z - mode
  }else{
    x <- 1
  }

  return(x * sqrt(dgin1(z, alpha, mu, FALSE, TRUE)))
}

Try the ginormal package in your browser

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

ginormal documentation built on Aug. 28, 2023, 1:07 a.m.