File: normalize.Rd

package info (click to toggle)
r-cran-tmb 1.9.17-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 4,344 kB
  • sloc: cpp: 52,049; ansic: 382; makefile: 11
file content (30 lines) | stat: -rw-r--r-- 1,187 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/normalize.R
\name{normalize}
\alias{normalize}
\title{Normalize process likelihood using the Laplace approximation.}
\usage{
normalize(obj, flag, value = 0)
}
\arguments{
\item{obj}{Model object from \code{MakeADFun} without proper normalization of the random effect likelihood.}

\item{flag}{Flag to disable the data term from the model.}

\item{value}{Value of 'flag' that signifies to not include the data term.}
}
\value{
Modified model object that can be passed to an optimizer.
}
\description{
If the random effect likelihood contribution of a model has been
implemented without proper normalization (i.e. lacks the normalizing
constant), then this function can perform the adjustment
automatically. In order for this to work, the model must include a
flag that disables the data term so that the un-normalized random effect
(negative log) density is returned from the model template.
Automatic process normalization may be useful if either the
normalizing constant is difficult to implement, or if its calulation
involves so many operations that it becomes infeasible to include in
the AD machinery.
}