22 const double& _log_density_normal,
const double& _log_density_cauchy,
23 const double& _log_density_small_normal,
int is);
26 dvector& b1,
const dmatrix& ch,
long int& iseed,
const double& lprob,
27 double& log_tprob,
const int& outflag);
31 const dmatrix& ch3inv,
double contaminant,
long int& iseed,
32 const double& lprob,
const double& lprob3,
double& log_tprob,
59 cerr <<
"Error trying to open file " << tmpstring
60 <<
" for reading" <<
endl;
66 cerr <<
"Incorrect number of independent variables in file"
73 cerr <<
"error reading covariance matrix from "
87 tmp(i,i)=S(i,i)*scale(i)*scale(i);
90 tmp(i,j)=S(i,j)*scale(i)*scale(j);
93 diag(i)=
sqrt(tmp(i,i));
101 S(i,i)=S(i,i)/(diag(i)*diag(i));
102 for (
int j=1;j<i;j++)
104 S(i,j)=S(i,j)/(diag(i)*diag(j));
119 ofstream ofs(
"chol2");
120 ofs << chdec <<
endl;
127 ofstream ofs(
"admodel.tmp");
147 int number_sims= 500;
150 cout <<
"Enter value for seed" <<
endl;
152 cout <<
"Enter number of simulations" <<
endl;
172 double log_tprob_normal=0.0;
173 double log_tprob_small_normal=0.0;
174 double log_tprob_cauchy=0.0;
197 cerr <<
"error illegal value for pvm_manager->mode" <<
endl;
208 log_tprob_cauchy,log_tprob_small_normal,-1);
247 for (
int i=1;i<=number_sims;i++)
249 log_tprob_normal=0.0;
250 log_tprob_small_normal=0.0;
251 log_tprob_cauchy=0.0;
263 else if (mixprob<.50)
272 log_tprob_cauchy,log_tprob_small_normal,mixswitch);
319 cerr <<
"error illega value for pvm_manager->mode" <<
endl;
static void restore_all_values(const dvector &x, const int &ii)
static adpvm_manager * pvm_manager
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)
static void set_NO_DERIVATIVES(void)
Disable accumulation of derivative information.
Vector of double precision numbers.
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.
d3_array elem_div(const d3_array &a, const d3_array &b)
Returns d3_array results with computed elements division of a(i, j, k) / b(i, j, k).
double density_cauchy(const double &x)
Description not yet available.
double inv_cumd_norms(const double &x)
static adstring adprogram_name
static int num_stddev_calc(void)
void monte_carlo_routine(void)
df1_one_matrix choleski_decomp(const df1_one_matrix &MM)
ivector sgn(const dvector &v)
Author: David Fournier Copyright (c) 2008-2012 Regents of the University of California.
double myran1(long int &)
prnstream & endl(prnstream &)
Description not yet available.
d3_array sqrt(const d3_array &arr3)
Author: David Fournier Copyright (c) 2008-2012 Regents of the University of California.
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)
Description not yet available.
static void xinit(const dvector &x)
double log_likelihood_mixture(const double &x)
Description not yet available.
void initialize(void)
Initialze all elements of dvector to zero.
double pvm_master_get_monte_carlo_value(int nvar, const dvector &x)
static void copy_all_values(const dvector &x, const int &ii)
double ln_det(const dmatrix &m1, int &sgn)
Compute log determinant of a constant matrix.
void pvm_slave_get_monte_carlo_value(int nvar)
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.
Description not yet available.
static void copy_all_values(const dvector &x, const int &ii)
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)
double get_monte_carlo_value(int nvar, const independent_variables &x)
static int stddev_scale(const dvector &d, const dvector &x)
double cumd_norm(const double &x)
Culative normal distribution; constant objects.
static unsigned int wd_flag
df1_one_variable inv(const df1_one_variable &x)
static int montecarlo_scale(const dvector &d, const dvector &x)
Description not yet available.
static int num_stddev_params