Problems with MLE method and curve fitting!

5 次查看(过去 30 天)
Hi everyone, I hope someone can help me!
How can I estimate the parameters of a function (using an anonymous function) with the maximum likelihood method? I've seen several things on the internet (like mle, fminsearch) but nobody gives me the parameter values!
Example I have:
eq = fittype (@ (a, b, c, x) a * x. ^ 2 + b * x + c);
how do i get the values ​​of a, b and c with the MLE method?
Thanks a lot to everyone!

回答(1 个)

Rishabh Mishra
Rishabh Mishra 2021-1-22
Hi,
Based on my understanding, you can use 'polyfitn' function to estimate the parameters a, b, c. For this purpose, you require a set of values of 'x' as double array and the corresponding values of function (a*x.^2 + b*x + c) stored in another double array say 'y'. Use the code below to estimate the co-efficient values for the function (a*x.^2 + b*x + c).
% assuming 'x' & 'y' are double arrays
% 'y' stores the function value corresponding to each element of 'x'
% 'n' stores degree of the function
n = 2;
p = polyfitn(x,y,n);
The values p.Coefficients(1), p.Coefficients(2) & p.Coefficients(3) correspond to estimated values of coefficients a, b & c respectively.
Hope this helps.

类别

Help CenterFile Exchange 中查找有关 Interpolation 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by