# fitting weibull distribution to “wind speed” data

I am trying to fit a weibull distribution to my wind speed data with the following code:

fitdistr(av_ws, densfun  = "weibull") #av_ws is the wind speed data


The error appears, that the data also contains some zero's... does the function fitdistr() not working with zero's in the data? As the lowest values from a weibull distribution can be 0 I don't understand why the function is not working...

• Welcome to CV! Please include a minimal working example, or a summary of your data and the exact error message. Also note that questions strictly about programming are off-topic here, so depending on what exactly you want to know, your question might be better suited on stackoverflow. – Frans Rodenburg Sep 29 '18 at 11:46
• If you have multiple exact zeros your data cannot reasonably be regarded random draws from a Weibull.distribution, since obtaining even a single value at least that low has probability 0; the problem is with the model rather than the function. The suggestion to consider whether you have left censored values is a good one. – Glen_b -Reinstate Monica Sep 29 '18 at 22:55

If you look at the likelihood you'll see that a value of 0 results in a log- likelihood term involving $$\log 0$$, which is obviously problematic. In fact, i don't think that exact values of zero should occur under a Weibull distribution.