[pbest, SD] = easyfit(x, y, pinit, fhandle)

EASYFIT finds the parameters P of a function y = fun(p,x) which models experimental data (x,y) as well as possible.
4.6K Downloads
Updated 11 Jan 2022

View License

[pbest, SD] = easyfit(x, y, pinit, fhandle)
X vector of the independent variable
Y vector of the "measured" (dependent) variable
FHANDLE handle to a function FUN which is aimed to model the experimental data : Y = FUN(p, X)
PINIT initial guess on the parameter values
PBEST - best parameters in a least squares meaning
SD - Standard Deviations in the parameters p
Examples are given in the help lines
To compute the SD, the "Wild Bootstrap" method is used. It is described there : https://en.wikipedia.org/wiki/Bootstrapping_(statistics)

Cite As

Jean-Luc Dellis (2024). [pbest, SD] = easyfit(x, y, pinit, fhandle) (https://www.mathworks.com/matlabcentral/fileexchange/10625-pbest-sd-easyfit-x-y-pinit-fhandle), MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2014b
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

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

Start Hunting!
Version Published Release Notes
2.0

i) The code has been simplified. For instance, graphics are any more generated.
ii) Standard Deviations in the function parameters are output.

1.4.0.0

- the help lines and examples have been improved
- the main results are displayed in the command window

1.3.0.0

Fix minor points and add an example where one parameter is hold constant in fitting.

1.0.0.0

- put VARARGIN to simplify the use
- put UNCERTAINTIES as a subfunction to compute them as
well the data confidence intervals