Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Lenstool
Lenstool
Commits
e444cf02
Commit
e444cf02
authored
Jun 23, 2020
by
Johan Richard
Browse files
GSL implementation for GaussianPrior
parent
dae0aea9
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/o_rescale.c
View file @
e444cf02
...
...
@@ -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
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment