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
bin/TwoSpect/Statistics.h File Reference

Prototypes

INT4 sampleREAL4VectorAligned (REAL4VectorAligned *output, const REAL4VectorAligned *input, const gsl_rng *rng)
 Sample a number (sampleSize) of values from a REAL4VectorAligned (input) randomly. More...
 
REAL4VectorAlignedsampleREAL4VectorAlignedArray_nozerosaccepted (const REAL4VectorAlignedArray *input, const UINT4 numberofvectors, const UINT4 sampleSize, const gsl_rng *rng)
 Sample a number (sampleSize) of values from an REAL4VectorAlignedArray (input) randomly from vector 0 up to numberofvectors without accepting any values of zero Needs this numberofvectors limit because of the IHS algorithm. More...
 
REAL8 calcMeanD (const REAL8Vector *vector)
 Compute the mean value of a REAL8Vector. More...
 
REAL8 calcStddevD (const REAL8Vector *vector)
 Compute the standard deviation of a REAL8Vector. More...
 
REAL8 expRandNum (const REAL8 mu, const gsl_rng *ptrToGenerator)
 Create a exponentially distributed noise value. More...
 
REAL4VectorAlignedexpRandNumVector (const UINT4 length, const REAL8 mu, const gsl_rng *ptrToGenerator)
 
INT4 ks_test_exp (REAL8 *ksvalue, const REAL4VectorAligned *vector)
 KS test of data against an expected exponential distribution. More...
 
INT4 kuipers_test_exp (REAL8 *kuipervalue, const REAL4VectorAligned *vector)
 Kuiper's test of data against an expected exponential distribution. More...
 
REAL4 calcMean (const REAL4VectorAligned *vector)
 Compute the mean value of a REAL4VectorAligned, computed via recursion like in GSL. More...
 
REAL4 calcMean_ignoreZeros (const REAL4VectorAligned *vector)
 Compute the mean value of a REAL4VectorAligned without accepting values of zero. More...
 
INT4 calcHarmonicMean (REAL4 *harmonicMean, const REAL4VectorAligned *vector, UINT4 numfbins, UINT4 numffts)
 Compute the harmonic mean value of a REAL4VectorAligned of SFT values. More...
 
INT4 calcStddev (REAL4 *sigma, const REAL4VectorAligned *vector)
 Compute the standard deviation of a REAL4VectorAligned. More...
 
INT4 calcStddev_ignoreZeros (REAL4 *sigma, const REAL4VectorAligned *vector)
 Compute the standard deviation of a REAL4VectorAligned ignoring zero values. More...
 
INT4 calcRms (REAL4 *rms, const REAL4VectorAligned *vector)
 Compute the RMS value of a REAL4VectorAligned. More...
 
INT4 calcMedian (REAL4 *median, const REAL4VectorAligned *vector)
 Calculate the median value from a REAL4VectorAligned. More...
 
INT4 sort_float_smallest (REAL4VectorAligned *output, const REAL4VectorAligned *input)
 Sort a REAL4VectorAligned, keeping the smallest of the values in the output vector. More...
 
void sort_double_ascend (REAL8Vector *vector)
 Sort a REAL8Vector in ascending order, modifying the input vector. More...
 
void sort_float_ascend (REAL4VectorAligned *vector)
 Sort a REAL4VectorAligned in ascending order, modifying the input vector. More...
 
UINT4 max_index (const REAL4VectorAligned *vector)
 Determine the index value of the maximum value in a REAL4VectorAligned. More...
 
UINT4 max_index_double (const REAL8Vector *vector)
 Determine the index value of the maximum value in a REAL8Vector. More...
 
UINT4 max_index_in_range (const REAL4VectorAligned *vector, const UINT4 startlocation, const UINT4 lastlocation)
 Determine the index value of the maximum value between elements of a REAL4VectorAligned (inclusive) More...
 
INT4 min_max_index_INT4Vector (const INT4Vector *inputvector, UINT4 *min_index_out, UINT4 *max_index_out)
 Determine the index value of the maximum and minimum values in an INT4Vector. More...
 
INT4 qsort_REAL4_compar (const void *a, const void *b)
 
INT4 qsort_REAL8_compar (const void *a, const void *b)
 

Go to the source code of this file.

Function Documentation

◆ sampleREAL4VectorAligned()

INT4 sampleREAL4VectorAligned ( REAL4VectorAligned output,
const REAL4VectorAligned input,
const gsl_rng *  rng 
)

Sample a number (sampleSize) of values from a REAL4VectorAligned (input) randomly.

Parameters
[out]outputPointer to output REAL4VectorAligned with length less than input
[in]inputPointer to a REAL4VectorAligned to be sampled from
[in]rngPointer to a gsl_rng generator
Returns
Newly allocated REAL4VectorAligned of sampled values from the input vector

Definition at line 231 of file bin/TwoSpect/Statistics.c.

◆ sampleREAL4VectorAlignedArray_nozerosaccepted()

REAL4VectorAligned * sampleREAL4VectorAlignedArray_nozerosaccepted ( const REAL4VectorAlignedArray input,
const UINT4  numberofvectors,
const UINT4  sampleSize,
const gsl_rng *  rng 
)

Sample a number (sampleSize) of values from an REAL4VectorAlignedArray (input) randomly from vector 0 up to numberofvectors without accepting any values of zero Needs this numberofvectors limit because of the IHS algorithm.

Parameters
[in]inputPointer to a REAL4VectorAlignedArray to be sampled from
[in]numberofvectorsNumber of vectors from the start from which to sample from
[in]sampleSizeInteger value for the length of the output vector
[in]rngPointer to a gsl_rng generator
Returns
Newly allocated REAL4VectorAligned of sampled values from the input vector

Definition at line 249 of file bin/TwoSpect/Statistics.c.

◆ calcMeanD()

REAL8 calcMeanD ( const REAL8Vector vector)

Compute the mean value of a REAL8Vector.

Parameters
[in]vectorPointer to a REAL8Vector of values
Returns
Mean value

Definition at line 434 of file bin/TwoSpect/Statistics.c.

◆ calcStddevD()

REAL8 calcStddevD ( const REAL8Vector vector)

Compute the standard deviation of a REAL8Vector.

Parameters
[in]vectorPointer to a REAL8Vector of values
Returns
Standard deviation value

Definition at line 446 of file bin/TwoSpect/Statistics.c.

◆ expRandNum()

REAL8 expRandNum ( const REAL8  mu,
const gsl_rng *  ptrToGenerator 
)

Create a exponentially distributed noise value.

Parameters
[in]muMean value of the distribution
[in]ptrToGeneratorPointer to a gsl_rng generator
Returns
A random value drawn from the exponential distribution

Definition at line 40 of file bin/TwoSpect/Statistics.c.

◆ expRandNumVector()

REAL4VectorAligned * expRandNumVector ( const UINT4  length,
const REAL8  mu,
const gsl_rng *  ptrToGenerator 
)

Definition at line 46 of file bin/TwoSpect/Statistics.c.

◆ ks_test_exp()

INT4 ks_test_exp ( REAL8 ksvalue,
const REAL4VectorAligned vector 
)

KS test of data against an expected exponential distribution.

Parameters
[out]ksvaluePointer to the KS value
[in]vectorPointer to the REAL4VectorAligned to compare against an exponential distribution
Returns
Status value

Definition at line 73 of file bin/TwoSpect/Statistics.c.

◆ kuipers_test_exp()

INT4 kuipers_test_exp ( REAL8 kuipervalue,
const REAL4VectorAligned vector 
)

Kuiper's test of data against an expected exponential distribution.

Parameters
[out]kuipervaluePointer to the Kuiper's test value
[in]vectorPointer to the REAL4VectorAligned to compare against an exponential distribution
Returns
Status value

Definition at line 128 of file bin/TwoSpect/Statistics.c.

◆ calcMean()

REAL4 calcMean ( const REAL4VectorAligned vector)

Compute the mean value of a REAL4VectorAligned, computed via recursion like in GSL.

Parameters
[in]vectorPointer to a REAL4VectorAligned of values
Returns
The mean value

Definition at line 272 of file bin/TwoSpect/Statistics.c.

◆ calcMean_ignoreZeros()

REAL4 calcMean_ignoreZeros ( const REAL4VectorAligned vector)

Compute the mean value of a REAL4VectorAligned without accepting values of zero.

Parameters
[in]vectorPointer to a REAL4VectorAligned of values
Returns
The mean value

Definition at line 291 of file bin/TwoSpect/Statistics.c.

◆ calcHarmonicMean()

INT4 calcHarmonicMean ( REAL4 harmonicMean,
const REAL4VectorAligned vector,
const UINT4  numfbins,
const UINT4  numffts 
)

Compute the harmonic mean value of a REAL4VectorAligned of SFT values.

The harmonic mean is computed from the mean values of the SFTs

Parameters
[out]harmonicMeanPointer to the output REAL4 harmonic mean value
[in]vectorPointer to a REAL4Value from which to compute the harmonic mean
[in]numfbinsNumber of frequency bins in the SFTs
[in]numfftsNumber of SFTs during the observation time
Returns
Status value

Definition at line 322 of file bin/TwoSpect/Statistics.c.

◆ calcStddev()

INT4 calcStddev ( REAL4 sigma,
const REAL4VectorAligned vector 
)

Compute the standard deviation of a REAL4VectorAligned.

Parameters
[out]sigmaPointer to the output standard deviation value
[in]vectorPointer to a REAL4VectorAligned of values
Returns
Status value

Definition at line 355 of file bin/TwoSpect/Statistics.c.

◆ calcStddev_ignoreZeros()

INT4 calcStddev_ignoreZeros ( REAL4 sigma,
const REAL4VectorAligned vector 
)

Compute the standard deviation of a REAL4VectorAligned ignoring zero values.

Parameters
[out]sigmaPointer to the output standard deviation value
[in]vectorPointer to a REAL4VectorAligned of values
Returns
Status value

Definition at line 378 of file bin/TwoSpect/Statistics.c.

◆ calcRms()

INT4 calcRms ( REAL4 rms,
const REAL4VectorAligned vector 
)

Compute the RMS value of a REAL4VectorAligned.

Parameters
[out]rmsPointer to the output RMS value
[in]vectorPointer to a REAL4VectorAligned of values
Returns
Status value

Definition at line 414 of file bin/TwoSpect/Statistics.c.

◆ calcMedian()

INT4 calcMedian ( REAL4 median,
const REAL4VectorAligned vector 
)

Calculate the median value from a REAL4VectorAligned.

Parameters
[out]medianPointer to the median value
[in]vectorPointer to a REAL4VectorAligned
Returns
Status value

Definition at line 551 of file bin/TwoSpect/Statistics.c.

◆ sort_float_smallest()

INT4 sort_float_smallest ( REAL4VectorAligned output,
const REAL4VectorAligned input 
)

Sort a REAL4VectorAligned, keeping the smallest of the values in the output vector.

Parameters
[out]outputPointer to a REAL4VectorAligned containing the output vector
[in]inputPointer to the REAL4VectorAligned from which to find the smallest values
Returns
Status value

Definition at line 185 of file bin/TwoSpect/Statistics.c.

◆ sort_double_ascend()

void sort_double_ascend ( REAL8Vector vector)

Sort a REAL8Vector in ascending order, modifying the input vector.

Parameters
[in,out]vectorPointer to a REAL8Vector to be sorted

Definition at line 208 of file bin/TwoSpect/Statistics.c.

◆ sort_float_ascend()

void sort_float_ascend ( REAL4VectorAligned vector)

Sort a REAL4VectorAligned in ascending order, modifying the input vector.

Parameters
[in,out]vectorPointer to a REAL4VectorAligned to be sorted

Definition at line 218 of file bin/TwoSpect/Statistics.c.

◆ max_index()

UINT4 max_index ( const REAL4VectorAligned vector)

Determine the index value of the maximum value in a REAL4VectorAligned.

Parameters
[in]vectorPointer to REAL4VectorAligned of values
Returns
Index value of the largest element

Definition at line 458 of file bin/TwoSpect/Statistics.c.

◆ max_index_double()

UINT4 max_index_double ( const REAL8Vector vector)

Determine the index value of the maximum value in a REAL8Vector.

Parameters
[in]vectorPointer to REAL8Vector of values
Returns
Index value of the largest element

Definition at line 480 of file bin/TwoSpect/Statistics.c.

◆ max_index_in_range()

UINT4 max_index_in_range ( const REAL4VectorAligned vector,
const UINT4  startlocation,
const UINT4  lastlocation 
)

Determine the index value of the maximum value between elements of a REAL4VectorAligned (inclusive)

Parameters
[in]vectorPointer to REAL4VectorAligned of values
[in]startlocationIndex value to start from in the REAL4VectorAligned
[in]lastlocationIndex value to end at in the REAL4VectorAligned
Returns
Index value of the largest element

Definition at line 494 of file bin/TwoSpect/Statistics.c.

◆ min_max_index_INT4Vector()

INT4 min_max_index_INT4Vector ( const INT4Vector inputvector,
UINT4 min_index_out,
UINT4 max_index_out 
)

Determine the index value of the maximum and minimum values in an INT4Vector.

Parameters
[in]inputvectorPointer to INT4Vector
[out]min_index_outPointer to index value of smallest element
[out]max_index_outPointer to index value of largest element
Returns
Status value

Definition at line 522 of file bin/TwoSpect/Statistics.c.

◆ qsort_REAL4_compar()

INT4 qsort_REAL4_compar ( const void *  a,
const void *  b 
)

Definition at line 575 of file bin/TwoSpect/Statistics.c.

◆ qsort_REAL8_compar()

INT4 qsort_REAL8_compar ( const void *  a,
const void *  b 
)

Definition at line 588 of file bin/TwoSpect/Statistics.c.