R/gamma_ADFun.R

Defines functions gamma_ADFun

Documented in gamma_ADFun

#' Create a \code{TMB::ADFun} object for the gamma likelihood.
#'
#' @param x Vector of observations.
#' @return A list as returned by \code{TMB::MakeADFun} representing the negative loglikelihood of a gamma distribution.
#' @export
gamma_ADFun <- function(x) {
  TMB::MakeADFun(data = list(model = "GammaNLL", x = x),
                 parameters = list(alpha = 1, beta = 1),
                 DLL = "TMBtools_TMBExports", silent = TRUE)
}
mlysy/TMBtools documentation built on April 1, 2022, 6:18 p.m.