TMB Documentation  v1.9.11
matern.cpp
// Gaussian process with Matern covariance.
#include <TMB.hpp>
template<class Type>
Type objective_function<Type>::operator() ()
{
PARAMETER(phi);
PARAMETER(kappa);
for(int i=0; i<C.rows(); i++)
for(int j=0; j<C.cols(); j++)
C(i,j) = matern(D(i,j), phi, kappa);
Type nll = density::MVNORM_t<Type>(C)(x);
return nll;
}
License: GPL v2