a Turing.jl breaking changes question:
I updated ↑ Turing v0.41.1 ⇒ v0.42.8, then my code broke.
is data[i, "γ (N/m)"] ~ Normal(γ_pred, σ) disallowed now? see code and error below.
I looked for breaking changes in 0.42.0 release here but didn’t see a breaking change regarding this.
many years ago, I learned from the Bayesian ODE tutorial here and it changed to a vectorized statement data[:, i] ~ arraydist(Poisson.(q .* predicted[i] .+ ϵ)) but I tried a similar expression, and the error remains!
the code
@model function cmc_model(data::DataFrame)
# surface tension of pure water
@assert data[1, "[S] (mol/m³)"] == 0.0
γ₀_obs = data[1, "γ (N/m)"]
#=
prior distributions
=#
γ₀ ~ Normal(γ₀_obs, σ) # N/m
a ~ Uniform(0.001, 0.1) # N/m
K ~ Uniform(0.0, 10000.0) # (mol/m³)⁻¹
if surfactant == "OTG"
c★ ~ Uniform(0.0, 30.0) # mol / m³
elseif surfactant == "Triton-X-100"
c★ ~ LogUniform(0.001, 10.0) # mol / m³
end
#=
show data
=#
for i = 2:nrow(data)
# surfactant concentration
cᵢ = data[i, "[S] (mol/m³)"]
# predicted surface tension
γ_pred = γ_model(cᵢ, γ₀, a, K, c★)
data[i, "γ (N/m)"] ~ Normal(γ_pred, σ)
end
return nothing
end
the error
MethodError: no method matching possible(::typeof(BangBang._setindex!), ::DataFrames.DataFrame, ::Float64, ::Int64, ::String)
The function `possible` exists, but no method is defined for this combination of argument types.