Can we Maximum log likehood for finding parameters' equation? I want to use MLE on matlab to conduct to the equation for three variable m, sigma_0 and sigma_th how can I do it
5 views (last 30 days)
Show older comments
Hi I wonder can we use MLE syntax on Matlab to conduce the parameter equation for equation (1)? If you guys want more information.
The eq(2) is the MLE for eq (1) and to conduct to equation of 3 paramters we need to have derive eq (2) and let them equal 0. That is what I know. If it can please help me at %solve MLE for probability of f(x).
In case, MLE can't do it. How can I simplify and eliminate all 3 derive equation, which I included at % simplifying and eliminating to find 3 parameters' equation.
clc; clear; close all;
syms m sigma_0 sigma_th sigma i N
%solve MLE for probability of f(x)
f=(m/sigma_0)*((sigma_i - sigma_th)/sigma_0)^(m-1)*exp(- ((sigma_i - sigma_th)/sigma_0)^m)
m'=MLE(f,m)
sigma_0'=MLE(f,sigma_0)
sigma_th'=MLE(f,sigma_th)
-------------------------------------------------------------------------------------------------------------
% implifying and eliminating to find 3 parameters' equation.
% Define x_i
x_i = (sigma - sigma_th) / sigma_0;
% Define lnL with summation notation
lnL = symsum(log(m) - log(sigma_0) + (m-1)*log(x_i) - x_i^m, i, 1, N);
% Compute partial derivatives
dlnL_dm = diff(lnL, m);
dlnL_dsigma0 = diff(lnL, sigma_0);
dlnL_dsigmath = diff(lnL, sigma_th);
% Display results
disp('Partial derivative of lnL with respect to m:')
pretty(dlnL_dm)
disp('Partial derivative of lnL with respect to sigma_0:')
pretty(dlnL_dsigma0)
disp('Partial derivative of lnL with respect to sigma_th:')
pretty(dlnL_dsigmath)
3 Comments
Torsten
on 13 Mar 2025
Edited: Torsten
on 13 Mar 2025
It works as
dlnL_dm = subs(dlnL_dm,sigma,data_vector);
dlnL_dsigma0 = subs(dlnL_dsigma0,sigma,data_vector);
dlnL_dsigmath = subs(dlnL_dsigmath,sigma,data_vector);
[m,sigma_0,sigma_th]=vpasolve([dlnL_dm==0,dlnL_dsigma0==0,dlnL_dsigmath==0],[m sigma_0 sigma_th])
a system of 3 equations in 3 unknowns and Newton's method to solve.
data_vector is your data array of size 1xN.
Answers (0)
See Also
Categories
Find more on Ordinary Differential Equations in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!