ADMB Documentation  -a65f1c97
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
cumd_cau.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 cumd_cauchy(const double& x)
18 {
19  double t=0.0;
20  const double r2=sqrt(2.0);
21  t=atan(x/r2);
22  return (0.5 + t/PI);
23 }
24 
29 double density_cauchy(const double& x)
30 {
31  const double r2=PI*sqrt(2.0);
32  return 1./(r2*(1+0.5*x*x));
33 }
34 
39 double log_density_cauchy(const double& x)
40 {
41  const double r2=PI*sqrt(2.0);
42  return -log(r2*(1+0.5*x*x));
43 }
44 
49 double inv_cumd_cauchy(const double& x)
50 {
51  const double r2=sqrt(2.0);
52  return (r2*tan(PI*(x-0.5)));
53 }
d3_array tan(const d3_array &arr3)
Returns d3_array results with computed tan from elements in arr3.
Definition: d3arr2a.cpp:73
#define x
df1_one_variable atan(const df1_one_variable &x)
Definition: df11fun.cpp:312
double density_cauchy(const double &x)
Description not yet available.
Definition: cumd_cau.cpp:29
double log_density_cauchy(const double &x)
Description not yet available.
Definition: cumd_cau.cpp:39
d3_array sqrt(const d3_array &arr3)
Author: David Fournier Copyright (c) 2008-2012 Regents of the University of California.
Definition: d3arr2c.cpp:11
Author: David Fournier Copyright (c) 2008-2012 Regents of the University of California.
double inv_cumd_cauchy(const double &x)
Description not yet available.
Definition: cumd_cau.cpp:49
double cumd_cauchy(const double &x)
Description not yet available.
Definition: cumd_cau.cpp:17
#define PI
Definition: fvar.hpp:95
d3_array log(const d3_array &arr3)
Author: David Fournier Copyright (c) 2008-2012 Regents of the University of California.
Definition: d3arr2a.cpp:13