2020-03-24 02:17:39 +01:00
|
|
|
/* This file contains functions to perform
|
|
|
|
* statistical tests on the points sampled
|
|
|
|
* from a Landau distribution.
|
|
|
|
*/
|
|
|
|
|
2020-04-06 16:57:00 +02:00
|
|
|
#include <gsl/gsl_roots.h>
|
|
|
|
|
2020-03-24 02:17:39 +01:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
/* Kolmogorov distribution CDF
|
|
|
|
* for sample size n and statistic D
|
|
|
|
*/
|
|
|
|
double kolmogorov_cdf(double D, int n);
|
|
|
|
|
|
|
|
|
|
|
|
/* Numerically computes the mode of a Landau
|
|
|
|
* distribution by maximising the derivative.
|
2020-04-08 12:33:11 +02:00
|
|
|
* The `min,max` parameters are the initial search
|
2020-03-24 02:17:39 +01:00
|
|
|
* interval for the optimisation.
|
2020-04-08 12:33:11 +02:00
|
|
|
*
|
|
|
|
* If `err` is true print the estimate error.
|
2020-03-24 02:17:39 +01:00
|
|
|
*/
|
2020-04-06 16:57:00 +02:00
|
|
|
double numeric_mode(double min, double max,
|
2020-04-08 12:33:11 +02:00
|
|
|
gsl_function *pdf,
|
|
|
|
int err);
|
2020-03-24 02:17:39 +01:00
|
|
|
|
|
|
|
|
2020-04-06 20:43:00 +02:00
|
|
|
/* Numerically computes the FWHM of a PDF
|
|
|
|
* distribution using the definition.
|
2020-03-24 02:17:39 +01:00
|
|
|
* The `min,max` parameters are the initial search
|
2020-04-06 20:43:00 +02:00
|
|
|
* interval for the root search of equation
|
|
|
|
* `fwhm_equation`. Two searches are performed in
|
|
|
|
* [min, mode] and [mode, max] that will give the
|
|
|
|
* two solutions x₋, x₊. The FWHM is then x₊-x₋.
|
2020-04-08 12:33:11 +02:00
|
|
|
*
|
|
|
|
* If `err` is true print the estimate error.
|
2020-03-24 02:17:39 +01:00
|
|
|
*/
|
2020-04-06 20:43:00 +02:00
|
|
|
double numeric_fwhm(double min, double max,
|
2020-04-08 12:33:11 +02:00
|
|
|
gsl_function *pdf,
|
|
|
|
int err);
|