Optimising the fit of a function with 2 variables
Show older comments
Hi,
I'm using a Gaussian derivative function of the form
A*(mu-x)*exp(-((x-mu)^2)/(2*S^2)))/S^2
to fit some existing discrete data and I want to vary A and S to minimse the RMS error of the fit.
Does anyone know of a function that would allow me to do this, and how I should use it?
I'd appreciate any help!
Thanks,
Earle
Accepted Answer
More Answers (1)
Frederic Moisy
on 14 May 2012
0 votes
You can also use the Ezyfit toolbox, which is free: http://www.mathworks.com/matlabcentral/fileexchange/10176
One installed, you can perform your fit like this:
f = ezfit(x,y,'A*(mu-x)*exp(-((x-mu)^2)/(2*S^2)))/S^2');
See also the example here:
Categories
Find more on Linear Predictive Coding in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!