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
|