TMB Documentation  v1.9.11
tmbutils_extra.hpp
1 // Copyright (C) 2013-2015 Kasper Kristensen
2 // License: GPL-2
3 
4 namespace tmbutils {
5 
6 template<class Type, class T1, class T2>
7 vector<Type> dnorm(vector<Type> x, T1 mean, T2 sd, int give_log=0)
8 {
9  vector<Type> logres;
10  x=(x-mean)/sd;
11  logres=-log(Type(sqrt(2*M_PI))*sd)-Type(.5)*x*x;
12  if(give_log)return logres; else return exp(logres);
13 }
14 
15 } // End namespace
16 
17 // Convenience utilites
18 #include "spmat.hpp"
19 #include "kronecker.hpp"
20 #include "matexp.hpp"
21 #include "order.hpp"
22 #include "splines.hpp"
23 #include "interpol.hpp"
24 #include "density.hpp"
25 #include "romberg.hpp"
26 #include "autodiff.hpp"
Romberg integration.
R&#39;s spline function wrapped into template class that can be used with TMB.
Matrix exponential.
Vector class used by TMB.
Definition: vector.hpp:17
Type dnorm(Type x, Type mean, Type sd, int give_log=0)
Probability density function of the normal distribution.
Definition: dnorm.hpp:17
Classes to construct multivariate negative log Gaussian density objects.
Easy access to AD library.
Extends Eigen::SparseMatrix class.
Kronecker product of two matrices.
Utility functions for TMB (automatically included)
Definition: concat.hpp:5
Atomic interpolation operator.
License: GPL v2