Fitting of parameters of function with discrete / integer argument

5 views (last 30 days)
Could somebody help me find the proper way to find the parameters for a function with integer arguments? I've conducted a series of measurement:
p_1 , p_2 , p_3 , (p_1+p_2)/2 , (p_2+p_3)/2 , (p_1+p_3)/2, (p_1+p_2+p_3)/3 , ....
(and so on, up to 10 parameters). Each measurement has its own measurement error and I would like to find the proper way to find parameters p_1 , p_2 , p_3, with standard deviation...
Thanks in advance!

Answers (1)

Adam Hug
Adam Hug on 30 Jun 2015
Based on your question, I am assuming that you are trying to fit a discrete curve. This is a hard problem in general but you can obtain a reasonable solution by using the "lsqnonlin" function in the Optimization Toolbox. More information can be found here:
In the context of least squares, residual is a more sensible metric than standard deviation. You could calculate the R^2 metric for the fit using the residual returned from "lsqnonlin".

Community Treasure Hunt

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

Start Hunting!