10 const dvector& b,
dmatrix& ch,
long int& iseed,
const double& lprob,
16 const dvector& b,
dmatrix& ch,
long int& iseed,
const double& lprob,
29 const double& density,
long int& iseed);
31 const double& density,
long int& iseed);
33 const double& density,
long int& iseed);
36 double& _log_density);
45 const dmatrix& ch,
long int& iseed,
const double& lprob,
const dvector&
w);
49 const dmatrix& ch3inv,
double contaminant,
long int& iseed,
50 const double& lprob,
const double& _lprob3,
double& log_tprob,
53 double& lprob3=(
double&) _lprob3;
54 int& outflag=(
int&) _outflag;
80 double tmpa=(lprob+.5*nvar);
81 double tmpb=(lprob3-nvar*
log(3.0)+.5*nvar);
82 lprob3=lprob3-nvar*
log(3.0);
88 log_tprob=tmpa+
log((1.-contaminant)+contaminant*
exp(tmpb-tmpa));
92 log_tprob=tmpb+
log((1.-contaminant)*
exp(tmpa-tmpb)+contaminant);
98 dvector& b1,
const dmatrix& _ch,
long int& iseed,
const double& lprob,
99 double& log_tprob,
const int& _outflag)
102 int& outflag=(
int&) _outflag;
113 double tmpa=(lprob+.5*nvar);
119 const dvector& _b,
dmatrix& ch,
long int& iseed,
const double& _lprob,
122 double& lprob=(
double&) _lprob;
130 double log_density=0.0;;
131 for (
int i=1;i<=nvar;i++)
137 lprob += log_density;
138 for (
int j=i;j<=nvar;j++)
140 double tmp=y(i)*ch(j,i);
149 dvector& b1,
const dmatrix& _ch,
long int& iseed,
const double& lprob,
153 int& outflag=(
int&) _outflag;
168 const dvector& _b,
dmatrix& ch,
long int& iseed,
const double& _lprob,
171 double& lprob=(
double&) _lprob;
179 double log_density=0.0;;
180 for (
int i=1;i<=nvar;i++)
186 lprob += log_density;
187 for (
int j=i;j<=nvar;j++)
189 double tmp=y(i)*ch(j,i);
198 const dvector& _b,
const dmatrix& ch,
long int& iseed,
const double& _lprob,
201 double& lprob=(
double&) _lprob;
209 double log_density=0.0;
210 for (
int i=1;i<=nvar;i++)
216 lprob += log_density;
217 for (
int j=i;j<=nvar;j++)
219 double tmp=y(i)*ch(j,i);
231 double& lprob=(
double&) _lprob;
239 for (
int i=1;i<=nvar;i++)
244 lprob -= log_density;
245 for (
int j=i;j<=nvar;j++)
247 double tmp=y(i)*ch(j,i);
255 const double& _log_density,
long int& iseed)
257 double& log_density=(
double&) _log_density;
258 double& y=(
double&) _y;
271 log_density=w-
log(1+0.5*y*y);
275 const double& _log_density,
long int& iseed)
277 double& y=(
double&) _y;
278 double& log_density=(
double&) _log_density;
299 const double& _log_density,
long int& iseed)
301 double& y=(
double&) _y;
302 double& log_density=(
double&) _log_density;
333 log_density=w-0.5*y*y;
337 double& _log_density)
339 double& y=(
double&) _y;
340 double& log_density=(
double&) _log_density;
365 log_density=w-0.5*y*y;
378 cerr <<
"arugument of ln_normal_tail_left must be < -2.0 you have "
389 cerr <<
"arugument of ln_normal_tail_right must be > 2.0 you have "
397 double lz=
log(0.3989422804)-.5*x2;
402 double b5=b4*(x2+10);
403 double tmp=lz-
log(x) +
404 log(1.0 -1.0/b1 +1.0/b2 - a3/b3 +a4/b4 -a5/b5);
446 const double c0=2.515517;
447 const double c1=0.802853;
448 const double c2=0.010328;
449 const double d1=1.432788;
450 const double d2=0.189269;
451 const double d3=0.001308;
454 cerr <<
"Illegal argument to inv_cumd_norm = " << x <<
endl;
460 double t =
sqrt(-2.*x);
461 double p=((c2*t+c1)*t+c0)/((((d3*t+d2)*t+d1)*t)+1)-t;
473 y=
log(-x)*
log(1.0+x*(0.5+0.1666666666667*x));
475 double t =
sqrt(-2.*y);
476 double p=t-((c2*t+c1)*t+c0)/((((d3*t+d2)*t+d1)*t)+1);
543 double w=
log(0.379*
exp(-y)+0.01254/(1.+y));
551 double w=
log(0.391*
exp(-y)+0.004502/(1.+y));
562 const double beta=0.2000006361;
563 const double a1= -1.20100758;
564 const double a2= 0.705759703;
565 const double a3= -0.3969207118;
566 const double a4= 0.1013877547;
567 const double b1= 0.4064582431;
568 const double b2= -1.313226944;
569 const double b3= -0.4745760236;
570 const double b4= 0.8704844718;
573 if (x>0) x=
pow(x,beta);
575 double u=(((a4*x+a3)*x+a2)*x+a1)*x+1.0;
576 double v=(((b4*x+b3)*x+b2)*x+b1)*x+1.0;
579 else if (zz>0.002235963385)
581 const double beta=1.391943399;
582 const double a1=-0.3960836641;
583 const double a2=0.06458378977;
584 const double a3=-0.005347047973;
585 const double a4=0.0001938683488;
586 const double b1=0.1252881802;
587 const double b2=0.01855936157;
588 const double b3=-0.01768441436;
589 const double b4=0.001537604957;
592 if (x>0) x=
pow(x,beta);
594 double u=(((a4*x+a3)*x+a2)*x+a1)*x+1.0;
595 double v=(((b4*x+b3)*x+b2)*x+b1)*x+1.0;
615 const double beta=0.20000048;
616 const double a1=-2.1053015;
617 const double a2=2.4746767;
618 const double a3=-1.7449831;
619 const double a4=0.49304616;
620 const double b1=-0.27804868;
621 const double b2=-1.391687;
622 const double b3=1.0477872;
623 const double b4=-0.09850461;
626 if (x>0) x=
pow(x,beta);
628 double u=(((a4*x+a3)*x+a2)*x+a1)*x+1.0;
629 double v=(((b4*x+b3)*x+b2)*x+b1)*x+1.0;
632 else if (zz>0.002235963385)
634 const double beta=1.2392131;
635 const double a1=-0.42498166;
636 const double a2=0.07016042;
637 const double a3=-0.0053910956;
638 const double a4=0.0001646762;
639 const double b1=0.18071484;
640 const double b2=0.00029307283;
641 const double b3=-0.014820049;
642 const double b4=0.0013084549;
645 if (x>0) x=
pow(x,beta);
647 double u=(((a4*x+a3)*x+a2)*x+a1)*x+1.0;
648 double v=(((b4*x+b3)*x+b2)*x+b1)*x+1.0;
dvector bounded_multivariate_cauchy(int nvar, const dvector &a1, dvector &b1, const dmatrix &ch, long int &iseed, const double &lprob, double &log_tprob, const int &outflag)
void get_bounded_mixture(double x1, double x2, const double &y, const double &density, long int &iseed)
double inv_cumd_norm_ln(const double &x)
double ln_normal_tail_right(const double &x)
Vector of double precision numbers.
double ln_normal_tail_left(const double &x)
double inv_cumd_norm(const double &x)
Description not yet available.
double ln_normal_tail(const double &x)
dvector bounded_multivariate_normal(int nvar, const dvector &a1, const dvector &b1, dmatrix &ch, const double &_wght, const random_number_generator &rng)
double inv_cumd_norms(const double &x)
void get_bounded_normal_virtual(double x1, double x2, const double &_y, double &_log_density)
double cumd_mixture_02(const double &x)
double cumd_mixture(const double &x)
void generate_actual_multivariate_cauchy(int nvar, const dvector &a, const dvector &b, dmatrix &ch, long int &iseed, const double &lprob, const dvector &w)
prnstream & endl(prnstream &)
d3_array sqrt(const d3_array &arr3)
Author: David Fournier Copyright (c) 2008-2012 Regents of the University of California.
dvector bounded_multivariate_mixture(int nvar, const dvector &a1, dvector &b1, const dmatrix &_ch, long int &iseed, const double &lprob, const int &_outflag)
dvector bounded_robust_multivariate_normal(int nvar, const dvector &a1, const dvector &b1, dmatrix &ch, const dmatrix &ch3, double contaminant, const double &_wght, random_number_generator &rng)
double inv_cumd_mixture_02(const double &y)
Description not yet available.
void generate_actual_multivariate_mixture(int nvar, const dvector &a, const dvector &b, dmatrix &ch, long int &iseed, const double &lprob, const dvector &w)
d3_array exp(const d3_array &arr3)
Returns d3_array results with computed exp from elements in arr3.
double log_likelihood_mixture(const double &x)
dvariable beta(const prevariable &a, const prevariable &b)
Beta density function.
Description not yet available.
void get_bounded_normal(double x1, double x2, const double &y, const double &density, long int &iseed)
void initialize(void)
Initialze all elements of dvector to zero.
double log_likelihood_mixture_02(const double &x)
double inv_cumd_mixture(const double &y)
double inv_cumd_cauchy(const double &x)
Description not yet available.
double cumd_cauchy(const double &x)
Description not yet available.
double better_rand(long int &idum)
Description not yet available.
double cumd_norm(const double &x)
Culative normal distribution; constant objects.
void generate_virtual_multivariate(int nvar, const dvector &a, const dvector &b, const dmatrix &ch, const double &lprob, const dvector &eps)
void generate_actual_multivariate(int nvar, const dvector &a, const dvector &b, const dmatrix &ch, long int &iseed, const double &lprob, const dvector &w)
d3_array log(const d3_array &arr3)
Author: David Fournier Copyright (c) 2008-2012 Regents of the University of California.
void get_bounded_cauchy(double x1, double x2, const double &y, const double &density, long int &iseed)
d3_array pow(const d3_array &m, int e)
Description not yet available.