Пример #1
0
/* if distributions are added here, the parameters they expected
   must be listed in interface.R */
double logdist(double x, char* distribution, vec_double* params){
    double out = 1.;
    if (!strcmp(distribution, "flat")) {
        out = gsl_ran_flat_pdf(x, params->values[0], params->values[1]);
    } else if (!strcmp(distribution, "gaussian")) {
        out = gsl_ran_gaussian_pdf(x - params->values[0], params->values[1]);
    } else if (!strcmp(distribution, "lognormal")) {
        out = gsl_ran_lognormal_pdf(x, params->values[0], params->values[1]);
    } else if (!strcmp(distribution, "beta")) {
        out = gsl_ran_beta_pdf(x, params->values[0], params->values[1]);
    } else if (!strcmp(distribution, "exponential")) {
        out = gsl_ran_exponential_pdf(x, params->values[0]);
    }
    out = log(out);
    filter_logprob(&out); 
    return(out);
}
Пример #2
0
double
flat (double x, void *p)
{
  double * c = (double *)p;
  return gsl_ran_flat_pdf (x, c[0], c[1]);
}
Пример #3
0
double toy_prior_density(double *theta, const void *arg)
{
    return gsl_ran_flat_pdf(*theta, -10, 10);
}
Пример #4
0
double bimodal_prior_density(double *theta, const void *arg)
{
    gsl_ran_flat_pdf(*theta, -10, 10);
}
Пример #5
0
double
test_flat_pdf (double x)
{
  return gsl_ran_flat_pdf (x, 3.0, 4.0);
}