R/gen_t.R

Defines functions gen_t

gen_t <- function(x, df = 4, mu, sig, log = TRUE) {
  tmp <- ((gamma((df + 1) / 2) / gamma(df / 2) / sqrt(pi * df) / sig)
          * (1 + (x - mu)^2 / sig^2 / df) ^ (- (df + 1) / 2))
  if (log) {
    tmp <- log(tmp)
  }
  return(tmp)
}
cnfoley/mrclust documentation built on Oct. 20, 2021, 2:10 p.m.