ADMB Documentation  11.1.2535
 All Classes Files Functions Variables Typedefs Friends Defines
cregress.cpp
Go to the documentation of this file.
00001 /*
00002  * $Id: cregress.cpp 1112 2013-07-12 21:41:41Z johnoel $
00003  *
00004  * Author: David Fournier
00005  * Copyright (c) 2008-2012 Regents of the University of California
00006  */
00011 #include <fvar.hpp>
00012 
00017 double regression(const dvector& obs, const dvector& pred)
00018 {
00019   double nobs=double(size_count(obs));
00020   double vhat=norm2(obs-pred);
00021   vhat/=nobs;
00022   return (.5*nobs*log(vhat));
00023 }