R/norm_ADFun.R

Defines functions norm_ADFun

Documented in norm_ADFun

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