10 const double& ll,
const dvector& diag)
34 const double& _log_density_normal,
const double& _log_density_cauchy,
35 const double& _log_density_small_normal,
int is)
39 double& log_density_normal=(
double&) _log_density_normal;
40 double& log_density_small_normal=(
double&) _log_density_small_normal;
41 const double r2=
sqrt(2.0);
42 const double l2p=0.5*
log(2*
PI);
43 const double l3p=0.5*
log(2*
PI)-
log(3.0);
44 const double pr2=
log(
PI*r2);
45 log_density_normal=0.0;
46 log_density_cauchy=0.0;
50 for (
int i=1;i<=nvar;i++)
57 while (u<.0001 || u>.9999);
59 log_density_normal-= l2p +.5*mix(i)*mix(i);
60 log_density_small_normal-= l3p +4.5*mix(i)*mix(i);
61 log_density_cauchy+= -pr2 + 1./(1.+mix(i)*mix(i));
66 for (
int i=1;i<=nvar;i++)
73 while (u<.0001 || u>.9999);
76 log_density_normal-= l2p +.5*mix(i)*mix(i);
77 log_density_cauchy+= -pr2 + 1./(1.+mix(i)*mix(i));
78 log_density_small_normal-= l3p +4.5*mix(i)*mix(i);
83 for (
int i=1;i<=nvar;i++)
90 while (u<.0001 || u>.9999);
92 log_density_normal-= l2p +.5*mix(i)*mix(i);
93 log_density_small_normal-= l3p +4.5*mix(i)*mix(i);
94 log_density_cauchy+= -pr2 + 1./(1.+mix(i)*mix(i));
99 for (
int i=1;i<=nvar;i++)
102 while (u<.0001 || u>.9999);
104 log_density_normal-= l2p +.5*mix(i)*mix(i);
105 log_density_small_normal-= l3p +4.5*mix(i)*mix(i);
106 log_density_cauchy+= -pr2 + 1./(1.+mix(i)*mix(i));
113 return tan(
PI*( (
value(z)-min)/(max-min)-0.5 ));
118 return tan(
PI*( (z-min)/(max-min)-0.5 ));
123 const double pinv=1./
PI;
125 return min+(max-
min)*y;
130 const double pinv=1./
PI;
131 double y=
atan(z)*pinv+0.5;
132 return min+(max-
min)*y;
136 const double fmin,
const double fmax)
142 double* pvii = v.
get_v() + ii;
143 for (
int i=min;i<=
max;i++)
153 const double fmin,
const double fmax)
157 int min=
x.indexmin();
158 int max=
x.indexmax();
159 for (
int i=min;i<=
max;i++)
Base class for dvariable.
virtual void add_value(const dvector &, const int &)=0
d3_array tan(const d3_array &arr3)
Returns d3_array results with computed tan from elements in arr3.
static void get_jacobian_value(const dvector &y, const dvector &jac)
int withinbound(int lb, int n, int ub)
#define ADUNCONST(type, obj)
Creates a shallow copy of obj that is not CONST.
Vector of double precision numbers.
void fmin(double f, const independent_variables &x, const dvector &g, const int &n, const dvector &w, const dvector &h, const fmm_control &fmc)
double inv_cumd_norm(const double &x)
Description not yet available.
static void add_random_vector(const dvector &x)
Author: David Fournier Copyright (c) 2008-2012 Regents of the University of California.
df1_one_variable atan(const df1_one_variable &x)
double log_density_cauchy(const double &x)
Description not yet available.
d3_array sqrt(const d3_array &arr3)
Author: David Fournier Copyright (c) 2008-2012 Regents of the University of California.
Description not yet available.
double set_value_inv_mc(double v, double fmin, double fmax)
virtual void get_jacobian(const dvector &, const dvector &, const int &)=0
static int num_initial_params
void set_value_mc(const dvar_vector &x, const dvar_vector &v, const int &ii, const double fmin, const double fmax)
double inv_cumd_cauchy(const double &x)
Description not yet available.
double better_rand(long int &idum)
Description not yet available.
void multivariate_mixture(const dvector &_mix, int nvar, long int &iseed, const double &_log_density_normal, const double &_log_density_cauchy, const double &_log_density_small_normal, int is)
dvector value(const df1_one_vector &v)
Fundamental data type for reverse mode automatic differentiation.
d3_array log(const d3_array &arr3)
Author: David Fournier Copyright (c) 2008-2012 Regents of the University of California.
static adlist_ptr varsptr