[R] Optimization failed in fitdistr (Weibull distribution)

Carl Witthoft carl at witthoft.com
Wed Oct 30 13:41:55 CET 2013


Which suggests the OP should verify that the data in "...$Frequency" is the
data he expects to be there.


Rui Barradas wrote
> Hello,
> 
> I can't reproduce your error:
> 
> windfreq <-
> c(1351L, 2147L, 3317L, 4378L, 5527L, 6667L, 7865L, 8970L, 9987L,
> 10907L, 11905L, 12642L, 131000L, 14983L, 15847L, 16842L, 17757L,
> 18698L, 19632L, 20626L, 21599L, 22529L, 23325L, 24391L, 25356L,
> 26267L, 27230L, 28223L, 29190L, 30142L, 31124L, 32104L, 3397L,
> 3437L, 3562L, 3646L, 3742L, 3824L, 399L, 4013L, 419L, 425L, 432L
> 
> library(MASS)
> 
> fitdistr(windfreq, "weibull")
> 
> 
> Hope this helps,
> 
> Rui Barradas
> 
> Em 28-10-2013 12:07, kmmoon100 escreveu:
>> Hello everyone,
>>
>> This is Kangmin.
>>
>> I am trying to produce shape and scale of my wind data. My data is based
>> on
>> wind speed frequency with 1km/hr increment. data is described below.
>>
>> Windspeed (km/h)    Frequency
>> 1	351
>> 2	147
>> 3	317
>> 4	378
>> 5	527
>> 6	667
>> 7	865
>> 8	970
>> 9	987
>> 10	907
>> 11	905
>> 12	642
>> 13	1000
>> 14	983
>> 15	847
>> 16	842
>> 17	757
>> 18	698
>> 19	632
>> 20	626
>> 21	599
>> 22	529
>> 23	325
>> 24	391
>> 25	356
>> 26	267
>> 27	230
>> 28	223
>> 29	190
>> 30	142
>> 31	124
>> 32	104
>> 33	97
>> 34	37
>> 35	62
>> 36	46
>> 37	42
>> 38	24
>> 39	9
>> 40	13
>> 41	9
>> 42	5
>> 43	2
>>
>> R codes to calculate shape and scale are described below:
>>
>> Pine.windfrequency.4weeks<-read.table("C:/Users/kmoon/Documents/Pine_frequency_4weeks.csv",header=TRUE,sep=",")
>> fitdistr(Pine.windfrequency.4weeks$Frequency, densfun="weibull")
>>
>> I have got an error message when I was using 'fitdistr' function
>>
>> "Error in fitdistr(Pine.windfrequency.4weeks$Frequency, densfun =
>> "weibull")
>> :
>>    optimization failed"
>>
>> Please help me calculating shape and scale of weibull distribution.
>>
>> And please understand that I am not an user familiar with R program but I
>> am
>> really trying to make my analysis work on R!
>>
>> Thank you!!!
>>
>> Kangmin.
>>
>>
>>
>> --
>> View this message in context:
>> http://r.789695.n4.nabble.com/Optimization-failed-in-fitdistr-Weibull-distribution-tp4679167.html
>> Sent from the R help mailing list archive at Nabble.com.
>>
>> ______________________________________________
>> 

> R-help@

>  mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-help
>> PLEASE do read the posting guide
>> http://www.R-project.org/posting-guide.html
>> and provide commented, minimal, self-contained, reproducible code.
>>
> 
> ______________________________________________

> R-help@

>  mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.





--
View this message in context: http://r.789695.n4.nabble.com/Optimization-failed-in-fitdistr-Weibull-distribution-tp4679178p4679351.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list