Info

This question is closed. Reopen it to edit or answer.

Optimization Problem. I need find a local minimun instead of global minimum

1 view (last 30 days)
function [JPF, P_sim] = builder_pdf_est(t,rr,lambda) %% %--------------------------Estimated_PDF----------------------------------%
% Parameters estimated by the Global Minimum Searching Algorithm Patternsearch
t1min = t(1); tp1 = t(3); t2min = t(2); tp2 = t(4); alfa = t(5);
%---Application of the model using RR series created by the Simulation----%
for k=1:length(rr)
if rr(k) < t1min
p1(k) = 0;
elseif (rr(k) >= t1min && rr(k) < (t1min+tp1))
p1(k) = (lambda*((rr(k)-t1min)/tp1)*exp(lambda*(((rr(k)-t1min)^2/(2*tp1)))));
else
p1(k) = (lambda*exp(lambda*(tp1/2-(rr(k)-t1min-tp1))));
end
end
for k=1:length(rr)
if rr(k) < t2min
p2(k) = 0;
elseif (rr(k) >= t2min && rr(k) < (t2min+tp2))
p2(k) = (lambda*((rr(k)-t2min)/tp2)*exp(lambda*(((rr(k)-t2min)^2/(2*tp2)))));
else
p2(k) = (lambda*exp(lambda*(tp2/2-(rr(k)-t2min-tp2))));
end
end
P = (alfa)*p1+(1-alfa)*p2; % Estimated PDF P_sim = (P/sum(P)); % Normalization useful for the graph JPF = -sum(log10(P')); % Calculation of Joint Probability function
---------------------------------------------------------------------------------------------
function [a, fval, exitflag, OUTPUT] = Estimator(rr, data) %%
% Estimation of parameters teta=[t1min t2min tp1 tp2] by jointly maximizing the
% log-likehood function with respect to teta
% Algorithm used: ______________
t = [ rand(1) rand(1) rand(1) rand(1) rand(1)]; %Initial Guess options = psoptimset('MaxFunEvals', 1e10000, 'MaxIter', Inf); lambda = data(6); % As lambda we are using the set parameter
Lb = zeros(1,5); Ub = [1 ,.5, 1, .5, 1]; A = [0 1 0 1 0; 1,1,0,0,0; 0,0,1,1,0]; b = [.5, 1, 1]; JPF = @(t) builder_pdf_est(t,rr, lambda); [a, fval, exitflag, OUTPUT] = patternsearch(JPF, t, A, b, [], [], Lb, Ub, [], options);
  1 Comment
Alan Weiss
Alan Weiss on 21 Feb 2014
What is your question? I do not understand what you are asking.
Alan Weiss
MATLAB mathematical toolbox documentation

Answers (0)

Community Treasure Hunt

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

Start Hunting!