TMB Documentation  v1.9.11
transform.cpp
// Gamma distributed random effects using copulas.
#include <TMB.hpp>
template<class Type>
Type objective_function<Type>::operator() ()
{
PARAMETER(phi);
PARAMETER(shape);
PARAMETER(scale);
PARAMETER(sd);
Type res=0;
res += density::AR1(phi)(u);
vector<Type> unif = pnorm(u);
vector<Type> x = qgamma(unif,shape,scale);
res -= dnorm(y,x,sd,true).sum();
return res;
}
License: GPL v2