TMB Documentation  v1.9.1
transform2.cpp
// Beta distributed random effects using copulas.
#include <TMB.hpp>
template<class Type>
Type objective_function<Type>::operator() ()
{
PARAMETER(phi);
PARAMETER(shape1);
PARAMETER(shape2);
PARAMETER(sd);
Type res = 0;
res += density::AR1(phi)(u);
vector<Type> unif = pnorm(u, Type(0), Type(1));
vector<Type> x = qbeta(unif, shape1, shape2);
res -= dnorm(y, x, sd, true).sum();
return res;
}
License: GPL v2