TMB Documentation
v1.9.11
|
Namespace with special functions and derivatives. More...
Classes | |
struct | AtomicGlobal |
For backwards compatibility with CppAD. More... | |
struct | AtomicLocal |
User interface to checkpointing using TMBad. More... | |
Functions | |
template<class Type > | |
matrix< Type > | absm (matrix< Type > x) |
Matrix absolute value. More... | |
template<class Type > | |
CppAD::vector< Type > | bessel_i_10 (CppAD::vector< Type > x) |
Atomic version of \(besselI(x,\nu)\). Valid parameter range: \(x =(x,\nu) \in \mathbb{R}_+\times\mathbb{R}\). More... | |
template<class Type > | |
CppAD::vector< Type > | bessel_k_10 (CppAD::vector< Type > x) |
Atomic version of \(besselK(x,\nu)\). Valid parameter range: \(x =(x,\nu) \in \mathbb{R}_+\times\mathbb{R}\). More... | |
template<class Type > | |
CppAD::vector< Type > | D_incpl_gamma_shape (CppAD::vector< Type > x) |
Atomic version of scaled incomplete gamma function differentiated to any order wrt. shape parameter \[ \exp(c) \int_0^{y} \exp(-t) t^{\lambda-1} \log(t)^n \:dt \] where the 4 input parameters are passed as a vector \(x=(y,\lambda,n,c)\). Note that the normalized incomplete gamma function is obtained as the special case \(n=0\) and \(c=-\log \Gamma(\lambda)\). Valid parameter range: \(x \in \mathbb{R}_+\times\mathbb{R}_+\times\mathbb{N}_0\times\mathbb{R}\). More... | |
template<class Type > | |
CppAD::vector< Type > | D_lgamma (CppAD::vector< Type > x) |
Atomic version of the n'th order derivative of the log gamma function. \[ \frac{d^n}{d\lambda^n}\log \Gamma(\lambda) \] where the 2 input parameters are passed as a vector \(x=(\lambda,n)\). The special case \(n=0\) gives the log gamma function. More... | |
template<class Type > | |
matrix< Type > | expm (matrix< Type > x) |
Matrix exponential. More... | |
template<class Type > | |
vector< std::complex< Type > > | fft (vector< std::complex< Type > > xc, bool inverse=false) |
FFT (unscaled) More... | |
template<class Type > | |
CppAD::vector< Type > | inv_incpl_gamma (CppAD::vector< Type > x) |
Atomic version of inverse of scaled incomplete gamma function. Given \(z\) find \(y\) such that \[ z = \exp(c) \int_0^{y} \exp(-t) t^{\lambda-1} \:dt \] where the 3 input parameters are passed as a vector \(x=(z,\lambda,c)\). The special case \(c=-\log \Gamma(\lambda)\) gives the inverse normalized incomplete gamma function. Valid parameter range: \(x \in \mathbb{R}_+\times\mathbb{R}_+\times\mathbb{R}\). More... | |
template<class Type > | |
CppAD::vector< Type > | invpd (CppAD::vector< Type > x) |
Atomic version of log determinant and inverse of positive definite n-by-n matrix. Calculated by Cholesky decomposition. More... | |
template<class Type > | |
CppAD::vector< Type > | logdet (CppAD::vector< Type > x) |
Atomic version of log determinant of positive definite n-by-n matrix. More... | |
template<class Type > | |
Type | logdet (matrix< Type > x) |
Log-determinant of positive definite matrix. | |
template<class Type > | |
CppAD::vector< Type > | matinv (CppAD::vector< Type > x) |
Atomic version of matrix inversion. Inverts n-by-n matrix by LU-decomposition. More... | |
template<class Type > | |
matrix< Type > | matinv (matrix< Type > x) |
Matrix inverse. More... | |
template<class Type > | |
matrix< Type > | matinvpd (matrix< Type > x, Type &logdet) |
Matrix inverse and determinant. More... | |
template<class Type > | |
CppAD::vector< Type > | matmul (CppAD::vector< Type > x) |
Atomic version of matrix multiply. Multiplies n1-by-n2 matrix with n2-by-n3 matrix. More... | |
template<class Type > | |
matrix< Type > | matmul (matrix< Type > x, matrix< Type > y) |
Matrix multiply. More... | |
template<class Type > | |
CppAD::vector< Type > | pnorm1 (CppAD::vector< Type > x) |
Atomic version of standard normal distribution function. Derivative is known to be 'dnorm1'. More... | |
template<class Type > | |
CppAD::vector< Type > | ppois (CppAD::vector< Type > x) |
Atomic version of poisson cdf \(ppois(n,\lambda)\). Valid parameter range: \(x =(n,\lambda) \in \mathbb{N}_0\times\mathbb{R}_+\). More... | |
template<class Type > | |
CppAD::vector< Type > | qnorm1 (CppAD::vector< Type > x) |
Atomic version of standard normal quantile function. Derivative is expressed through 'dnorm1'. More... | |
template<class Type > | |
matrix< Type > | sqrtm (matrix< Type > x) |
Matrix square root. More... | |
Namespace with special functions and derivatives.
This namespace extends the 'derivatives table' of CppAD.
CppAD::vector<Type> atomic::bessel_i_10 | ( | CppAD::vector< Type > | x | ) |
Atomic version of \(besselI(x,\nu)\). Valid parameter range: \(x =(x,\nu) \in \mathbb{R}_+\times\mathbb{R}\).
x | Input vector of length 2. |
CppAD::vector<Type> atomic::bessel_k_10 | ( | CppAD::vector< Type > | x | ) |
Atomic version of \(besselK(x,\nu)\). Valid parameter range: \(x =(x,\nu) \in \mathbb{R}_+\times\mathbb{R}\).
x | Input vector of length 2. |
CppAD::vector<Type> atomic::D_incpl_gamma_shape | ( | CppAD::vector< Type > | x | ) |
Atomic version of scaled incomplete gamma function differentiated to any order wrt. shape parameter
\[ \exp(c) \int_0^{y} \exp(-t) t^{\lambda-1} \log(t)^n \:dt \]
where the 4 input parameters are passed as a vector \(x=(y,\lambda,n,c)\). Note that the normalized incomplete gamma function is obtained as the special case \(n=0\) and \(c=-\log \Gamma(\lambda)\). Valid parameter range: \(x \in \mathbb{R}_+\times\mathbb{R}_+\times\mathbb{N}_0\times\mathbb{R}\).
x | Input vector of length 4. |
CppAD::vector<Type> atomic::D_lgamma | ( | CppAD::vector< Type > | x | ) |
Atomic version of the n'th order derivative of the log gamma function.
\[ \frac{d^n}{d\lambda^n}\log \Gamma(\lambda) \]
where the 2 input parameters are passed as a vector \(x=(\lambda,n)\). The special case \(n=0\) gives the log gamma function.
x | Input vector of length 2. |
CppAD::vector<Type> atomic::inv_incpl_gamma | ( | CppAD::vector< Type > | x | ) |
Atomic version of inverse of scaled incomplete gamma function. Given \(z\) find \(y\) such that
\[ z = \exp(c) \int_0^{y} \exp(-t) t^{\lambda-1} \:dt \]
where the 3 input parameters are passed as a vector \(x=(z,\lambda,c)\). The special case \(c=-\log \Gamma(\lambda)\) gives the inverse normalized incomplete gamma function. Valid parameter range: \(x \in \mathbb{R}_+\times\mathbb{R}_+\times\mathbb{R}\).
x | Input vector of length 3. |
CppAD::vector<Type> atomic::invpd | ( | CppAD::vector< Type > | x | ) |
Atomic version of log determinant and inverse of positive definite n-by-n matrix. Calculated by Cholesky decomposition.
x | Input vector of length n*n. |
CppAD::vector<Type> atomic::logdet | ( | CppAD::vector< Type > | x | ) |
Atomic version of log determinant of positive definite n-by-n matrix.
x | Input vector of length n*n. |
CppAD::vector<Type> atomic::matinv | ( | CppAD::vector< Type > | x | ) |
Atomic version of matrix inversion. Inverts n-by-n matrix by LU-decomposition.
x | Input vector of length n*n. |
Referenced by newton::jacobian_sparse_plus_lowrank_t< dummy >::llt_solve(), and matinv().
CppAD::vector<Type> atomic::matmul | ( | CppAD::vector< Type > | x | ) |
Atomic version of matrix multiply. Multiplies n1-by-n2 matrix with n2-by-n3 matrix.
x | Input vector of length 2+n1*n2+n2*n3 containing the output dimension (length=2), the first matrix (length=n1*n2) and the second matrix (length=n2*n3). |
Referenced by newton::jacobian_sparse_plus_lowrank_t< dummy >::llt_solve(), and matmul().
CppAD::vector<Type> atomic::pnorm1 | ( | CppAD::vector< Type > | x | ) |
Atomic version of standard normal distribution function. Derivative is known to be 'dnorm1'.
x | Input vector of length 1. |
CppAD::vector<Type> atomic::ppois | ( | CppAD::vector< Type > | x | ) |
Atomic version of poisson cdf \(ppois(n,\lambda)\). Valid parameter range: \(x =(n,\lambda) \in \mathbb{N}_0\times\mathbb{R}_+\).
x | Input vector of length 2. |
CppAD::vector<Type> atomic::qnorm1 | ( | CppAD::vector< Type > | x | ) |
Atomic version of standard normal quantile function. Derivative is expressed through 'dnorm1'.
x | Input vector of length 1. |