Optimising the fit of a function with 2 variables
Afficher commentaires plus anciens
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
Réponse acceptée
Plus de réponses (1)
Frederic Moisy
le 14 Mai 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:
Catégories
En savoir plus sur Linear Predictive Coding dans Centre d'aide et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!