ADMB Documentation  -a65f1c97
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
cregress.cpp
Go to the documentation of this file.
1 /*
2  * $Id$
3  *
4  * Author: David Fournier
5  * Copyright (c) 2008-2012 Regents of the University of California
6  */
11 #include <fvar.hpp>
12 
17 double regression(const dvector& obs, const dvector& pred)
18 {
19  double nobs=double(size_count(obs));
20  double vhat=norm2(obs-pred);
21  vhat/=nobs;
22  return (.5*nobs*log(vhat));
23 }
Vector of double precision numbers.
Definition: dvector.h:50
Author: David Fournier Copyright (c) 2008-2012 Regents of the University of California.
double norm2(const d3_array &a)
Return sum of squared elements in a.
Definition: d3arr2a.cpp:167
double regression(const dvector &obs, const dvector &pred)
Description not yet available.
Definition: cregress.cpp:17
unsigned int size_count(const dvector &x)
Returns total size of elements in vector x.
Definition: dsize.cpp:17
d3_array log(const d3_array &arr3)
Author: David Fournier Copyright (c) 2008-2012 Regents of the University of California.
Definition: d3arr2a.cpp:13