TMB Documentation  v1.9.1
linreg_parallel.cpp
// Parallel linear regression.
#include <TMB.hpp>
template<class Type>
Type objective_function<Type>::operator() ()
{
PARAMETER(logSigma);
for(int i=0; i<x.size(); i++)
nll -= dnorm(Y[i], a+b*x[i], exp(logSigma), true);
return nll;
}
License: GPL v2