TMB Documentation  v1.9.0
Functions
Special mathematical functions

Special mathematical functions for which derivatives are implemented. More...

Functions

template<class Type >
Type besselI (Type x, Type nu)
 besselI function (same as besselI from R). More...
 
template<class Type >
Type besselJ (Type x, Type nu)
 besselJ function (same as besselJ from R). More...
 
template<class Type >
Type besselK (Type x, Type nu)
 besselK function (same as besselK from R). More...
 
template<class Type >
Type besselY (Type x, Type nu)
 besselY function (same as besselY from R). More...
 
template<class Type >
Type lfactorial (Type x)
 Logarithm of factorial function (following R argument convention).
 
template<class Type >
Type lgamma (Type x)
 Logarithm of gamma function (following R argument convention).
 
template<class Type >
Type logspace_add (Type logx, Type logy)
 Addition in log-space. More...
 
template<class Type >
Type logspace_sub (Type logx, Type logy)
 Subtraction in log-space. More...
 
template<class Type >
Type matern (Type u, Type phi, Type kappa)
 

Detailed Description

Special mathematical functions for which derivatives are implemented.

Function Documentation

§ besselI()

template<class Type >
Type besselI ( Type  x,
Type  nu 
)

besselI function (same as besselI from R).

Note
Derivatives wrt. both arguments are implemented

Definition at line 488 of file distributions_R.hpp.

§ besselJ()

template<class Type >
Type besselJ ( Type  x,
Type  nu 
)

besselJ function (same as besselJ from R).

Note
Derivatives wrt. both arguments are implemented

Definition at line 511 of file distributions_R.hpp.

§ besselK()

template<class Type >
Type besselK ( Type  x,
Type  nu 
)

besselK function (same as besselK from R).

Note
Derivatives wrt. both arguments are implemented

Definition at line 465 of file distributions_R.hpp.

§ besselY()

template<class Type >
Type besselY ( Type  x,
Type  nu 
)

besselY function (same as besselY from R).

Note
Derivatives wrt. both arguments are implemented

Definition at line 526 of file distributions_R.hpp.

§ logspace_add()

template<class Type >
Type logspace_add ( Type  logx,
Type  logy 
)

Addition in log-space.

Calculates \(log( exp(logx) + exp(logy) )\) without causing unnecessary overflows or throwing away too much accuracy (see 'writing R-extensions'). The following reductions are applied while taping:

  • log(exp(logx) + exp(-INFINITY)) = logx
  • log(exp(-INFINITY) + exp(logy)) = logy
Parameters
logxThe logarithm of x.
logyThe logarithm of y.

Definition at line 181 of file convenience.hpp.

§ logspace_sub()

template<class Type >
Type logspace_sub ( Type  logx,
Type  logy 
)

Subtraction in log-space.

Calculates \(log( exp(logx) - exp(logy) )\) without causing unnecessary overflows or throwing away too much accuracy (see 'writing R-extensions').

Parameters
logxThe logarithm of x.
logyThe logarithm of y.

Definition at line 205 of file convenience.hpp.

§ matern()

template<class Type >
Type matern ( Type  u,
Type  phi,
Type  kappa 
)

Matern correlation function

Compute values of the Matern correlation function for given distances and parameters. Same as 'matern' from the geoR package.

Parameters
uDistance.
phiRange parameter.
kappaSmoothness parameter.
Examples:
matern.cpp.

Definition at line 129 of file convenience.hpp.

License: GPL v2