Generalized Nonlinear Non-analytic Chi-Square Fitting

版本 1.1.0.0 (42.0 KB) 作者: Nathaniel Brahms
Performs chi-square fit with uncertainty estimation when measurement errors are known.
6.5K 次下载
更新时间 2009/9/1

查看许可证

fitChiSquare is a generalized chi-square fitting routine for any model function when data measurement errors are known; it returns the model parameters and their uncertainties at the delta chi-square = 1 boundary (68% confidence interval). It also returns the chi-square and degrees of freedom (dof) of the fit. The goodness-of-fit may be estimated by comparing chi-square/dof to 1 (<1 is a good fit; >>1 indicates a poor fit). Alternatively, it returns the fit and measurement errors when the model is known - see ErrorUnknown option.

Type "help fitChiSquare" or see the header for usage.

This function calculates the data variance from reported measurement errors, then calculates the chi-square fit. Then the function finds the projection of the delta chi^2 = 1 contour onto each parameter. In the case that the parameter uncertainties are normally distributed, the delta chi^2 = 1 method gives the 68% confidence limit for the parameters. Monte Carlo or investigations of many data sets should be used to confirm the parameter uncertainties are normally distributed.

Note that when used solely as a model fitter, fitChiSquare will generally run more slowly than fminsearch or lsqnonlin. If you are only interested in data optimization, it is recommended that you use one of the built-in functions.

If one encounters the following error message:

Unexpected termination flag 0 in non-estimating variable
minimization during uncertainty estimation

this is because the non-varying parameter minimization routine has encountered its iteration or evaluation limit. Raise UncOptions.MaxFunEvals or UncOptions.MaxIter and try again.

Note: If the user can not use lsqnonlin (i.e., the optimization toolbox is not installed), the program will use the built-in function fminsearch instead. This may reduce the robustness of the calculation.

References:
1. W.H. Press, B.P. Flannery, S.A. Teukolsky, W.T. Vetterling. Numerical Recipes; The Art of Scientific Computing. (Cambridge University Press: Cambridge). 1986.
2. P.R. Bevington, D.K. Robinson. Data Reduction and Error Analysis for the Physical Sciences. (McGraw-Hill: New York). 1992.

引用格式

Nathaniel Brahms (2024). Generalized Nonlinear Non-analytic Chi-Square Fitting (https://www.mathworks.com/matlabcentral/fileexchange/9592-generalized-nonlinear-non-analytic-chi-square-fitting), MATLAB Central File Exchange. 检索时间: .

MATLAB 版本兼容性
创建方式 R14SP1
兼容任何版本
平台兼容性
Windows macOS Linux
类别
Help CenterMATLAB Answers 中查找有关 Hypothesis Tests 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
版本 已发布 发行说明
1.1.0.0

Minor bug fix, support for 4-parameter syntax.

1.0.0.0

Minor bug fix.