Commit e444cf02 authored by Johan Richard's avatar Johan Richard
Browse files

GSL implementation for GaussianPrior

parent dae0aea9
......@@ -6,6 +6,7 @@
#include "dimension.h"
#include "structure.h"
#include "fonction.h"
#include<gsl/gsl_cdf.h>
/********************************************************/
/* fonction: recale */
......@@ -358,13 +359,21 @@ static double uniformPrior(double val, double min, double max)
double dierfc(double y);
/* Uniform [0:1] -> Gaussian[mean=mu, variance=sigma**2]
*/
static double gaussianPrior(double val, double mu, double sigma)
/*static double gaussianPrior(double val, double mu, double sigma)
{
double sqrtTwo = 1.414213562;
return mu + sigma*sqrtTwo*dierfc(2. * (1. - val) );
}*/
//Benjamin Clément 23th June 2020 now GSL implementation
double gaussianPrior(double val, double mu, double sigma)
{
return mu + gsl_cdf_gaussian_Pinv(val,sigma);
}
/* Inverse of errror function in double precision
*/
static const int n_ck = 60;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment