Macros | Functions
vnl_chi_squared.hxx File Reference
#include "vnl_chi_squared.h"
#include <vnl/algo/vnl_netlib.h>

Go to the source code of this file.

Macros

#define VNL_CHI_SQUARED_INSTANTIATE(T)
 

Functions

template<class T >
double vnl_chi_squared_cumulative (T chisq, long dof)
 Compute cumulative distribution function value for chi-squared distribution. More...
 
template<class T >
double vnl_chi_squared_statistic_1 (T const *A, T const *B, int n, bool normalize)
 Name space for various chi-squared distribution functions. More...
 
template<class T >
double vnl_chi_squared_statistic_2 (T const *A, T const *B, int n, bool normalize)
 $\displaystyle \sum_i \frac{ (a[i] - b[i])^2 }{ b[i] } $ More...
 
template<class T >
double vnl_chi_squared_statistic_12 (T const *A, T const *B, int n, bool normalize)
 $\displaystyle \sum_i \frac{ (a[i] - b[i])^2 }{ a[i] + b[i] } $ More...
 

Macro Definition Documentation

◆ VNL_CHI_SQUARED_INSTANTIATE

#define VNL_CHI_SQUARED_INSTANTIATE (   T)
Value:
template VNL_ALGO_EXPORT double vnl_chi_squared_cumulative (T chisq, long dof); \
template VNL_ALGO_EXPORT double vnl_chi_squared_statistic_1 (T const *, T const *, int, bool); \
template VNL_ALGO_EXPORT double vnl_chi_squared_statistic_2 (T const *, T const *, int, bool); \
template VNL_ALGO_EXPORT double vnl_chi_squared_statistic_12(T const *, T const *, int, bool)
double vnl_chi_squared_statistic_1(T const *A, T const *B, int n, bool normalize)
Name space for various chi-squared distribution functions.
double vnl_chi_squared_statistic_12(T const *A, T const *B, int n, bool normalize)
double vnl_chi_squared_cumulative(T chisq, long dof)
Compute cumulative distribution function value for chi-squared distribution.
double vnl_chi_squared_statistic_2(T const *A, T const *B, int n, bool normalize)

Definition at line 98 of file vnl_chi_squared.hxx.

Function Documentation

◆ vnl_chi_squared_cumulative()

template<class T >
double vnl_chi_squared_cumulative ( chisq,
long  dof 
)

Compute cumulative distribution function value for chi-squared distribution.

This subroutine computes the cumulative distribution function value for the chi-squared distribution with integer degrees of freedom parameter = dof. This distribution is defined for all non-negative chisq. Thus if a random variable x is drawn from a chi-squared distribution with d degrees of freedom, then $P(x < X) =$ vnl_chi_squared_cumulative(X,d). Internally, T=double is used.

Definition at line 14 of file vnl_chi_squared.hxx.

◆ vnl_chi_squared_statistic_1()

template<class T >
double vnl_chi_squared_statistic_1 ( T const *  A,
T const *  B,
int  n,
bool  normalize 
)

Name space for various chi-squared distribution functions.

A[] and B[] are (pointers to) arrays containing histograms. If the 'normalize' parameter is true, each histogram will be implicitly normalized (so as to sum to 1) before the statistic is calculated :

$a[i] = A[i] / \sum_j A[j]$

$b[i] = B[i] / \sum_j B[j]$

DO NOT add scale factors to these functions or you will break the code written by those who read the documentation. fsm.

$\displaystyle \sum_i \frac{ (a[i] - b[i])^2 }{ a[i] } $

Definition at line 24 of file vnl_chi_squared.hxx.

◆ vnl_chi_squared_statistic_12()

template<class T >
double vnl_chi_squared_statistic_12 ( T const *  A,
T const *  B,
int  n,
bool  normalize 
)

$\displaystyle \sum_i \frac{ (a[i] - b[i])^2 }{ a[i] + b[i] } $

Definition at line 64 of file vnl_chi_squared.hxx.

◆ vnl_chi_squared_statistic_2()

template<class T >
double vnl_chi_squared_statistic_2 ( T const *  A,
T const *  B,
int  n,
bool  normalize 
)

$\displaystyle \sum_i \frac{ (a[i] - b[i])^2 }{ b[i] } $

Definition at line 58 of file vnl_chi_squared.hxx.