template <class Type>
Type f(Type x){return Type(2)/(Type(1) + exp(-Type(2) * x)) - Type(1);}
template<class Type>
Type objective_function<Type>::operator() ()
{
  Type phi=f(transf_phi);
  Type res=0;
  res+=AR1(phi,AR1(phi,AR1(phi,AR1(phi))))(eta);
  
  for(int i=0;i<N.size();i++)res-=N[i]*eta[i]-exp(eta[i]);
    AR1(phi,AR1(phi,AR1(phi,AR1(phi)))).simulate(eta);
  }
  return res;
}
   
License: