You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Distributions.jl is not very flexible with respect to argument types. Implementing custom types, which are basically just wrappers for the arguments would allow more flexibility. For example, the following abuse of notation is not currently possible, since Poisson only allows scalar arguments (note that #14 is probably a better option for this)
simple_poisson =@model (α, β, traps) begin
λ = α .+ β .* traps
complaints ~Poisson(λ)
end
These distribution types would also make it possible to separate the code generation for different back ends (Distributions.jl, Stan math, etc.) into different packages.
The text was updated successfully, but these errors were encountered:
Right, currently this requires a For. I like the idea of being able to express it more simply, But to keep things simple and lightweight, I try to lean as much as possible on other libraries. To be able to write this, I would need to implement Poisson(::Array). That's not to say that this is out of the question, rather that it wouldn't need to be a core part of Soss.
As you point out, there's also the option of broadcasting. Poisson.(λ::Array) already creates an Array{Poisson}, so adding support for .~ would allow us to write
Distributions.jl is not very flexible with respect to argument types. Implementing custom types, which are basically just wrappers for the arguments would allow more flexibility. For example, the following abuse of notation is not currently possible, since
Poisson
only allows scalar arguments (note that #14 is probably a better option for this)These distribution types would also make it possible to separate the code generation for different back ends (Distributions.jl, Stan math, etc.) into different packages.
The text was updated successfully, but these errors were encountered: