Package ComboCode :: Package cc :: Package statistics :: Module BasicStats
[hide private]
[frames] | no frames]

Module BasicStats

source code

Performing basic statistics.

Author: R. Lombaert

Functions [hide private]
float
calcChiSquared(data, model, noise, ndf=0, mode='diff')
Calculate the reduced chi-squared value of a data array minus a model array, taking into account the noise in the data array.
source code
float
calcLoglikelihood(data, model, noise)
Calculate the loglikelihood value of a data array minus a model array, taking into account the noise in the data array.
source code
Variables [hide private]
  __package__ = 'ComboCode.cc.statistics'
Function Details [hide private]

calcChiSquared(data, model, noise, ndf=0, mode='diff')

source code 

Calculate the reduced chi-squared value of a data array minus a model array, taking into account the noise in the data array.

Parameters:
  • data (array) - The data set. Must have same dimensions as model!
  • model (array) - The model array. Must have same dimensions as data!
  • noise (float/array) - the noise in the data array. Give one value for overall noise or individual values for every entry in data/model.
  • ndf (int) - Number of degrees of freedom. Default in case of calculating for one single model. Typically the number of variable grid parameters in a grid calculation.

    (default: 0)

  • mode (str) - The method used for the chi^2 calculation. 'diff' is the standard differentiation of the chi^2. 'log' redistributes the ratio of data and model points on a logarithmic scale such that lower than 1 or larger than 1 are essentially equivalent. This removes bias in either direction of 1. Other than the input array distribution the chi^2 'log' method is mathematically equivalent to the differentiation.

    (default: 'diff')

Returns: float
The chi squared value

calcLoglikelihood(data, model, noise)

source code 

Calculate the loglikelihood value of a data array minus a model array, taking into account the noise in the data array.

Parameters:
  • data (array) - The data set. Must have same dimensions as model!
  • model (array) - The model array. Must have same dimensions as data!
  • noise (float/array) - the noise in the data array.
Returns: float
The loglikelihood value