Hi there,
I ve got sort of stock on an easy problem !
I m trying to fit a 3parameter (alpha, beta1 and beta2) Mixed Exponential distribution to my data values, the pdf function of which is:
f(x) = (alpha/beta1*exp(x/beta1)) + ((1alpha)/beta2*exp(x/beta2))
I tried to fit my parameters by sort of optimizing my parameters to fit the probability dist. of my data.
Here is how I proceed:
I wrote my obj. function as follows:
function res = myprob(param,x,y)
fit = (1/param(1)*param(2)*exp(x*1/param(2)))+((1param(1))*(1/param(3))*exp(x*param(3)))
res = fit  y;
where,
param(1:3) = [alpha, beta1, beta2]
and
x and y are derived as below:
[n,x] = hist(data,nbin); % Let's take nbin = 10
and y = n/length(data)
I have tried to optimize my parameters by using lsqnonlin function (below), but seems like I am not doing it right.
options = struct('MaxFunEvals', 2000);
[parameters_hat] = lsqnonlin(@myprob,[0 3.033 2.022],[],[],[],x,n, options);
Got my first guesses by method of moments.
Just in case you need some data values, here is a sample:
x = [0.6190, 1.4551, 2.2913, 3.1274, 3.9635, 4.7997, 5.6358, 6.471, 7.308, 8.144];
y = [0.6336, 0.2366, 0.0687, 0.0153, 0.0305, 0.0076, 0, 0, 0, 0.0076];
I really appreciate any help.
