Chi2fit.Fit.chi2
You're seeing just the function
chi2
, go back to Chi2fit.Fit module for more information.
Link to this function
chi2(observables, fun, penalties \\ fn _ -> 0.0 end, options \\ [])
View SourceSpecs
Calculates the Chi-squared function for a list of observables.
The observables
are given as a list. Each observation has an error associated with it. The errors can be either
symmetric or asymmetric.
A 'penalties'-function is used to assign penalties and these contribute to the chi-squared function. It may be used to 'forbid' certain parameter, x combinations.
Options
`model` - Required. Determines the contribution to chi-squared taking the asymmetric errors into account.
Vaid values are `:linear`, `:simple`, and `:asimple`. See Errors below
Errors
`simple` - Use for asymmetric errors when the sigma+ and sigma- are close to each other
`asimple` - Use for asymmetric errors when y-values are not bound.
`linear` - Use this model when the y-values ar bound between 0 and 1. Linear transformation that:
- is continuous in u=0,
- passes through the point sigma+ at u=1,
- asymptotically reaches 1-y at u->infinity
- pass through the point -sigma- at u=-1,
- asymptotically reaches -y at u->-infinity
Examples
iex> fun = &(&1)
...> chi2 [{0,3,1}], fun
9.0
iex> fun = &(&1)
...> chi2 [{0,3,1},{1,7,1},{2,3,1}], fun
46.0
iex> fun = &(&1)
...> chi2 [{0,3,3},{1,7,1},{2,3,1}], fun
38.0
iex> fun = &(&1-2)
...> chi2 [{0,3,1}], fun
25.0
end