Re: WeibullDistribution
- To: mathgroup at smc.vnet.net
- Subject: [mg42560] Re: WeibullDistribution
- From: Bill Rowe <listuser at earthlink.net>
- Date: Tue, 15 Jul 2003 02:54:14 -0400 (EDT)
- Sender: owner-wri-mathgroup at wolfram.com
On 7/14/03 at 5:42 AM, robert.nowak at ims.co.at (Robert Nowak) wrote:
> could you please outline how exactly to do the fit ? based on the array
> called data.
In[1]:=
<<Statistics`
In[12]:=
data=RandomArray[WeibullDistribution[5,2],{1000}];
In[18]:=
H=Transpose[{Sort@data,-Log[1-(Range[Length at data]-.5)/Length@data]}];
In[22]:=
f=Fit[Log@H,{1,t},t];
{a,b}={f[[2,1]],Exp[-f[[1]]/f[[2,1]]]}
Out[23]=
{4.910299794620335, 1.9841929305816408}
Note, in my earlier post there was an error I failed to notice in the code for H. The discription of H as the cumulative hazard function equal to -Log[1-CDF] was correct but the code computed -Log[CDF] which is incorrect.