Originally Posted by rainy cloud
You will not be able to get a decent fit to this data with a curve that goes through (0,0).
You will get a reasonably good fit from a quadratic, but the residuals show that this is not a statistically good fit. To do the job properly we need theory to tell us what the expected form of the curve is.
Below is some Euler code that does a quadratic fit, this should be easy to translate into Matlab and to modify the objective to any form you like.
$ return Err
nelder is a builtin function.
brent("f",a,d,eps) returns a minimum close to a. The function
goes away from a with step size d until it finds a good interval
to start a fast iteration. Additional parameters are passed to f.
nelder("f",v,d,eps) for multidimenional functions f(v), accepting
1xn vectors. d is the initial simplex size.
eps is the final accuracy.
Used by: neldermin, brentmin
0 0 0.012
-0.00361415 0.0127619 0.00690228
>hold on;color(5);plot(E,C);hold off;