TMB Documentation  v1.9.0
transform_parallel.cpp
// Parallel version of transform
#include <TMB.hpp>
template<class Type>
Type objective_function<Type>::operator() ()
{
PARAMETER(phi);
PARAMETER(shape);
PARAMETER(scale);
PARAMETER(sd);
res += density::AR1(phi)(u);
vector<Type> unif = pnorm(u,Type(0),Type(1));
vector<Type> x = qgamma(unif,shape,scale);
for(int i=0;i<x.size();i++)res -= dnorm(y[i],x[i],sd,true);
return res;
}
License: GPL v2