# Math Help - Weibull distribution and modified maximum likelihood theory

1. ## Weibull distribution and modified maximum likelihood theory

I'm trying to make use of the weibull distribution function to find the spread of wind speeds for my dissertation project.I am also using the modified maximum likelihood theory to find the values for the scale and shape parameters.

The equations I have for each are as follows:

where k is the shape parameter and c the scale parameterI have constructed a script in MATLAB in order to try solve this with the wind speed data I have but for some reason I just cant seem to get the right values.Can anyone see where I may be going wrong?

Code:
data = xlsread('1.xlsx', 1, 'A2:A8076');
[P,V]=hist(data);k=2;q=[1:10];
A=sum((V(:,q).^k).*log(V(:,q)).*P(:,q));
B=sum((V(:,q).^k).*P(:,q));
C=sum((log(V(:,q))).*P(:,q));
D=sum(data>=0);
while any(k-(((A/B)-(C/D))^-1))^2)>0.000001
k=k-0.0000001;
end
format('long')
k
c = (((1/sum(data~=0))*(sum((V(:,q).^1.5)))))^(1/1.5)
end

2. ## Re: Weibull distribution and modified maximum likelihood theory

managed to find the solution, just to save anyone wasted time looking in to it

Code:
data = xlsread('1.xlsx', 1, 'A2:A8076');
[P,V]=hist(data);
k=1.32;
q=[1:10];
A=sum((V(:,q).^k).*log(V(:,q)).*P(:,q));
B=sum((V(:,q).^k).*P(:,q));
C=sum((log(V(:,q))).*P(:,q));
D=sum(data>=0);
K=(((A/B)-(C/D))^-1);
while abs((K-k)^2)>0.0000000001
k=k+0.00000000001;
end
format('short')
k
c=((1/D)*B)^(1/k)