1

I'm looking to fit a vector of Floats to the Weibull distribution using the fit() function from Distributions.jl . The error I get is:

ERROR: DomainError with NaN:
Weibull: the condition α > zero(α) is not satisfied.

I've been able to do it for all the continuous distributions in their applicable distributions section https://juliastats.org/Distributions.jl/stable/fit/#Applicable-distributions ,

but can't seem to get it to work for the Weibull. My syntax is:

fit_mle(Weibull, nice[:,1])

For reproducibility, here's the data I was using: https://ufile.io/ticx73py

Thanks in advance! All responders are awesome!

  • Can you please provide a definition for `nice`? The error message suggests the problem is that `nice` contains NaNs, zeros, negative numbers, or something that can't be fit using `fit_mle`. `fit_mle(Weibull, rand(10))` works for me. – PaSTE Mar 14 '23 at 14:15
  • To add support to my hypothesis that `nice` is the problem, `fit_mle(Weibull, vcat(rand(10), [NaN]))` reproduces your error. – PaSTE Mar 14 '23 at 14:26
  • @PaSTE I think you're right! I found that transforming it to become all positive makes it work just fine. – Ethan Leonard Mar 29 '23 at 15:54

0 Answers0