Creating a new distribution: 3-parameter Weibull

I have been working with a 3-parameter Weibull, which can be found at the Weibull wikipedia site. I’m working to get a pull request to add to the Distributions.jl library. I have two somewhat unrelated questions:

  1. should I create a new struct (Weibull3) or try to incorporate it in the existing Weibull code in weibull.jl? Currently I have a version with a new struct called Weibull3 that returns a Weibull when the third parameter is 0.
  2. upon testing it, it won’t plot a distribution of this type, although the pdf function is working. There’s a
MethodError: no method matching iterate(::Weibull3{Float64})

Is there anything else that I’d need to add to get this working? I can post code, but just curious if there is something obvious I’m missing.

Planning to submit a PR as soon as I can iron out a couple of other items.

1 Like

Heads up that this functionality is already provided for with LocationScale. It would look something like this:

using Distributions

k = 1.5
λ = 1
θ = 3
weibull2 = Weibull(k, λ)
weibull3 = LocationScale(θ, 1, weibull2)

Good to know.