This is a program for MLE, but my program has two problems now. 1. Fmincon function cannot execute 2. Maybe MLE's program is different from the equations in the picture, but I don’t know where the problem is ... loglik1 ~ 5 indicates 5 non -linear in the picture, respectively Formula, it seems that this part I wrote is not right, but I can't find where the problem is (it is marked with red), so please help me ... The younger brother is new, the forum currency is not new, the forum currency is not Many, please help everyone ... %mle Function loglik = nmw_mle (u) alpha = u (1); beta = u (2); gama = u (3); tkeda = u (4); lambda = u (5); % mle the log-function of the power mode global x; loglik11 = ( Theta*x.^(theta-1)/nmwhazard (x, alpha, beta, gama, theta, lambda); loglik12 = x.^(theta); loglik21 = ((gama lambda* X).*x.^(GAMA-1).*Exp (lambda*x)/nmwhazard (x, alpha, beta, gama, theta, lambda); loglik22 = x.^(gama).* exp (lambda*x); loglik31 = (alpha*x.^(theta-1).*(1 theta*log (x))/nmwhazard (x, alpha, beta, theta, lambda, lambda, lambda, lambda, lambda, lambda, lambda, lambda ); loglik32 = x.^(theta).*log (x); loglik41 = (x.^(gama-1).*Exp (lambda*x).*(Gama lambda* x).*log (x) 1))/nmwhazard (x, alpha, beta, gama, theta, lambda); loglik42 = x.^(gama).*exp (lambda*x). (x); loglik51 = ((1 GAMA Lambda*x).*x.^(theta).*exp (lambda*x))/nmwhazard (x, alpha, beta, theta, lambda, lambda, lambda, lambda ); loglik52 = x.^(gama 1) .*exp (lambda*x); loglik1 = Sum (loglik11) -sum (loglik12); loglik2 = Sum (loglik21) -sum (loglik22); *Sum (loglik32); loglik4 = sum (loglik41) -sum (loglik42); loglik5 = Sum (loglik51) -sum (loglik52); = [loglik1 loglik2 loglik3 loglik4 loglik5];% overall minus log- being minimizedrn_________________________________________________________________________rn%mainrnglobal xrnx=[275 13 147 23 181 30 65 10 300 173 106 300 300 212 300 300 300 261 293 88 247 28 143 300 23 300 80 245 266]; init_w = [1 8e-06 0.1,0.5 0.1];% starting parameter value low_w = zeros (5,1) ;% parameter lower boundsrnup_w=[1 1 1 1 1];% parameter upper boundsrn[w1,lik1,exit1]=fmincon(nmw_mle,init_w,[],[],[],[ ], LOW_W, up_w, []);
This is a program for MLE, but my program has two problems now.
1. Fmincon function cannot execute
2. Maybe MLE's program is different from the equations in the picture, but I don’t know where the problem is ...
loglik1 ~ 5 indicates 5 non -linear in the picture, respectively Formula, it seems that this part I wrote is not right, but I can't find where the problem is (it is marked with red), so please help me ...
The younger brother is new, the forum currency is not new, the forum currency is not Many, please help everyone ...
%mle
Function loglik = nmw_mle (u)
alpha = u (1);
beta = u (2);
gama = u (3);
tkeda = u (4);
lambda = u (5);
% mle the log-function of the power mode
global x;
loglik11 = ( Theta*x.^(theta-1)/nmwhazard (x, alpha, beta, gama, theta, lambda);
loglik12 = x.^(theta);
loglik21 = ((gama lambda* X).*x.^(GAMA-1).*Exp (lambda*x)/nmwhazard (x, alpha, beta, gama, theta, lambda);
loglik22 = x.^(gama).* exp (lambda*x);
loglik31 = (alpha*x.^(theta-1).*(1 theta*log (x))/nmwhazard (x, alpha, beta, theta, lambda, lambda, lambda, lambda, lambda, lambda, lambda, lambda );
loglik32 = x.^(theta).*log (x);
loglik41 = (x.^(gama-1).*Exp (lambda*x).*(Gama lambda* x).*log (x) 1))/nmwhazard (x, alpha, beta, gama, theta, lambda);
loglik42 = x.^(gama).*exp (lambda*x). (x);
loglik51 = ((1 GAMA Lambda*x).*x.^(theta).*exp (lambda*x))/nmwhazard (x, alpha, beta, theta, lambda, lambda, lambda, lambda );
loglik52 = x.^(gama 1) .*exp (lambda*x);
loglik1 = Sum (loglik11) -sum (loglik12);
loglik2 = Sum (loglik21) -sum (loglik22); *Sum (loglik32);
loglik4 = sum (loglik41) -sum (loglik42);
loglik5 = Sum (loglik51) -sum (loglik52); = [loglik1 loglik2 loglik3 loglik4 loglik5];% overall minus log- being minimizedrn_________________________________________________________________________rn%mainrnglobal xrnx=[275 13 147 23 181 30 65 10 300 173 106 300 300 212 300 300 300 261 293 88 247 28 143 300 23 300 80 245 266];
init_w = [1 8e-06 0.1,0.5 0.1];% starting parameter value
low_w = zeros (5,1) ;% parameter lower boundsrnup_w=[1 1 1 1 1];% parameter upper boundsrn[w1,lik1,exit1]=fmincon(nmw_mle,init_w,[],[],[],[ ], LOW_W, up_w, []);