53 lines
1.4 KiB
C
53 lines
1.4 KiB
C
/* This file contains functions to perform
|
|
* statistical tests on the points sampled
|
|
* from a Landau distribution.
|
|
*/
|
|
|
|
#include <gsl/gsl_rng.h>
|
|
#include <gsl/gsl_roots.h>
|
|
|
|
#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.
|
|
* The `min,max` parameters are the initial search
|
|
* interval for the optimisation.
|
|
*
|
|
* If `err` is true print the estimate error.
|
|
*/
|
|
double numeric_mode(double min, double max,
|
|
gsl_function *pdf,
|
|
int err);
|
|
|
|
|
|
/* Numerically computes the FWHM of a PDF
|
|
* distribution using the definition.
|
|
* The `min,max` parameters are the initial search
|
|
* 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₋.
|
|
*
|
|
* If `err` is true print the estimate error.
|
|
*/
|
|
double numeric_fwhm(double min, double max,
|
|
gsl_function *pdf,
|
|
int err);
|
|
|
|
|
|
/* Trapani infinite moment test
|
|
*
|
|
* Tests whether the `order`-th moment of the
|
|
* distribution of `sample` is infinite.
|
|
* The test generates an artificial sample of
|
|
* r points, where r = n^θ and returns a p-value.
|
|
*/
|
|
double trapani(gsl_rng *rng, double theta, double psi,
|
|
int order, double *sample, size_t n);
|