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
we would like a varying intercepts model for each unique department
using Soss
varying_intercepts = @model (dept_id, applications, male) begin
α ~ For(dept_id) do id
Normal(0,10)
end
β ~ Normal(0,1)
p = logistic.(α .+ β .* male)
N = length(male)
admit ~ For(1:N) do n
Binomial(applications[n], p[n])
end
end
errors
post = nuts(varying_intercepts(dept_id = dept_id, applications = applications, male = male), (admit = admit,)) |> particles
with output
(β = 0.00901 ± 0.97, α = ERROR: LoadError: MethodError: no method matching eps(::Type{Array{Float64,1}})
Closest candidates are:
eps(!Matched::Type{Float16}) at float.jl:739
eps(!Matched::Type{Float32}) at float.jl:740
eps(!Matched::Type{Float64}) at float.jl:741
...
Stacktrace:
[1] eps(::Particles{Array{Float64,1},1000}) at /home/oliver/.julia/packages/MonteCarloMeasurements/WZtSS/src/particles.jl:392
We would like this model to output the intercepts for each department.
Thanks @OdE33. This is a current limitation in particles. We'll need to add some more methods to cover this case. I'll edit the issue title to reflect this.
Just to be sure... On my machine it works fine if I remove |> particles. Can you confirm this works for you as well?
cscherrer
changed the title
Varying Intercepts
Implement particles for NamedTuple with array-valued field
Sep 14, 2019
Given
we would like a varying intercepts model for each unique department
errors
with output
We would like this model to output the intercepts for each department.
reprex.zip
The text was updated successfully, but these errors were encountered: