ADMB Documentation  -a65f1c97
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
vregress.cpp
Go to the documentation of this file.
1 
9 #include <fvar.hpp>
10 
15 dvariable regression(const dvector& obs, const dvar_vector& pred)
16 {
17  double nobs=double(size_count(obs));
18  dvariable vhat=norm2(obs-pred);
19  vhat/=nobs;
20  return (.5*nobs*log(vhat));
21 }
Vector of double precision numbers.
Definition: dvector.h:50
ADMB variable vector.
Definition: fvar.hpp:2172
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
Fundamental data type for reverse mode automatic differentiation.
Definition: fvar.hpp:1518
d3_array log(const d3_array &arr3)
Author: David Fournier Copyright (c) 2008-2012 Regents of the University of California.
Definition: d3arr2a.cpp:13