Loading [MathJax]/extensions/TeX/AMSsymbols.js
LALPulsar 7.1.1.1-ea7c608
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
falsealarm.c File Reference

Prototypes

farStructcreatefarStruct (void)
 Allocate memory for farStruct. More...
 
void destroyfarStruct (farStruct *farstruct)
 Destroy an farStruct. More...
 
INT4 estimateFAR (farStruct *output, const TwoSpectTemplate *template, const UINT4 trials, const REAL8 thresh, const REAL4VectorAligned *ffplanenoise, const REAL4VectorAligned *fbinaveratios)
 Estimate the FAR of the R statistic from the weights by a number of trials. More...
 
INT4 numericFAR (farStruct *output, const TwoSpectTemplate *template, const REAL8 thresh, const REAL4VectorAligned *ffplanenoise, const REAL4VectorAligned *fbinaveratios, const UserInput_t *inputParams, const gsl_rng *rng, const INT4 method)
 Numerically solve for the FAR of the R statistic from the weights using the Davies algorithm and a root finding algorithm. More...
 
REAL8 gsl_probR (const REAL8 R, void *param)
 For the root finding, calculating the false alarm probability of R. More...
 
REAL8 gsl_dprobRdR (const REAL8 R, void *param)
 Determine the slope of the inverse cumulative distribution function. More...
 
void gsl_probRandDprobRdR (const REAL8 R, void *param, REAL8 *probabilityR, REAL8 *dprobRdR)
 Determine the difference between the probability and log10 of the threshold as well as the slope of the inverse cumulative distribution function. More...
 
REAL8 probR (const TwoSpectTemplate *template, const REAL4VectorAligned *ffplanenoise, const REAL4VectorAligned *fbinaveratios, const REAL8 R, const UserInput_t *params, const gsl_rng *rng, INT4 *errcode)
 Analytically calculate the probability of a true signal using the Davies' method. More...
 

Go to the source code of this file.

Function Documentation

◆ createfarStruct()

farStruct * createfarStruct ( void  )

Allocate memory for farStruct.

Returns
Pointer to a farStruct

Definition at line 32 of file falsealarm.c.

◆ destroyfarStruct()

void destroyfarStruct ( farStruct farstruct)

Destroy an farStruct.

Parameters
[in]farstructPointer to a farStruct

Definition at line 46 of file falsealarm.c.

◆ estimateFAR()

INT4 estimateFAR ( farStruct output,
const TwoSpectTemplate template,
const UINT4  trials,
const REAL8  thresh,
const REAL4VectorAligned ffplanenoise,
const REAL4VectorAligned fbinaveratios 
)

Estimate the FAR of the R statistic from the weights by a number of trials.

Parameters
[out]outputPointer to a farStruct
[in]templatePointer to a TwoSpectTemplate containing a template
[in]trialsNumber of trials to estimate the FAR
[in]threshThreshold value
[in]ffplanenoisePointer to REAL4VectorAligned containing the expected 2nd FFT background estimates
[in]fbinaveratiosPointer to REAL4VectorAligned containing the noise floor variations
Returns
Status value

Definition at line 66 of file falsealarm.c.

◆ numericFAR()

INT4 numericFAR ( farStruct output,
const TwoSpectTemplate template,
const REAL8  thresh,
const REAL4VectorAligned ffplanenoise,
const REAL4VectorAligned fbinaveratios,
const UserInput_t inputParams,
const gsl_rng *  rng,
const INT4  method 
)

Numerically solve for the FAR of the R statistic from the weights using the Davies algorithm and a root finding algorithm.

Parameters
[out]outputPointer to a farStruct
[in]templatePointer to a TwoSpectTemplate containing a template
[in]threshThreshold value
[in]ffplanenoisePointer to REAL4VectorAligned containing the expected 2nd FFT background estimates
[in]fbinaveratiosPointer to REAL4VectorAligned containing the noise floor variations
[in]inputParamsPointer to UserInput_t
[in]rngPointer to gsl_rng
[in]methodInteger value of 0 (Brent's method) or 1 (Newton's method)
Returns
Status value

Definition at line 140 of file falsealarm.c.

◆ gsl_probR()

REAL8 gsl_probR ( const REAL8  R,
void *  param 
)

For the root finding, calculating the false alarm probability of R.

This method takes the average of 3 values of close by R values for stability

Parameters
[in]RR value of interest
[in]paramA gsl_probR_pars struct
Returns
Difference between the false alarm probability and the log10 threshold value

Definition at line 252 of file falsealarm.c.

◆ gsl_dprobRdR()

REAL8 gsl_dprobRdR ( const REAL8  R,
void *  param 
)

Determine the slope of the inverse cumulative distribution function.

Parameters
[in]RR value of interest
[in]paramA gsl_probR_pars struct
Returns
The slope of the inverse distribution function

Definition at line 285 of file falsealarm.c.

◆ gsl_probRandDprobRdR()

void gsl_probRandDprobRdR ( const REAL8  R,
void *  param,
REAL8 probabilityR,
REAL8 dprobRdR 
)

Determine the difference between the probability and log10 of the threshold as well as the slope of the inverse cumulative distribution function.

Parameters
[in]RR value of interest
[in]paramA gsl_probR_pars struct
[out]probabilityRThe difference between the threshold and the probability of the R value in question
[out]dprobRdRThe slope of the inverse cumulative distribution function

Definition at line 327 of file falsealarm.c.

◆ probR()

REAL8 probR ( const TwoSpectTemplate template,
const REAL4VectorAligned ffplanenoise,
const REAL4VectorAligned fbinaveratios,
const REAL8  R,
const UserInput_t params,
const gsl_rng *  rng,
INT4 errcode 
)

Analytically calculate the probability of a true signal using the Davies' method.

Parameters
[in]templatePointer to a TwoSpectTemplate with a template
[in]ffplanenoisePointer to a REAL4VectorAligned with an estimate of the background of 2nd FFT powers
[in]fbinaveratiosPointer to a REAL4VectorAligned of frequency bin average ratios
[in]RThe value of R for a given template
[in]paramsPointer to UserInput_t
[in]rngPointer to gsl_rng
[out]errcodePointer to the error code value from the Davies algorithm
Returns
log10 false alarm probability value

Definition at line 350 of file falsealarm.c.