Least-squares fit by a function linear in the parameters

Performs a least-squares fit by a function which in linear in the parameters to be adjusted (for example any polynomial).
36 Downloads
Updated 16 Oct 2019

View License

Following the approach on page 266 from the book "Probability and statistics in particle physics" by A.G. Frodesen, O. Skgeggestad and H. Tofte, the parameters from the least squares fit by a function linear in the parameters (for example a straight line or any polynomial, a sine function if only the amplitude and/or offset are fitted and not the frequency nor the phase) are obtained, together with the covariance matrix of those parameters, the chi squared and the p-value. Four examples (straight line, parabola, fit by polynomials from the Legendre basis and ampltude and offset of a sine function) are provided in a different script.

Cite As

Lucas Pavlov (2024). Least-squares fit by a function linear in the parameters (https://www.mathworks.com/matlabcentral/fileexchange/73044-least-squares-fit-by-a-function-linear-in-the-parameters), MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2017a
Compatible with any release
Platform Compatibility
Windows macOS Linux
Categories
Find more on Polynomials in Help Center and MATLAB Answers
Tags Add Tags

Community Treasure Hunt

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

Start Hunting!
Version Published Release Notes
1.0.0