What is the best way to deal with NaNs in multiple data treatments when using Turing?
For example, for this example tutorial from https://github.com/TuringLang/TuringTutorials/blob/master/tutorials/10-bayesian-differential-equations/10_bayesian-differential-equations.jmd:
@model function fitlv(data, prob)
σ ~ InverseGamma(2,3)
α ~ truncated(Normal(1.3,0.5),0.5,2.5)
β ~ truncated(Normal(1.2,0.25),0.5,2)
γ ~ truncated(Normal(3.2,0.25),2.2,4.0)
δ ~ truncated(Normal(1.2,0.25),0.5,2.0)
ϕ1 ~ truncated(Normal(0.12,0.3),0.05,0.25)
ϕ2 ~ truncated(Normal(0.12,0.3),0.05,0.25)
p = [α,β,γ,δ,ϕ1,ϕ2]
prob = remake(prob, p=p)
predicted = solve(prob,SOSRI(),saveat=0.1)
if predicted.retcode != :Success
Turing.acclogp!(_varinfo, -Inf)
end
for j in 1:length(data)
for i = 1:length(predicted)
data[i,j] ~ MvNormal(predicted[i],σ)
end
end
end;
Here, how Turing is going to deal with NaN in data[i,j]
? Assuming the number of treatments [j]
is high, do you have any recommendations on how to keep it simple and deal with the nans?
Thanks!