Simple 2D reaction-diffusion ODE inside Turing blows up in various ways

With the same code and Tracker, I get this error:

sample(ts_extra_simple_model_1, NUTS{Turing.TrackerAD}(), 1_000)
d is 6.620016389825301
sigma is 0.9934251329566222
eltype R, K is Float64Float64
d is 6.620016389825301
sigma is 0.9934251329566222
eltype R, K is Float64Float64
d is 6.620016389825301 (tracked)
sigma is 0.9934251329566222 (tracked)
eltype R, K is Float64Float64
ERROR: MethodError: no method matching Float64(::Tracker.TrackedReal{Float64})
Closest candidates are:
  (::Type{T})(::Real, ::RoundingMode) where T<:AbstractFloat at rounding.jl:200
  (::Type{T})(::T) where T<:Number at boot.jl:772
  (::Type{T})(::AbstractChar) where T<:Union{AbstractChar, Number} at char.jl:50
  ...
Stacktrace:
  [1] convert(#unused#::Type{Float64}, x::Tracker.TrackedReal{Float64})
    @ Base .\number.jl:7
  [2] setindex!
    @ .\array.jl:968 [inlined]
  [3] fast_react_diffuse!(du::Matrix{Float64}, u::Matrix{Float64}, p::Tuple{Tracker.TrackedReal{Float64}, Matrix{Float64}, Matrix{Float64}}, t::Float64)
    @ Main .\REPL[64]:5
  [4] (::ODEFunction{true, SciMLBase.FullSpecialize, typeof(fast_react_diffuse!), UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing, Nothing})(::Matrix{Float64}, ::Vararg{Any})
    @ SciMLBase C:\Users\Brendan\.julia\packages\SciMLBase\xWByK\src\scimlfunctions.jl:1962
  [5] initialize!(integrator::OrdinaryDiffEq.ODEIntegrator{Tsit5{typeof(OrdinaryDiffEq.trivial_limiter!), typeof(OrdinaryDiffEq.trivial_limiter!), Static.False}, true, Matrix{Float64}, Nothing, Float64, Tuple{Tracker.TrackedReal{Float64}, Matrix{Float64}, Matrix{Float64}}, Float64, Float64, Float64, Float64, Vector{Matrix{Float64}}, ODESolution{Float64, 3, Vector{Matrix{Float64}}, Nothing, Nothing, Vector{Float64}, Vector{Vector{Matrix{Float64}}}, ODEProblem{Matrix{Float64}, Tuple{Float64, Float64}, true, Tuple{Tracker.TrackedReal{Float64}, Matrix{Float64}, Matrix{Float64}}, ODEFunction{true, SciMLBase.FullSpecialize, typeof(fast_react_diffuse!), UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing, Nothing}, Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, SciMLBase.StandardODEProblem}, Tsit5{typeof(OrdinaryDiffEq.trivial_limiter!), typeof(OrdinaryDiffEq.trivial_limiter!), Static.False}, OrdinaryDiffEq.InterpolationData{ODEFunction{true, SciMLBase.FullSpecialize, typeof(fast_react_diffuse!), UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing, Nothing}, Vector{Matrix{Float64}}, Vector{Float64}, Vector{Vector{Matrix{Float64}}}, OrdinaryDiffEq.Tsit5Cache{Matrix{Float64}, Matrix{Float64}, Matrix{Float64}, OrdinaryDiffEq.Tsit5ConstantCache{Float64, Float64}, typeof(OrdinaryDiffEq.trivial_limiter!), typeof(OrdinaryDiffEq.trivial_limiter!), Static.False}}, DiffEqBase.DEStats}, ODEFunction{true, SciMLBase.FullSpecialize, typeof(fast_react_diffuse!), UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing, Nothing}, OrdinaryDiffEq.Tsit5Cache{Matrix{Float64}, Matrix{Float64}, Matrix{Float64}, OrdinaryDiffEq.Tsit5ConstantCache{Float64, Float64}, typeof(OrdinaryDiffEq.trivial_limiter!), typeof(OrdinaryDiffEq.trivial_limiter!), Static.False}, OrdinaryDiffEq.DEOptions{Float64, Float64, Float64, Float64, PIController{Rational{Int64}}, typeof(DiffEqBase.ODE_DEFAULT_NORM), typeof(opnorm), Nothing, CallbackSet{Tuple{}, Tuple{}}, typeof(DiffEqBase.ODE_DEFAULT_ISOUTOFDOMAIN), typeof(DiffEqBase.ODE_DEFAULT_PROG_MESSAGE), typeof(DiffEqBase.ODE_DEFAULT_UNSTABLE_CHECK), DataStructures.BinaryHeap{Float64, DataStructures.FasterForward}, DataStructures.BinaryHeap{Float64, DataStructures.FasterForward}, Nothing, Nothing, Int64, Tuple{}, Float64, Tuple{}}, Matrix{Float64}, Float64, Nothing, OrdinaryDiffEq.DefaultInit}, cache::OrdinaryDiffEq.Tsit5Cache{Matrix{Float64}, Matrix{Float64}, Matrix{Float64}, OrdinaryDiffEq.Tsit5ConstantCache{Float64, Float64}, typeof(OrdinaryDiffEq.trivial_limiter!), typeof(OrdinaryDiffEq.trivial_limiter!), Static.False})
    @ OrdinaryDiffEq C:\Users\Brendan\.julia\packages\OrdinaryDiffEq\vfMzV\src\perform_step\low_order_rk_perform_step.jl:736
  [6] __init(prob::ODEProblem{Matrix{Float64}, Tuple{Float64, Float64}, true, Tuple{Tracker.TrackedReal{Float64}, Matrix{Float64}, Matrix{Float64}}, ODEFunction{true, SciMLBase.FullSpecialize, typeof(fast_react_diffuse!), UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing, Nothing}, Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, SciMLBase.StandardODEProblem}, alg::Tsit5{typeof(OrdinaryDiffEq.trivial_limiter!), typeof(OrdinaryDiffEq.trivial_limiter!), Static.False}, timeseries_init::Tuple{}, ts_init::Tuple{}, ks_init::Tuple{}, recompile::Type{Val{true}}; saveat::Float64, tstops::Tuple{}, d_discontinuities::Tuple{}, save_idxs::Nothing, save_everystep::Bool, save_on::Bool, save_start::Bool, save_end::Nothing, callback::Nothing, dense::Bool, calck::Bool, dt::Float64, dtmin::Nothing, dtmax::Float64, force_dtmin::Bool, adaptive::Bool, gamma::Rational{Int64}, abstol::Nothing, reltol::Nothing, qmin::Rational{Int64}, qmax::Int64, qsteady_min::Int64, qsteady_max::Int64, beta1::Nothing, beta2::Nothing, qoldinit::Rational{Int64}, controller::Nothing, fullnormalize::Bool, failfactor::Int64, maxiters::Int64, internalnorm::typeof(DiffEqBase.ODE_DEFAULT_NORM), internalopnorm::typeof(opnorm), isoutofdomain::typeof(DiffEqBase.ODE_DEFAULT_ISOUTOFDOMAIN), unstable_check::typeof(DiffEqBase.ODE_DEFAULT_UNSTABLE_CHECK), verbose::Bool, timeseries_errors::Bool, dense_errors::Bool, advance_to_tstop::Bool, stop_at_next_tstop::Bool, initialize_save::Bool, progress::Bool, progress_steps::Int64, progress_name::String, progress_message::typeof(DiffEqBase.ODE_DEFAULT_PROG_MESSAGE), userdata::Nothing, allow_extrapolation::Bool, initialize_integrator::Bool, alias_u0::Bool, alias_du0::Bool, initializealg::OrdinaryDiffEq.DefaultInit, kwargs::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
    @ OrdinaryDiffEq C:\Users\Brendan\.julia\packages\OrdinaryDiffEq\vfMzV\src\solve.jl:493
  [7] #__solve#562
    @ C:\Users\Brendan\.julia\packages\OrdinaryDiffEq\vfMzV\src\solve.jl:5 [inlined]
  [8] #solve_call#26
    @ C:\Users\Brendan\.julia\packages\DiffEqBase\5rKYk\src\solve.jl:472 [inlined]
  [9] solve_up(prob::ODEProblem{Matrix{Float64}, Tuple{Float64, Float64}, true, Tuple{Float64, Matrix{Float64}, Matrix{Float64}}, ODEFunction{true, SciMLBase.FullSpecialize, typeof(fast_react_diffuse!), UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing, Nothing}, Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, SciMLBase.StandardODEProblem}, sensealg::Nothing, u0::Matrix{Float64}, p::Tuple{Tracker.TrackedReal{Float64}, Matrix{Float64}, Matrix{Float64}}, args::Tsit5{typeof(OrdinaryDiffEq.trivial_limiter!), typeof(OrdinaryDiffEq.trivial_limiter!), Static.False}; kwargs::Base.Pairs{Symbol, Float64, Tuple{Symbol, Symbol}, NamedTuple{(:saveat, :dt), Tuple{Float64, Float64}}})
    @ DiffEqBase C:\Users\Brendan\.julia\packages\DiffEqBase\5rKYk\src\solve.jl:834
 [10] solve(prob::ODEProblem{Matrix{Float64}, Tuple{Float64, Float64}, true, Tuple{Float64, Matrix{Float64}, Matrix{Float64}}, ODEFunction{true, SciMLBase.FullSpecialize, typeof(fast_react_diffuse!), UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing, Nothing}, Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, SciMLBase.StandardODEProblem}, args::Tsit5{typeof(OrdinaryDiffEq.trivial_limiter!), typeof(OrdinaryDiffEq.trivial_limiter!), Static.False}; sensealg::Nothing, u0::Nothing, p::Tuple{Tracker.TrackedReal{Float64}, Matrix{Float64}, Matrix{Float64}}, wrap::Val{true}, kwargs::Base.Pairs{Symbol, Float64, Tuple{Symbol, Symbol}, NamedTuple{(:saveat, :dt), Tuple{Float64, Float64}}})
    @ DiffEqBase C:\Users\Brendan\.julia\packages\DiffEqBase\5rKYk\src\solve.jl:801
 [11] extra_simple_troubleshootfitlv(__model__::DynamicPPL.Model{typeof(extra_simple_troubleshootfitlv), (:covariates, :response, :sample_idx, :prob), (), (), Tuple{Tuple{Matrix{Float64}, Matrix{Float64}}, Vector{Float64}, CartesianIndices{3, Tuple{StepRange{Int64, Int64}, StepRange{Int64, Int64}, UnitRange{Int64}}}, ODEProblem{Matrix{Float64}, Tuple{Float64, Float64}, true, Tuple{Float64, Matrix{Float64}, Matrix{Float64}}, ODEFunction{true, SciMLBase.FullSpecialize, typeof(fast_react_diffuse!), UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing, Nothing}, Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, SciMLBase.StandardODEProblem}}, Tuple{}, DynamicPPL.DefaultContext}, __varinfo__::DynamicPPL.TypedVarInfo{NamedTuple{(:d, :sigma), Tuple{DynamicPPL.Metadata{Dict{AbstractPPL.VarName{:d, Setfield.IdentityLens}, Int64}, Vector{Gamma{Float64}}, Vector{AbstractPPL.VarName{:d, Setfield.IdentityLens}}, TrackedArray{…,Vector{Float64}}, Vector{Set{DynamicPPL.Selector}}}, DynamicPPL.Metadata{Dict{AbstractPPL.VarName{:sigma, Setfield.IdentityLens}, Int64}, Vector{InverseGamma{Float64}}, Vector{AbstractPPL.VarName{:sigma, Setfield.IdentityLens}}, TrackedArray{…,Vector{Float64}}, Vector{Set{DynamicPPL.Selector}}}}}, Tracker.TrackedReal{Float64}}, __context__::DynamicPPL.SamplingContext{DynamicPPL.Sampler{NUTS{Turing.Essential.TrackerAD, (), AdvancedHMC.DiagEuclideanMetric}}, DynamicPPL.DefaultContext, Random._GLOBAL_RNG}, covariates::Tuple{Matrix{Float64}, Matrix{Float64}}, response::Vector{Float64}, sample_idx::CartesianIndices{3, Tuple{StepRange{Int64, Int64}, StepRange{Int64, Int64}, UnitRange{Int64}}}, prob::ODEProblem{Matrix{Float64}, Tuple{Float64, Float64}, true, Tuple{Float64, Matrix{Float64}, Matrix{Float64}}, ODEFunction{true, SciMLBase.FullSpecialize, typeof(fast_react_diffuse!), UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing, Nothing}, Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, SciMLBase.StandardODEProblem})
    @ Main .\REPL[85]:9
 [12] macro expansion
    @ C:\Users\Brendan\.julia\packages\DynamicPPL\zPOYL\src\model.jl:593 [inlined]
 [13] _evaluate!!
    @ C:\Users\Brendan\.julia\packages\DynamicPPL\zPOYL\src\model.jl:576 [inlined]
 [14] evaluate_threadunsafe!!
    @ C:\Users\Brendan\.julia\packages\DynamicPPL\zPOYL\src\model.jl:551 [inlined]
 [15] evaluate!!
    @ C:\Users\Brendan\.julia\packages\DynamicPPL\zPOYL\src\model.jl:504 [inlined]
 [16] evaluate!!
    @ C:\Users\Brendan\.julia\packages\DynamicPPL\zPOYL\src\model.jl:515 [inlined]
 [17] evaluate!!
    @ C:\Users\Brendan\.julia\packages\DynamicPPL\zPOYL\src\model.jl:523 [inlined]
 [18] LogDensityFunction
    @ C:\Users\Brendan\.julia\packages\Turing\szPqN\src\Turing.jl:38 [inlined]
 [19] logdensity
    @ C:\Users\Brendan\.julia\packages\Turing\szPqN\src\Turing.jl:42 [inlined]
 [20] #48
    @ C:\Users\Brendan\.julia\packages\LogDensityProblems\oAYeE\src\AD_Tracker.jl:25 [inlined]
 [21] #593
    @ C:\Users\Brendan\.julia\packages\Tracker\a9oj5\src\back.jl:148 [inlined]
 [22] forward(f::Tracker.var"#593#595"{LogDensityProblems.var"#48#49"{Turing.LogDensityFunction{DynamicPPL.TypedVarInfo{NamedTuple{(:d, :sigma), Tuple{DynamicPPL.Metadata{Dict{AbstractPPL.VarName{:d, Setfield.IdentityLens}, Int64}, Vector{Gamma{Float64}}, Vector{AbstractPPL.VarName{:d, Setfield.IdentityLens}}, Vector{Float64}, Vector{Set{DynamicPPL.Selector}}}, DynamicPPL.Metadata{Dict{AbstractPPL.VarName{:sigma, Setfield.IdentityLens}, Int64}, Vector{InverseGamma{Float64}}, Vector{AbstractPPL.VarName{:sigma, Setfield.IdentityLens}}, Vector{Float64}, Vector{Set{DynamicPPL.Selector}}}}}, Float64}, DynamicPPL.Model{typeof(extra_simple_troubleshootfitlv), (:covariates, :response, :sample_idx, :prob), (), (), Tuple{Tuple{Matrix{Float64}, Matrix{Float64}}, Vector{Float64}, CartesianIndices{3, Tuple{StepRange{Int64, Int64}, StepRange{Int64, Int64}, UnitRange{Int64}}}, ODEProblem{Matrix{Float64}, Tuple{Float64, Float64}, true, Tuple{Float64, Matrix{Float64}, Matrix{Float64}}, ODEFunction{true, SciMLBase.FullSpecialize, typeof(fast_react_diffuse!), UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing, Nothing}, Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, SciMLBase.StandardODEProblem}}, Tuple{}, DynamicPPL.DefaultContext}, DynamicPPL.Sampler{NUTS{Turing.Essential.TrackerAD, (), AdvancedHMC.DiagEuclideanMetric}}, DynamicPPL.DefaultContext}}, Tuple{TrackedArray{…,Vector{Float64}}}}, ps::Tracker.Params)
    @ Tracker C:\Users\Brendan\.julia\packages\Tracker\a9oj5\src\back.jl:135
 [23] forward(f::Function, args::Vector{Float64})
    @ Tracker C:\Users\Brendan\.julia\packages\Tracker\a9oj5\src\back.jl:148
 [24] logdensity_and_gradient(∇ℓ::LogDensityProblems.TrackerGradientLogDensity{Turing.LogDensityFunction{DynamicPPL.TypedVarInfo{NamedTuple{(:d, :sigma), Tuple{DynamicPPL.Metadata{Dict{AbstractPPL.VarName{:d, Setfield.IdentityLens}, Int64}, Vector{Gamma{Float64}}, Vector{AbstractPPL.VarName{:d, Setfield.IdentityLens}}, Vector{Float64}, Vector{Set{DynamicPPL.Selector}}}, DynamicPPL.Metadata{Dict{AbstractPPL.VarName{:sigma, Setfield.IdentityLens}, Int64}, Vector{InverseGamma{Float64}}, Vector{AbstractPPL.VarName{:sigma, Setfield.IdentityLens}}, Vector{Float64}, Vector{Set{DynamicPPL.Selector}}}}}, Float64}, DynamicPPL.Model{typeof(extra_simple_troubleshootfitlv), (:covariates, :response, :sample_idx, :prob), (), (), Tuple{Tuple{Matrix{Float64}, Matrix{Float64}}, Vector{Float64}, CartesianIndices{3, Tuple{StepRange{Int64, Int64}, StepRange{Int64, Int64}, UnitRange{Int64}}}, ODEProblem{Matrix{Float64}, Tuple{Float64, Float64}, true, Tuple{Float64, Matrix{Float64}, Matrix{Float64}}, ODEFunction{true, SciMLBase.FullSpecialize, typeof(fast_react_diffuse!), UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing, Nothing}, Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, SciMLBase.StandardODEProblem}}, Tuple{}, DynamicPPL.DefaultContext}, DynamicPPL.Sampler{NUTS{Turing.Essential.TrackerAD, (), AdvancedHMC.DiagEuclideanMetric}}, DynamicPPL.DefaultContext}}, x::Vector{Float64})
    @ LogDensityProblems C:\Users\Brendan\.julia\packages\LogDensityProblems\oAYeE\src\AD_Tracker.jl:25
 [25] ∂logπ∂θ
    @ C:\Users\Brendan\.julia\packages\Turing\szPqN\src\inference\hmc.jl:166 [inlined]
 [26] ∂H∂θ
    @ C:\Users\Brendan\.julia\packages\AdvancedHMC\iWHPQ\src\hamiltonian.jl:31 [inlined]
 [27] phasepoint
    @ C:\Users\Brendan\.julia\packages\AdvancedHMC\iWHPQ\src\hamiltonian.jl:76 [inlined]
 [28] phasepoint(rng::Random._GLOBAL_RNG, θ::Vector{Float64}, h::AdvancedHMC.Hamiltonian{AdvancedHMC.DiagEuclideanMetric{Float64, Vector{Float64}}, Base.Fix1{typeof(LogDensityProblems.logdensity), LogDensityProblems.TrackerGradientLogDensity{Turing.LogDensityFunction{DynamicPPL.TypedVarInfo{NamedTuple{(:d, :sigma), Tuple{DynamicPPL.Metadata{Dict{AbstractPPL.VarName{:d, Setfield.IdentityLens}, Int64}, Vector{Gamma{Float64}}, Vector{AbstractPPL.VarName{:d, Setfield.IdentityLens}}, Vector{Float64}, Vector{Set{DynamicPPL.Selector}}}, DynamicPPL.Metadata{Dict{AbstractPPL.VarName{:sigma, Setfield.IdentityLens}, Int64}, Vector{InverseGamma{Float64}}, Vector{AbstractPPL.VarName{:sigma, Setfield.IdentityLens}}, Vector{Float64}, Vector{Set{DynamicPPL.Selector}}}}}, Float64}, DynamicPPL.Model{typeof(extra_simple_troubleshootfitlv), (:covariates, :response, :sample_idx, :prob), (), (), Tuple{Tuple{Matrix{Float64}, Matrix{Float64}}, Vector{Float64}, CartesianIndices{3, Tuple{StepRange{Int64, Int64}, StepRange{Int64, Int64}, UnitRange{Int64}}}, ODEProblem{Matrix{Float64}, Tuple{Float64, Float64}, true, Tuple{Float64, Matrix{Float64}, Matrix{Float64}}, ODEFunction{true, SciMLBase.FullSpecialize, typeof(fast_react_diffuse!), UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing, Nothing}, Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, SciMLBase.StandardODEProblem}}, Tuple{}, DynamicPPL.DefaultContext}, DynamicPPL.Sampler{NUTS{Turing.Essential.TrackerAD, (), AdvancedHMC.DiagEuclideanMetric}}, DynamicPPL.DefaultContext}}}, Turing.Inference.var"#∂logπ∂θ#44"{LogDensityProblems.TrackerGradientLogDensity{Turing.LogDensityFunction{DynamicPPL.TypedVarInfo{NamedTuple{(:d, :sigma), Tuple{DynamicPPL.Metadata{Dict{AbstractPPL.VarName{:d, Setfield.IdentityLens}, Int64}, Vector{Gamma{Float64}}, Vector{AbstractPPL.VarName{:d, Setfield.IdentityLens}}, Vector{Float64}, Vector{Set{DynamicPPL.Selector}}}, DynamicPPL.Metadata{Dict{AbstractPPL.VarName{:sigma, Setfield.IdentityLens}, Int64}, Vector{InverseGamma{Float64}}, Vector{AbstractPPL.VarName{:sigma, Setfield.IdentityLens}}, Vector{Float64}, Vector{Set{DynamicPPL.Selector}}}}}, Float64}, DynamicPPL.Model{typeof(extra_simple_troubleshootfitlv), (:covariates, :response, :sample_idx, :prob), (), (), Tuple{Tuple{Matrix{Float64}, Matrix{Float64}}, Vector{Float64}, CartesianIndices{3, Tuple{StepRange{Int64, Int64}, StepRange{Int64, Int64}, UnitRange{Int64}}}, ODEProblem{Matrix{Float64}, Tuple{Float64, Float64}, true, Tuple{Float64, Matrix{Float64}, Matrix{Float64}}, ODEFunction{true, SciMLBase.FullSpecialize, typeof(fast_react_diffuse!), UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing, Nothing}, Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, SciMLBase.StandardODEProblem}}, Tuple{}, DynamicPPL.DefaultContext}, DynamicPPL.Sampler{NUTS{Turing.Essential.TrackerAD, (), AdvancedHMC.DiagEuclideanMetric}}, DynamicPPL.DefaultContext}}}})
    @ AdvancedHMC C:\Users\Brendan\.julia\packages\AdvancedHMC\iWHPQ\src\hamiltonian.jl:153
 [29] initialstep(rng::Random._GLOBAL_RNG, model::DynamicPPL.Model{typeof(extra_simple_troubleshootfitlv), (:covariates, :response, :sample_idx, :prob), (), (), Tuple{Tuple{Matrix{Float64}, Matrix{Float64}}, Vector{Float64}, CartesianIndices{3, Tuple{StepRange{Int64, Int64}, StepRange{Int64, Int64}, UnitRange{Int64}}}, ODEProblem{Matrix{Float64}, Tuple{Float64, Float64}, true, Tuple{Float64, Matrix{Float64}, Matrix{Float64}}, ODEFunction{true, SciMLBase.FullSpecialize, typeof(fast_react_diffuse!), UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing, Nothing}, Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, SciMLBase.StandardODEProblem}}, Tuple{}, DynamicPPL.DefaultContext}, spl::DynamicPPL.Sampler{NUTS{Turing.Essential.TrackerAD, (), AdvancedHMC.DiagEuclideanMetric}}, vi::DynamicPPL.TypedVarInfo{NamedTuple{(:d, :sigma), Tuple{DynamicPPL.Metadata{Dict{AbstractPPL.VarName{:d, Setfield.IdentityLens}, Int64}, Vector{Gamma{Float64}}, Vector{AbstractPPL.VarName{:d, Setfield.IdentityLens}}, Vector{Float64}, Vector{Set{DynamicPPL.Selector}}}, DynamicPPL.Metadata{Dict{AbstractPPL.VarName{:sigma, Setfield.IdentityLens}, Int64}, Vector{InverseGamma{Float64}}, Vector{AbstractPPL.VarName{:sigma, Setfield.IdentityLens}}, Vector{Float64}, Vector{Set{DynamicPPL.Selector}}}}}, Float64}; init_params::Nothing, nadapts::Int64, kwargs::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
    @ Turing.Inference C:\Users\Brendan\.julia\packages\Turing\szPqN\src\inference\hmc.jl:170
 [30] step(rng::Random._GLOBAL_RNG, model::DynamicPPL.Model{typeof(extra_simple_troubleshootfitlv), (:covariates, :response, :sample_idx, :prob), (), (), Tuple{Tuple{Matrix{Float64}, Matrix{Float64}}, Vector{Float64}, CartesianIndices{3, Tuple{StepRange{Int64, Int64}, StepRange{Int64, Int64}, UnitRange{Int64}}}, ODEProblem{Matrix{Float64}, Tuple{Float64, Float64}, true, Tuple{Float64, Matrix{Float64}, Matrix{Float64}}, ODEFunction{true, SciMLBase.FullSpecialize, typeof(fast_react_diffuse!), UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing, Nothing}, Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, SciMLBase.StandardODEProblem}}, Tuple{}, DynamicPPL.DefaultContext}, spl::DynamicPPL.Sampler{NUTS{Turing.Essential.TrackerAD, (), AdvancedHMC.DiagEuclideanMetric}}; resume_from::Nothing, init_params::Nothing, kwargs::Base.Pairs{Symbol, Int64, Tuple{Symbol}, NamedTuple{(:nadapts,), Tuple{Int64}}})
    @ DynamicPPL C:\Users\Brendan\.julia\packages\DynamicPPL\zPOYL\src\sampler.jl:104
 [31] macro expansion
    @ C:\Users\Brendan\.julia\packages\AbstractMCMC\fnRmh\src\sample.jl:120 [inlined]
 [32] macro expansion
    @ C:\Users\Brendan\.julia\packages\ProgressLogging\6KXlp\src\ProgressLogging.jl:328 [inlined]
 [33] macro expansion
    @ C:\Users\Brendan\.julia\packages\AbstractMCMC\fnRmh\src\logging.jl:9 [inlined]
 [34] mcmcsample(rng::Random._GLOBAL_RNG, model::DynamicPPL.Model{typeof(extra_simple_troubleshootfitlv), (:covariates, :response, :sample_idx, :prob), (), (), Tuple{Tuple{Matrix{Float64}, Matrix{Float64}}, Vector{Float64}, CartesianIndices{3, Tuple{StepRange{Int64, Int64}, StepRange{Int64, Int64}, UnitRange{Int64}}}, ODEProblem{Matrix{Float64}, Tuple{Float64, Float64}, true, Tuple{Float64, Matrix{Float64}, Matrix{Float64}}, ODEFunction{true, SciMLBase.FullSpecialize, typeof(fast_react_diffuse!), UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing, Nothing}, Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, SciMLBase.StandardODEProblem}}, Tuple{}, DynamicPPL.DefaultContext}, sampler::DynamicPPL.Sampler{NUTS{Turing.Essential.TrackerAD, (), AdvancedHMC.DiagEuclideanMetric}}, N::Int64; progress::Bool, progressname::String, callback::Nothing, discard_initial::Int64, thinning::Int64, chain_type::Type, kwargs::Base.Pairs{Symbol, Int64, Tuple{Symbol}, NamedTuple{(:nadapts,), Tuple{Int64}}})
    @ AbstractMCMC C:\Users\Brendan\.julia\packages\AbstractMCMC\fnRmh\src\sample.jl:111
 [35] sample(rng::Random._GLOBAL_RNG, model::DynamicPPL.Model{typeof(extra_simple_troubleshootfitlv), (:covariates, :response, :sample_idx, :prob), (), (), Tuple{Tuple{Matrix{Float64}, Matrix{Float64}}, Vector{Float64}, CartesianIndices{3, Tuple{StepRange{Int64, Int64}, StepRange{Int64, Int64}, UnitRange{Int64}}}, ODEProblem{Matrix{Float64}, Tuple{Float64, Float64}, true, Tuple{Float64, Matrix{Float64}, Matrix{Float64}}, ODEFunction{true, SciMLBase.FullSpecialize, typeof(fast_react_diffuse!), UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing, Nothing}, Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, SciMLBase.StandardODEProblem}}, Tuple{}, DynamicPPL.DefaultContext}, sampler::DynamicPPL.Sampler{NUTS{Turing.Essential.TrackerAD, (), AdvancedHMC.DiagEuclideanMetric}}, N::Int64; chain_type::Type, resume_from::Nothing, progress::Bool, nadapts::Int64, discard_adapt::Bool, discard_initial::Int64, kwargs::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
    @ Turing.Inference C:\Users\Brendan\.julia\packages\Turing\szPqN\src\inference\hmc.jl:133
 [36] sample
    @ C:\Users\Brendan\.julia\packages\Turing\szPqN\src\inference\hmc.jl:103 [inlined]
 [37] #sample#2
    @ C:\Users\Brendan\.julia\packages\Turing\szPqN\src\inference\Inference.jl:145 [inlined]
 [38] sample
    @ C:\Users\Brendan\.julia\packages\Turing\szPqN\src\inference\Inference.jl:138 [inlined]
 [39] #sample#1
    @ C:\Users\Brendan\.julia\packages\Turing\szPqN\src\inference\Inference.jl:135 [inlined]
 [40] sample(model::DynamicPPL.Model{typeof(extra_simple_troubleshootfitlv), (:covariates, :response, :sample_idx, :prob), (), (), Tuple{Tuple{Matrix{Float64}, Matrix{Float64}}, Vector{Float64}, CartesianIndices{3, Tuple{StepRange{Int64, Int64}, StepRange{Int64, Int64}, UnitRange{Int64}}}, ODEProblem{Matrix{Float64}, Tuple{Float64, Float64}, true, Tuple{Float64, Matrix{Float64}, Matrix{Float64}}, ODEFunction{true, SciMLBase.FullSpecialize, typeof(fast_react_diffuse!), UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing, Nothing}, Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, SciMLBase.StandardODEProblem}}, Tuple{}, DynamicPPL.DefaultContext}, alg::NUTS{Turing.Essential.TrackerAD, (), AdvancedHMC.DiagEuclideanMetric}, N::Int64)
    @ Turing.Inference C:\Users\Brendan\.julia\packages\Turing\szPqN\src\inference\Inference.jl:129
 [41] top-level scope
    @ REPL[87]:1

If I try to convert the type of everything in the following manner (I don’t really know what I’m doing with this, just borrowing syntax I’ve seen elsewhere).

@model function testing_type_promotion(covariates, response, sample_idx, prob)
  d ~ Gamma(4, 1)
  sigma ~ InverseGamma(2, 3)
  println("d is ", d)
  println("sigma is ", sigma)
  R = eltype(d).(covariates[1])
  K = eltype(d).(covariates[2])
  println("R eltype is ", eltype(R))
  println("K eltype is ", eltype(K))
  println("Type of R is ", typeof(R))
  println("Type of K is ", typeof(K))
  p = (d, R, K)
  println("Type of p is ", typeof(p))
  u0 = eltype(R).(prob.u0)
  println("u0 eltype is ", eltype(u0))
  println("p eltype is ", eltype(p))
  prob = remake(prob;u0=u0,p=p)
  predicted = vec(Array(solve(prob, Tsit5(); p=p, saveat=1.0))[sample_idx])
  # Observations.
  response ~ MvNormal(predicted, sigma^2 * I)
  return nothing
end

I get the same error message in ode_determine_initdt that you had called odd. In response you had suggested fixing dt to a particular value to see what happens. I now get this error:

sample(ts_type, NUTS{Turing.TrackerAD}(), 1_000)
...
d is 6.379836895600994 (tracked)
sigma is 0.2865622532662175 (tracked)
R eltype is Tracker.TrackedReal{Float64}
K eltype is Tracker.TrackedReal{Float64}
Type of R is Matrix{Tracker.TrackedReal{Float64}}
Type of K is Matrix{Tracker.TrackedReal{Float64}}
Type of p is Tuple{Tracker.TrackedReal{Float64}, Matrix{Tracker.TrackedReal{Float64}}, Matrix{Tracker.TrackedReal{Float64}}}
u0 eltype is Tracker.TrackedReal{Float64}
p eltype is Any
ERROR: MethodError: no method matching Float32(::Tracker.TrackedReal{Float64})
Closest candidates are:
  (::Type{T})(::Real, ::RoundingMode) where T<:AbstractFloat at rounding.jl:200
  (::Type{T})(::T) where T<:Number at boot.jl:772
  (::Type{T})(::AbstractChar) where T<:Union{AbstractChar, Number} at char.jl:50
  ...
Stacktrace:
  [1] convert(#unused#::Type{Float32}, x::Tracker.TrackedReal{Float64})
    @ Base .\number.jl:7
  [2] fastpow
    @ C:\Users\Brendan\.julia\packages\DiffEqBase\5rKYk\src\fastpow.jl:106 [inlined]
  [3] stepsize_controller!
    @ C:\Users\Brendan\.julia\packages\OrdinaryDiffEq\vfMzV\src\integrators\controllers.jl:133 [inlined]
  [4] stepsize_controller!
    @ C:\Users\Brendan\.julia\packages\OrdinaryDiffEq\vfMzV\src\integrators\controllers.jl:5 [inlined]
  [5] _loopfooter!(integrator::OrdinaryDiffEq.ODEIntegrator{Tsit5{typeof(OrdinaryDiffEq.trivial_limiter!), typeof(OrdinaryDiffEq.trivial_limiter!), Static.False}, true, Matrix{Tracker.TrackedReal{Float64}}, Nothing, Float64, Tuple{Tracker.TrackedReal{Float64}, Matrix{Tracker.TrackedReal{Float64}}, Matrix{Tracker.TrackedReal{Float64}}}, Float64, Tracker.TrackedReal{Float64}, Tracker.TrackedReal{Float64}, Float64, Vector{Matrix{Tracker.TrackedReal{Float64}}}, ODESolution{Tracker.TrackedReal{Float64}, 3, Vector{Matrix{Tracker.TrackedReal{Float64}}}, Nothing, Nothing, Vector{Float64}, Vector{Vector{Matrix{Tracker.TrackedReal{Float64}}}}, ODEProblem{Matrix{Tracker.TrackedReal{Float64}}, Tuple{Float64, Float64}, true, Tuple{Tracker.TrackedReal{Float64}, Matrix{Tracker.TrackedReal{Float64}}, Matrix{Tracker.TrackedReal{Float64}}}, ODEFunction{true, SciMLBase.FullSpecialize, typeof(fast_react_diffuse!), UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing, Nothing}, Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, SciMLBase.StandardODEProblem}, Tsit5{typeof(OrdinaryDiffEq.trivial_limiter!), typeof(OrdinaryDiffEq.trivial_limiter!), Static.False}, OrdinaryDiffEq.InterpolationData{ODEFunction{true, SciMLBase.FullSpecialize, typeof(fast_react_diffuse!), UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing, Nothing}, Vector{Matrix{Tracker.TrackedReal{Float64}}}, Vector{Float64}, Vector{Vector{Matrix{Tracker.TrackedReal{Float64}}}}, OrdinaryDiffEq.Tsit5Cache{Matrix{Tracker.TrackedReal{Float64}}, Matrix{Tracker.TrackedReal{Float64}}, Matrix{Tracker.TrackedReal{Float64}}, OrdinaryDiffEq.Tsit5ConstantCache{Tracker.TrackedReal{Float64}, Float64}, typeof(OrdinaryDiffEq.trivial_limiter!), typeof(OrdinaryDiffEq.trivial_limiter!), Static.False}}, DiffEqBase.DEStats}, ODEFunction{true, SciMLBase.FullSpecialize, typeof(fast_react_diffuse!), UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing, Nothing}, OrdinaryDiffEq.Tsit5Cache{Matrix{Tracker.TrackedReal{Float64}}, Matrix{Tracker.TrackedReal{Float64}}, Matrix{Tracker.TrackedReal{Float64}}, OrdinaryDiffEq.Tsit5ConstantCache{Tracker.TrackedReal{Float64}, Float64}, typeof(OrdinaryDiffEq.trivial_limiter!), typeof(OrdinaryDiffEq.trivial_limiter!), Static.False}, OrdinaryDiffEq.DEOptions{Tracker.TrackedReal{Float64}, Tracker.TrackedReal{Float64}, Tracker.TrackedReal{Float64}, Float64, PIController{Rational{Int64}}, typeof(DiffEqBase.ODE_DEFAULT_NORM), typeof(opnorm), Nothing, CallbackSet{Tuple{}, Tuple{}}, typeof(DiffEqBase.ODE_DEFAULT_ISOUTOFDOMAIN), typeof(DiffEqBase.ODE_DEFAULT_PROG_MESSAGE), typeof(DiffEqBase.ODE_DEFAULT_UNSTABLE_CHECK), DataStructures.BinaryHeap{Float64, DataStructures.FasterForward}, DataStructures.BinaryHeap{Float64, DataStructures.FasterForward}, Nothing, Nothing, Int64, Tuple{}, Float64, Tuple{}}, Matrix{Tracker.TrackedReal{Float64}}, Tracker.TrackedReal{Float64}, Nothing, OrdinaryDiffEq.DefaultInit})
    @ OrdinaryDiffEq C:\Users\Brendan\.julia\packages\OrdinaryDiffEq\vfMzV\src\integrators\integrator_utils.jl:216
  [6] loopfooter!
    @ C:\Users\Brendan\.julia\packages\OrdinaryDiffEq\vfMzV\src\integrators\integrator_utils.jl:197 [inlined]
  [7] solve!(integrator::OrdinaryDiffEq.ODEIntegrator{Tsit5{typeof(OrdinaryDiffEq.trivial_limiter!), typeof(OrdinaryDiffEq.trivial_limiter!), Static.False}, true, Matrix{Tracker.TrackedReal{Float64}}, Nothing, Float64, Tuple{Tracker.TrackedReal{Float64}, Matrix{Tracker.TrackedReal{Float64}}, Matrix{Tracker.TrackedReal{Float64}}}, Float64, Tracker.TrackedReal{Float64}, Tracker.TrackedReal{Float64}, Float64, Vector{Matrix{Tracker.TrackedReal{Float64}}}, ODESolution{Tracker.TrackedReal{Float64}, 3, Vector{Matrix{Tracker.TrackedReal{Float64}}}, Nothing, Nothing, Vector{Float64}, Vector{Vector{Matrix{Tracker.TrackedReal{Float64}}}}, ODEProblem{Matrix{Tracker.TrackedReal{Float64}}, Tuple{Float64, Float64}, true, Tuple{Tracker.TrackedReal{Float64}, Matrix{Tracker.TrackedReal{Float64}}, Matrix{Tracker.TrackedReal{Float64}}}, ODEFunction{true, SciMLBase.FullSpecialize, typeof(fast_react_diffuse!), UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing, Nothing}, Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, SciMLBase.StandardODEProblem}, Tsit5{typeof(OrdinaryDiffEq.trivial_limiter!), typeof(OrdinaryDiffEq.trivial_limiter!), Static.False}, OrdinaryDiffEq.InterpolationData{ODEFunction{true, SciMLBase.FullSpecialize, typeof(fast_react_diffuse!), UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing, Nothing}, Vector{Matrix{Tracker.TrackedReal{Float64}}}, Vector{Float64}, Vector{Vector{Matrix{Tracker.TrackedReal{Float64}}}}, OrdinaryDiffEq.Tsit5Cache{Matrix{Tracker.TrackedReal{Float64}}, Matrix{Tracker.TrackedReal{Float64}}, Matrix{Tracker.TrackedReal{Float64}}, OrdinaryDiffEq.Tsit5ConstantCache{Tracker.TrackedReal{Float64}, Float64}, typeof(OrdinaryDiffEq.trivial_limiter!), typeof(OrdinaryDiffEq.trivial_limiter!), Static.False}}, DiffEqBase.DEStats}, ODEFunction{true, SciMLBase.FullSpecialize, typeof(fast_react_diffuse!), UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing, Nothing}, OrdinaryDiffEq.Tsit5Cache{Matrix{Tracker.TrackedReal{Float64}}, Matrix{Tracker.TrackedReal{Float64}}, Matrix{Tracker.TrackedReal{Float64}}, OrdinaryDiffEq.Tsit5ConstantCache{Tracker.TrackedReal{Float64}, Float64}, typeof(OrdinaryDiffEq.trivial_limiter!), typeof(OrdinaryDiffEq.trivial_limiter!), Static.False}, OrdinaryDiffEq.DEOptions{Tracker.TrackedReal{Float64}, Tracker.TrackedReal{Float64}, Tracker.TrackedReal{Float64}, Float64, PIController{Rational{Int64}}, typeof(DiffEqBase.ODE_DEFAULT_NORM), typeof(opnorm), Nothing, CallbackSet{Tuple{}, Tuple{}}, typeof(DiffEqBase.ODE_DEFAULT_ISOUTOFDOMAIN), typeof(DiffEqBase.ODE_DEFAULT_PROG_MESSAGE), typeof(DiffEqBase.ODE_DEFAULT_UNSTABLE_CHECK), DataStructures.BinaryHeap{Float64, DataStructures.FasterForward}, DataStructures.BinaryHeap{Float64, DataStructures.FasterForward}, Nothing, Nothing, Int64, Tuple{}, Float64, Tuple{}}, Matrix{Tracker.TrackedReal{Float64}}, Tracker.TrackedReal{Float64}, Nothing, OrdinaryDiffEq.DefaultInit})
    @ OrdinaryDiffEq C:\Users\Brendan\.julia\packages\OrdinaryDiffEq\vfMzV\src\solve.jl:515
  [8] __solve(::ODEProblem{Matrix{Tracker.TrackedReal{Float64}}, Tuple{Float64, Float64}, true, Tuple{Tracker.TrackedReal{Float64}, Matrix{Tracker.TrackedReal{Float64}}, Matrix{Tracker.TrackedReal{Float64}}}, ODEFunction{true, SciMLBase.FullSpecialize, typeof(fast_react_diffuse!), UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing, Nothing}, Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, SciMLBase.StandardODEProblem}, ::Tsit5{typeof(OrdinaryDiffEq.trivial_limiter!), typeof(OrdinaryDiffEq.trivial_limiter!), Static.False}; kwargs::Base.Pairs{Symbol, Float64, Tuple{Symbol, Symbol}, NamedTuple{(:saveat, :dt), Tuple{Float64, Float64}}})
    @ OrdinaryDiffEq C:\Users\Brendan\.julia\packages\OrdinaryDiffEq\vfMzV\src\solve.jl:6
  [9] #solve_call#26
    @ C:\Users\Brendan\.julia\packages\DiffEqBase\5rKYk\src\solve.jl:472 [inlined]
 [10] solve_up(prob::ODEProblem{Matrix{Tracker.TrackedReal{Float64}}, Tuple{Float64, Float64}, true, Tuple{Tracker.TrackedReal{Float64}, Matrix{Tracker.TrackedReal{Float64}}, Matrix{Tracker.TrackedReal{Float64}}}, ODEFunction{true, SciMLBase.FullSpecialize, typeof(fast_react_diffuse!), UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing, Nothing}, Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, SciMLBase.StandardODEProblem}, sensealg::Nothing, u0::Matrix{Tracker.TrackedReal{Float64}}, p::Tuple{Tracker.TrackedReal{Float64}, Matrix{Tracker.TrackedReal{Float64}}, Matrix{Tracker.TrackedReal{Float64}}}, args::Tsit5{typeof(OrdinaryDiffEq.trivial_limiter!), typeof(OrdinaryDiffEq.trivial_limiter!), Static.False}; kwargs::Base.Pairs{Symbol, Float64, Tuple{Symbol, Symbol}, NamedTuple{(:saveat, :dt), Tuple{Float64, Float64}}})
    @ DiffEqBase C:\Users\Brendan\.julia\packages\DiffEqBase\5rKYk\src\solve.jl:834
 [11] #solve#31
    @ C:\Users\Brendan\.julia\packages\DiffEqBase\5rKYk\src\solve.jl:801 [inlined]
 [12] testing_type_promotion(__model__::DynamicPPL.Model{typeof(testing_type_promotion), (:covariates, :response, :sample_idx, :prob), (), (), Tuple{Tuple{Matrix{Float64}, Matrix{Float64}}, Vector{Float64}, CartesianIndices{3, Tuple{StepRange{Int64, Int64}, StepRange{Int64, Int64}, UnitRange{Int64}}}, ODEProblem{Matrix{Float64}, Tuple{Float64, Float64}, true, Tuple{Float64, Matrix{Float64}, Matrix{Float64}}, ODEFunction{true, SciMLBase.FullSpecialize, typeof(fast_react_diffuse!), UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing, Nothing}, Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, SciMLBase.StandardODEProblem}}, Tuple{}, DynamicPPL.DefaultContext}, __varinfo__::DynamicPPL.TypedVarInfo{NamedTuple{(:d, :sigma), Tuple{DynamicPPL.Metadata{Dict{AbstractPPL.VarName{:d, Setfield.IdentityLens}, Int64}, Vector{Gamma{Float64}}, Vector{AbstractPPL.VarName{:d, Setfield.IdentityLens}}, TrackedArray{…,Vector{Float64}}, Vector{Set{DynamicPPL.Selector}}}, DynamicPPL.Metadata{Dict{AbstractPPL.VarName{:sigma, Setfield.IdentityLens}, Int64}, Vector{InverseGamma{Float64}}, Vector{AbstractPPL.VarName{:sigma, Setfield.IdentityLens}}, TrackedArray{…,Vector{Float64}}, Vector{Set{DynamicPPL.Selector}}}}}, Tracker.TrackedReal{Float64}}, __context__::DynamicPPL.SamplingContext{DynamicPPL.Sampler{NUTS{Turing.Essential.TrackerAD, (), AdvancedHMC.DiagEuclideanMetric}}, DynamicPPL.DefaultContext, Random._GLOBAL_RNG}, covariates::Tuple{Matrix{Float64}, Matrix{Float64}}, response::Vector{Float64}, sample_idx::CartesianIndices{3, Tuple{StepRange{Int64, Int64}, StepRange{Int64, Int64}, UnitRange{Int64}}}, prob::ODEProblem{Matrix{Float64}, Tuple{Float64, Float64}, true, Tuple{Float64, Matrix{Float64}, Matrix{Float64}}, ODEFunction{true, SciMLBase.FullSpecialize, typeof(fast_react_diffuse!), UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing, Nothing}, Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, SciMLBase.StandardODEProblem})
    @ Main .\REPL[98]:18
 [13] macro expansion
    @ C:\Users\Brendan\.julia\packages\DynamicPPL\zPOYL\src\model.jl:593 [inlined]
 [14] _evaluate!!
    @ C:\Users\Brendan\.julia\packages\DynamicPPL\zPOYL\src\model.jl:576 [inlined]
 [15] evaluate_threadunsafe!!
    @ C:\Users\Brendan\.julia\packages\DynamicPPL\zPOYL\src\model.jl:551 [inlined]
 [16] evaluate!!
    @ C:\Users\Brendan\.julia\packages\DynamicPPL\zPOYL\src\model.jl:504 [inlined]
 [17] evaluate!!
    @ C:\Users\Brendan\.julia\packages\DynamicPPL\zPOYL\src\model.jl:515 [inlined]
 [18] evaluate!!
    @ C:\Users\Brendan\.julia\packages\DynamicPPL\zPOYL\src\model.jl:523 [inlined]
 [19] LogDensityFunction
    @ C:\Users\Brendan\.julia\packages\Turing\szPqN\src\Turing.jl:38 [inlined]
 [20] logdensity
    @ C:\Users\Brendan\.julia\packages\Turing\szPqN\src\Turing.jl:42 [inlined]
 [21] #48
    @ C:\Users\Brendan\.julia\packages\LogDensityProblems\oAYeE\src\AD_Tracker.jl:25 [inlined]
 [22] #593
    @ C:\Users\Brendan\.julia\packages\Tracker\a9oj5\src\back.jl:148 [inlined]
 [23] forward(f::Tracker.var"#593#595"{LogDensityProblems.var"#48#49"{Turing.LogDensityFunction{DynamicPPL.TypedVarInfo{NamedTuple{(:d, :sigma), Tuple{DynamicPPL.Metadata{Dict{AbstractPPL.VarName{:d, Setfield.IdentityLens}, Int64}, Vector{Gamma{Float64}}, Vector{AbstractPPL.VarName{:d, Setfield.IdentityLens}}, Vector{Float64}, Vector{Set{DynamicPPL.Selector}}}, DynamicPPL.Metadata{Dict{AbstractPPL.VarName{:sigma, Setfield.IdentityLens}, Int64}, Vector{InverseGamma{Float64}}, Vector{AbstractPPL.VarName{:sigma, Setfield.IdentityLens}}, Vector{Float64}, Vector{Set{DynamicPPL.Selector}}}}}, Float64}, DynamicPPL.Model{typeof(testing_type_promotion), (:covariates, :response, :sample_idx, :prob), (), (), Tuple{Tuple{Matrix{Float64}, Matrix{Float64}}, Vector{Float64}, CartesianIndices{3, Tuple{StepRange{Int64, Int64}, StepRange{Int64, Int64}, UnitRange{Int64}}}, ODEProblem{Matrix{Float64}, Tuple{Float64, Float64}, true, Tuple{Float64, Matrix{Float64}, Matrix{Float64}}, ODEFunction{true, SciMLBase.FullSpecialize, typeof(fast_react_diffuse!), UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing, Nothing}, Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, SciMLBase.StandardODEProblem}}, Tuple{}, DynamicPPL.DefaultContext}, DynamicPPL.Sampler{NUTS{Turing.Essential.TrackerAD, (), AdvancedHMC.DiagEuclideanMetric}}, DynamicPPL.DefaultContext}}, Tuple{TrackedArray{…,Vector{Float64}}}}, ps::Tracker.Params)
    @ Tracker C:\Users\Brendan\.julia\packages\Tracker\a9oj5\src\back.jl:135
 [24] forward(f::Function, args::Vector{Float64})
    @ Tracker C:\Users\Brendan\.julia\packages\Tracker\a9oj5\src\back.jl:148
 [25] logdensity_and_gradient(∇ℓ::LogDensityProblems.TrackerGradientLogDensity{Turing.LogDensityFunction{DynamicPPL.TypedVarInfo{NamedTuple{(:d, :sigma), Tuple{DynamicPPL.Metadata{Dict{AbstractPPL.VarName{:d, Setfield.IdentityLens}, Int64}, Vector{Gamma{Float64}}, Vector{AbstractPPL.VarName{:d, Setfield.IdentityLens}}, Vector{Float64}, Vector{Set{DynamicPPL.Selector}}}, DynamicPPL.Metadata{Dict{AbstractPPL.VarName{:sigma, Setfield.IdentityLens}, Int64}, Vector{InverseGamma{Float64}}, Vector{AbstractPPL.VarName{:sigma, Setfield.IdentityLens}}, Vector{Float64}, Vector{Set{DynamicPPL.Selector}}}}}, Float64}, DynamicPPL.Model{typeof(testing_type_promotion), (:covariates, :response, :sample_idx, :prob), (), (), Tuple{Tuple{Matrix{Float64}, Matrix{Float64}}, Vector{Float64}, CartesianIndices{3, Tuple{StepRange{Int64, Int64}, StepRange{Int64, Int64}, UnitRange{Int64}}}, ODEProblem{Matrix{Float64}, Tuple{Float64, Float64}, true, Tuple{Float64, Matrix{Float64}, Matrix{Float64}}, ODEFunction{true, SciMLBase.FullSpecialize, typeof(fast_react_diffuse!), UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing, Nothing}, Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, SciMLBase.StandardODEProblem}}, Tuple{}, DynamicPPL.DefaultContext}, DynamicPPL.Sampler{NUTS{Turing.Essential.TrackerAD, (), AdvancedHMC.DiagEuclideanMetric}}, DynamicPPL.DefaultContext}}, x::Vector{Float64})
    @ LogDensityProblems C:\Users\Brendan\.julia\packages\LogDensityProblems\oAYeE\src\AD_Tracker.jl:25
 [26] ∂logπ∂θ
    @ C:\Users\Brendan\.julia\packages\Turing\szPqN\src\inference\hmc.jl:166 [inlined]
 [27] ∂H∂θ
    @ C:\Users\Brendan\.julia\packages\AdvancedHMC\iWHPQ\src\hamiltonian.jl:31 [inlined]
 [28] phasepoint
    @ C:\Users\Brendan\.julia\packages\AdvancedHMC\iWHPQ\src\hamiltonian.jl:76 [inlined]
 [29] phasepoint(rng::Random._GLOBAL_RNG, θ::Vector{Float64}, h::AdvancedHMC.Hamiltonian{AdvancedHMC.DiagEuclideanMetric{Float64, Vector{Float64}}, Base.Fix1{typeof(LogDensityProblems.logdensity), LogDensityProblems.TrackerGradientLogDensity{Turing.LogDensityFunction{DynamicPPL.TypedVarInfo{NamedTuple{(:d, :sigma), Tuple{DynamicPPL.Metadata{Dict{AbstractPPL.VarName{:d, Setfield.IdentityLens}, Int64}, Vector{Gamma{Float64}}, Vector{AbstractPPL.VarName{:d, Setfield.IdentityLens}}, Vector{Float64}, Vector{Set{DynamicPPL.Selector}}}, DynamicPPL.Metadata{Dict{AbstractPPL.VarName{:sigma, Setfield.IdentityLens}, Int64}, Vector{InverseGamma{Float64}}, Vector{AbstractPPL.VarName{:sigma, Setfield.IdentityLens}}, Vector{Float64}, Vector{Set{DynamicPPL.Selector}}}}}, Float64}, DynamicPPL.Model{typeof(testing_type_promotion), (:covariates, :response, :sample_idx, :prob), (), (), Tuple{Tuple{Matrix{Float64}, Matrix{Float64}}, Vector{Float64}, CartesianIndices{3, Tuple{StepRange{Int64, Int64}, StepRange{Int64, Int64}, UnitRange{Int64}}}, ODEProblem{Matrix{Float64}, Tuple{Float64, Float64}, true, Tuple{Float64, Matrix{Float64}, Matrix{Float64}}, ODEFunction{true, SciMLBase.FullSpecialize, typeof(fast_react_diffuse!), UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing, Nothing}, Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, SciMLBase.StandardODEProblem}}, Tuple{}, DynamicPPL.DefaultContext}, DynamicPPL.Sampler{NUTS{Turing.Essential.TrackerAD, (), AdvancedHMC.DiagEuclideanMetric}}, DynamicPPL.DefaultContext}}}, Turing.Inference.var"#∂logπ∂θ#44"{LogDensityProblems.TrackerGradientLogDensity{Turing.LogDensityFunction{DynamicPPL.TypedVarInfo{NamedTuple{(:d, :sigma), Tuple{DynamicPPL.Metadata{Dict{AbstractPPL.VarName{:d, Setfield.IdentityLens}, Int64}, Vector{Gamma{Float64}}, Vector{AbstractPPL.VarName{:d, Setfield.IdentityLens}}, Vector{Float64}, Vector{Set{DynamicPPL.Selector}}}, DynamicPPL.Metadata{Dict{AbstractPPL.VarName{:sigma, Setfield.IdentityLens}, Int64}, Vector{InverseGamma{Float64}}, Vector{AbstractPPL.VarName{:sigma, Setfield.IdentityLens}}, Vector{Float64}, Vector{Set{DynamicPPL.Selector}}}}}, Float64}, DynamicPPL.Model{typeof(testing_type_promotion), (:covariates, :response, :sample_idx, :prob), (), (), Tuple{Tuple{Matrix{Float64}, Matrix{Float64}}, Vector{Float64}, CartesianIndices{3, Tuple{StepRange{Int64, Int64}, StepRange{Int64, Int64}, UnitRange{Int64}}}, ODEProblem{Matrix{Float64}, Tuple{Float64, Float64}, true, Tuple{Float64, Matrix{Float64}, Matrix{Float64}}, ODEFunction{true, SciMLBase.FullSpecialize, typeof(fast_react_diffuse!), UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing, Nothing}, Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, SciMLBase.StandardODEProblem}}, Tuple{}, DynamicPPL.DefaultContext}, DynamicPPL.Sampler{NUTS{Turing.Essential.TrackerAD, (), AdvancedHMC.DiagEuclideanMetric}}, DynamicPPL.DefaultContext}}}})
    @ AdvancedHMC C:\Users\Brendan\.julia\packages\AdvancedHMC\iWHPQ\src\hamiltonian.jl:153
 [30] initialstep(rng::Random._GLOBAL_RNG, model::DynamicPPL.Model{typeof(testing_type_promotion), (:covariates, :response, :sample_idx, :prob), (), (), Tuple{Tuple{Matrix{Float64}, Matrix{Float64}}, Vector{Float64}, CartesianIndices{3, Tuple{StepRange{Int64, Int64}, StepRange{Int64, Int64}, UnitRange{Int64}}}, ODEProblem{Matrix{Float64}, Tuple{Float64, Float64}, true, Tuple{Float64, Matrix{Float64}, Matrix{Float64}}, ODEFunction{true, SciMLBase.FullSpecialize, typeof(fast_react_diffuse!), UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing, Nothing}, Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, SciMLBase.StandardODEProblem}}, Tuple{}, DynamicPPL.DefaultContext}, spl::DynamicPPL.Sampler{NUTS{Turing.Essential.TrackerAD, (), AdvancedHMC.DiagEuclideanMetric}}, vi::DynamicPPL.TypedVarInfo{NamedTuple{(:d, :sigma), Tuple{DynamicPPL.Metadata{Dict{AbstractPPL.VarName{:d, Setfield.IdentityLens}, Int64}, Vector{Gamma{Float64}}, Vector{AbstractPPL.VarName{:d, Setfield.IdentityLens}}, Vector{Float64}, Vector{Set{DynamicPPL.Selector}}}, DynamicPPL.Metadata{Dict{AbstractPPL.VarName{:sigma, Setfield.IdentityLens}, Int64}, Vector{InverseGamma{Float64}}, Vector{AbstractPPL.VarName{:sigma, Setfield.IdentityLens}}, Vector{Float64}, Vector{Set{DynamicPPL.Selector}}}}}, Float64}; init_params::Nothing, nadapts::Int64, kwargs::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
    @ Turing.Inference C:\Users\Brendan\.julia\packages\Turing\szPqN\src\inference\hmc.jl:170
 [31] step(rng::Random._GLOBAL_RNG, model::DynamicPPL.Model{typeof(testing_type_promotion), (:covariates, :response, :sample_idx, :prob), (), (), Tuple{Tuple{Matrix{Float64}, Matrix{Float64}}, Vector{Float64}, CartesianIndices{3, Tuple{StepRange{Int64, Int64}, StepRange{Int64, Int64}, UnitRange{Int64}}}, ODEProblem{Matrix{Float64}, Tuple{Float64, Float64}, true, Tuple{Float64, Matrix{Float64}, Matrix{Float64}}, ODEFunction{true, SciMLBase.FullSpecialize, typeof(fast_react_diffuse!), UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing, Nothing}, Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, SciMLBase.StandardODEProblem}}, Tuple{}, DynamicPPL.DefaultContext}, spl::DynamicPPL.Sampler{NUTS{Turing.Essential.TrackerAD, (), AdvancedHMC.DiagEuclideanMetric}}; resume_from::Nothing, init_params::Nothing, kwargs::Base.Pairs{Symbol, Int64, Tuple{Symbol}, NamedTuple{(:nadapts,), Tuple{Int64}}})
    @ DynamicPPL C:\Users\Brendan\.julia\packages\DynamicPPL\zPOYL\src\sampler.jl:104
 [32] macro expansion
    @ C:\Users\Brendan\.julia\packages\AbstractMCMC\fnRmh\src\sample.jl:120 [inlined]
 [33] macro expansion
    @ C:\Users\Brendan\.julia\packages\ProgressLogging\6KXlp\src\ProgressLogging.jl:328 [inlined]
 [34] macro expansion
    @ C:\Users\Brendan\.julia\packages\AbstractMCMC\fnRmh\src\logging.jl:9 [inlined]
 [35] mcmcsample(rng::Random._GLOBAL_RNG, model::DynamicPPL.Model{typeof(testing_type_promotion), (:covariates, :response, :sample_idx, :prob), (), (), Tuple{Tuple{Matrix{Float64}, Matrix{Float64}}, Vector{Float64}, CartesianIndices{3, Tuple{StepRange{Int64, Int64}, StepRange{Int64, Int64}, UnitRange{Int64}}}, ODEProblem{Matrix{Float64}, Tuple{Float64, Float64}, true, Tuple{Float64, Matrix{Float64}, Matrix{Float64}}, ODEFunction{true, SciMLBase.FullSpecialize, typeof(fast_react_diffuse!), UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing, Nothing}, Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, SciMLBase.StandardODEProblem}}, Tuple{}, DynamicPPL.DefaultContext}, sampler::DynamicPPL.Sampler{NUTS{Turing.Essential.TrackerAD, (), AdvancedHMC.DiagEuclideanMetric}}, N::Int64; progress::Bool, progressname::String, callback::Nothing, discard_initial::Int64, thinning::Int64, chain_type::Type, kwargs::Base.Pairs{Symbol, Int64, Tuple{Symbol}, NamedTuple{(:nadapts,), Tuple{Int64}}})
    @ AbstractMCMC C:\Users\Brendan\.julia\packages\AbstractMCMC\fnRmh\src\sample.jl:111
 [36] sample(rng::Random._GLOBAL_RNG, model::DynamicPPL.Model{typeof(testing_type_promotion), (:covariates, :response, :sample_idx, :prob), (), (), Tuple{Tuple{Matrix{Float64}, Matrix{Float64}}, Vector{Float64}, CartesianIndices{3, Tuple{StepRange{Int64, Int64}, StepRange{Int64, Int64}, UnitRange{Int64}}}, ODEProblem{Matrix{Float64}, Tuple{Float64, Float64}, true, Tuple{Float64, Matrix{Float64}, Matrix{Float64}}, ODEFunction{true, SciMLBase.FullSpecialize, typeof(fast_react_diffuse!), UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing, Nothing}, Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, SciMLBase.StandardODEProblem}}, Tuple{}, DynamicPPL.DefaultContext}, sampler::DynamicPPL.Sampler{NUTS{Turing.Essential.TrackerAD, (), AdvancedHMC.DiagEuclideanMetric}}, N::Int64; chain_type::Type, resume_from::Nothing, progress::Bool, nadapts::Int64, discard_adapt::Bool, discard_initial::Int64, kwargs::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
    @ Turing.Inference C:\Users\Brendan\.julia\packages\Turing\szPqN\src\inference\hmc.jl:133
 [37] sample
    @ C:\Users\Brendan\.julia\packages\Turing\szPqN\src\inference\hmc.jl:103 [inlined]
 [38] #sample#2
    @ C:\Users\Brendan\.julia\packages\Turing\szPqN\src\inference\Inference.jl:145 [inlined]
 [39] sample
    @ C:\Users\Brendan\.julia\packages\Turing\szPqN\src\inference\Inference.jl:138 [inlined]
 [40] #sample#1
    @ C:\Users\Brendan\.julia\packages\Turing\szPqN\src\inference\Inference.jl:135 [inlined]
 [41] sample(model::DynamicPPL.Model{typeof(testing_type_promotion), (:covariates, :response, :sample_idx, :prob), (), (), Tuple{Tuple{Matrix{Float64}, Matrix{Float64}}, Vector{Float64}, CartesianIndices{3, Tuple{StepRange{Int64, Int64}, StepRange{Int64, Int64}, UnitRange{Int64}}}, ODEProblem{Matrix{Float64}, Tuple{Float64, Float64}, true, Tuple{Float64, Matrix{Float64}, Matrix{Float64}}, ODEFunction{true, SciMLBase.FullSpecialize, typeof(fast_react_diffuse!), UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing, Nothing}, Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, SciMLBase.StandardODEProblem}}, Tuple{}, DynamicPPL.DefaultContext}, alg::NUTS{Turing.Essential.TrackerAD, (), AdvancedHMC.DiagEuclideanMetric}, N::Int64)
    @ Turing.Inference C:\Users\Brendan\.julia\packages\Turing\szPqN\src\inference\Inference.jl:129
 [42] top-level scope
    @ REPL[100]:1

This was premature–other runs with forwarddiff were just as unstable. However, if I constrain the support of d to be 0 to 10 (sample from beta; multiply by 10), then it quickly converges to a reasonable value.

Note that sigma is reasonable as well, as observation noise was generated by this line:

noisy_sol = Array(sol) + 0.4 * randn(size(Array(sol)))

I imagine there is still room for improvement in the sampling process, but that is more along the lines of what I was expecting.

It is worth noting that, in general, changing the prior will have a large effect on a model. Differential equation models are typically more sensitive than non-DE models to choice of prior.

Another detail which comes to the foreground here: the interaction of NUTS with long-tailed distributions. In short, NUTS will explore the tails, a behavior which may be unexpected (compared to other Markov chain algorithms). Often, this can result in inordinate amounts of time being spent in the region of parameter space you never expected (and, since you did not expect it, perhaps such values would be unstable!). Switching from the gamma distribution to the beta distribution is an excellent demonstration of this: the gamma has no upper bound, whereas the beta has clear lower and upper bounds. Consequently, the switch removed the possibility of (extreme) tail exploration.

  • A nice primer on HMC and NUTS is helpful.
  • I like the Stan manual as a primer to thinking about reparameterization as an integral part of Bayesian model implementation.

Note that I am not recommending that long-tailed distributions be avoided! However, one must be aware of the potential effects (slow sampling and/or numerical stability problems) and reparameterize accordingly.

2 Likes

Try

predicted = vec(Array(solve(prob, Tsit5(); p=p, u0 = typeof(d).(prob.u0), saveat=1.0))[sample_idx])

I think that will solve your ReverseDiff and Tracker issues, and if it does, I’ll need to chat with @devmotion about automating that.

No luck. With this code

@model function extra_simple_troubleshootfitlv(covariates, response, sample_idx, prob)
  d ~ Beta(1, 3)
  sigma ~ InverseGamma(2, 3)
  d = 10*d
  println("d is ", d)
  println("sigma is ", sigma)
  p = (d, covariates[1], covariates[2])
  println("eltype R, K is ", eltype(p[2]), eltype(p[3]))
  predicted = vec(Array(solve(prob, Tsit5(); p=p, u0 = typeof(d).(prob.u0), saveat=1.0))[sample_idx])
  response ~ MvNormal(predicted, sigma^2 * I)
  return nothing
end

ts_extra_simple_model_1 = extra_simple_troubleshootfitlv((p[2], p[3]), vec(noisy_sol[sample_idx]), sample_idx, prob)
sample(ts_extra_simple_model_1, NUTS{Turing.TrackerAD}(), MCMCSerial(), 100, 1; progress=true)

I get the familiar error

...
d is 8.760177343593057 (tracked)
sigma is 0.6429632557713116 (tracked)
eltype R, K is Float64Float64
ERROR: MethodError: no method matching Float64(::Tracker.TrackedReal{Float64})
Closest candidates are:
  (::Type{T})(::Real, ::RoundingMode) where T<:AbstractFloat at rounding.jl:200
  (::Type{T})(::T) where T<:Number at boot.jl:772
  (::Type{T})(::AbstractChar) where T<:Union{AbstractChar, Number} at char.jl:50
  ...
Stacktrace:
  [1] convert(#unused#::Type{Float64}, x::Tracker.TrackedReal{Float64})
    @ Base .\number.jl:7
  [2] ode_determine_initdt(u0::Matrix{Tracker.TrackedReal{Float64}}, t::Float64, tdir::Float64, dtmax::Float64, abstol::Tracker.TrackedReal{Float64}, reltol::Tracker.TrackedReal{Float64}, internalnorm::typeof(DiffEqBase.ODE_DEFAULT_NORM), prob::ODEProblem{Matrix{Tracker.TrackedReal{Float64}}, Tuple{Float64, Float64}, true, Tuple{Tracker.TrackedReal{Float64}, Matrix{Float64}, Matrix{Float64}}, ODEFunction{true, SciMLBase.FullSpecialize, typeof(fast_react_diffuse!), UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing, Nothing}, Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, SciMLBase.StandardODEProblem}, integrator::OrdinaryDiffEq.ODEIntegrator{Tsit5{typeof(OrdinaryDiffEq.trivial_limiter!), typeof(OrdinaryDiffEq.trivial_limiter!), Static.False}, true, Matrix{Tracker.TrackedReal{Float64}}, Nothing, Float64, Tuple{Tracker.TrackedReal{Float64}, Matrix{Float64}, Matrix{Float64}}, Float64, Tracker.TrackedReal{Float64}, Tracker.TrackedReal{Float64}, Float64, Vector{Matrix{Tracker.TrackedReal{Float64}}}, ODESolution{Tracker.TrackedReal{Float64}, 3, Vector{Matrix{Tracker.TrackedReal{Float64}}}, Nothing, Nothing, Vector{Float64}, Vector{Vector{Matrix{Tracker.TrackedReal{Float64}}}}, ODEProblem{Matrix{Tracker.TrackedReal{Float64}}, Tuple{Float64, Float64}, true, Tuple{Tracker.TrackedReal{Float64}, Matrix{Float64}, Matrix{Float64}}, ODEFunction{true, SciMLBase.FullSpecialize, typeof(fast_react_diffuse!), UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing, Nothing}, Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, SciMLBase.StandardODEProblem}, Tsit5{typeof(OrdinaryDiffEq.trivial_limiter!), typeof(OrdinaryDiffEq.trivial_limiter!), Static.False}, OrdinaryDiffEq.InterpolationData{ODEFunction{true, SciMLBase.FullSpecialize, typeof(fast_react_diffuse!), UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing, Nothing}, Vector{Matrix{Tracker.TrackedReal{Float64}}}, Vector{Float64}, Vector{Vector{Matrix{Tracker.TrackedReal{Float64}}}}, OrdinaryDiffEq.Tsit5Cache{Matrix{Tracker.TrackedReal{Float64}}, Matrix{Tracker.TrackedReal{Float64}}, Matrix{Tracker.TrackedReal{Float64}}, OrdinaryDiffEq.Tsit5ConstantCache{Tracker.TrackedReal{Float64}, Float64}, typeof(OrdinaryDiffEq.trivial_limiter!), typeof(OrdinaryDiffEq.trivial_limiter!), Static.False}}, DiffEqBase.DEStats}, ODEFunction{true, SciMLBase.FullSpecialize, typeof(fast_react_diffuse!), UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing, Nothing}, OrdinaryDiffEq.Tsit5Cache{Matrix{Tracker.TrackedReal{Float64}}, Matrix{Tracker.TrackedReal{Float64}}, Matrix{Tracker.TrackedReal{Float64}}, OrdinaryDiffEq.Tsit5ConstantCache{Tracker.TrackedReal{Float64}, Float64}, typeof(OrdinaryDiffEq.trivial_limiter!), typeof(OrdinaryDiffEq.trivial_limiter!), Static.False}, OrdinaryDiffEq.DEOptions{Tracker.TrackedReal{Float64}, Tracker.TrackedReal{Float64}, Tracker.TrackedReal{Float64}, Float64, PIController{Rational{Int64}}, typeof(DiffEqBase.ODE_DEFAULT_NORM), typeof(opnorm), Nothing, CallbackSet{Tuple{}, Tuple{}}, typeof(DiffEqBase.ODE_DEFAULT_ISOUTOFDOMAIN), typeof(DiffEqBase.ODE_DEFAULT_PROG_MESSAGE), typeof(DiffEqBase.ODE_DEFAULT_UNSTABLE_CHECK), DataStructures.BinaryHeap{Float64, DataStructures.FasterForward}, DataStructures.BinaryHeap{Float64, DataStructures.FasterForward}, Nothing, Nothing, Int64, Tuple{}, Float64, Tuple{}}, Matrix{Tracker.TrackedReal{Float64}}, Tracker.TrackedReal{Float64}, Nothing, OrdinaryDiffEq.DefaultInit})
    @ OrdinaryDiffEq C:\Users\Brendan\.julia\packages\OrdinaryDiffEq\vfMzV\src\initdt.jl:130
  [3] auto_dt_reset!(integrator::OrdinaryDiffEq.ODEIntegrator{Tsit5{typeof(OrdinaryDiffEq.trivial_limiter!), typeof(OrdinaryDiffEq.trivial_limiter!), Static.False}, true, Matrix{Tracker.TrackedReal{Float64}}, Nothing, Float64, Tuple{Tracker.TrackedReal{Float64}, Matrix{Float64}, Matrix{Float64}}, Float64, Tracker.TrackedReal{Float64}, Tracker.TrackedReal{Float64}, Float64, Vector{Matrix{Tracker.TrackedReal{Float64}}}, ODESolution{Tracker.TrackedReal{Float64}, 3, Vector{Matrix{Tracker.TrackedReal{Float64}}}, Nothing, Nothing, Vector{Float64}, Vector{Vector{Matrix{Tracker.TrackedReal{Float64}}}}, ODEProblem{Matrix{Tracker.TrackedReal{Float64}}, Tuple{Float64, Float64}, true, Tuple{Tracker.TrackedReal{Float64}, Matrix{Float64}, Matrix{Float64}}, ODEFunction{true, SciMLBase.FullSpecialize, typeof(fast_react_diffuse!), UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing, Nothing}, Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, SciMLBase.StandardODEProblem}, Tsit5{typeof(OrdinaryDiffEq.trivial_limiter!), typeof(OrdinaryDiffEq.trivial_limiter!), Static.False}, OrdinaryDiffEq.InterpolationData{ODEFunction{true, SciMLBase.FullSpecialize, typeof(fast_react_diffuse!), UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing, Nothing}, Vector{Matrix{Tracker.TrackedReal{Float64}}}, Vector{Float64}, Vector{Vector{Matrix{Tracker.TrackedReal{Float64}}}}, OrdinaryDiffEq.Tsit5Cache{Matrix{Tracker.TrackedReal{Float64}}, Matrix{Tracker.TrackedReal{Float64}}, Matrix{Tracker.TrackedReal{Float64}}, OrdinaryDiffEq.Tsit5ConstantCache{Tracker.TrackedReal{Float64}, Float64}, typeof(OrdinaryDiffEq.trivial_limiter!), typeof(OrdinaryDiffEq.trivial_limiter!), Static.False}}, DiffEqBase.DEStats}, ODEFunction{true, SciMLBase.FullSpecialize, typeof(fast_react_diffuse!), UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing, Nothing}, OrdinaryDiffEq.Tsit5Cache{Matrix{Tracker.TrackedReal{Float64}}, Matrix{Tracker.TrackedReal{Float64}}, Matrix{Tracker.TrackedReal{Float64}}, OrdinaryDiffEq.Tsit5ConstantCache{Tracker.TrackedReal{Float64}, Float64}, typeof(OrdinaryDiffEq.trivial_limiter!), typeof(OrdinaryDiffEq.trivial_limiter!), Static.False}, OrdinaryDiffEq.DEOptions{Tracker.TrackedReal{Float64}, Tracker.TrackedReal{Float64}, Tracker.TrackedReal{Float64}, Float64, PIController{Rational{Int64}}, typeof(DiffEqBase.ODE_DEFAULT_NORM), typeof(opnorm), Nothing, CallbackSet{Tuple{}, Tuple{}}, typeof(DiffEqBase.ODE_DEFAULT_ISOUTOFDOMAIN), typeof(DiffEqBase.ODE_DEFAULT_PROG_MESSAGE), typeof(DiffEqBase.ODE_DEFAULT_UNSTABLE_CHECK), DataStructures.BinaryHeap{Float64, DataStructures.FasterForward}, DataStructures.BinaryHeap{Float64, DataStructures.FasterForward}, Nothing, Nothing, Int64, Tuple{}, Float64, Tuple{}}, Matrix{Tracker.TrackedReal{Float64}}, Tracker.TrackedReal{Float64}, Nothing, OrdinaryDiffEq.DefaultInit})
    @ OrdinaryDiffEq C:\Users\Brendan\.julia\packages\OrdinaryDiffEq\vfMzV\src\integrators\integrator_interface.jl:437
  [4] handle_dt!(integrator::OrdinaryDiffEq.ODEIntegrator{Tsit5{typeof(OrdinaryDiffEq.trivial_limiter!), typeof(OrdinaryDiffEq.trivial_limiter!), Static.False}, true, Matrix{Tracker.TrackedReal{Float64}}, Nothing, Float64, Tuple{Tracker.TrackedReal{Float64}, Matrix{Float64}, Matrix{Float64}}, Float64, Tracker.TrackedReal{Float64}, Tracker.TrackedReal{Float64}, Float64, Vector{Matrix{Tracker.TrackedReal{Float64}}}, ODESolution{Tracker.TrackedReal{Float64}, 3, Vector{Matrix{Tracker.TrackedReal{Float64}}}, Nothing, Nothing, Vector{Float64}, Vector{Vector{Matrix{Tracker.TrackedReal{Float64}}}}, ODEProblem{Matrix{Tracker.TrackedReal{Float64}}, Tuple{Float64, Float64}, true, Tuple{Tracker.TrackedReal{Float64}, Matrix{Float64}, Matrix{Float64}}, ODEFunction{true, SciMLBase.FullSpecialize, typeof(fast_react_diffuse!), UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing, Nothing}, Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, SciMLBase.StandardODEProblem}, Tsit5{typeof(OrdinaryDiffEq.trivial_limiter!), typeof(OrdinaryDiffEq.trivial_limiter!), Static.False}, OrdinaryDiffEq.InterpolationData{ODEFunction{true, SciMLBase.FullSpecialize, typeof(fast_react_diffuse!), UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing, Nothing}, Vector{Matrix{Tracker.TrackedReal{Float64}}}, Vector{Float64}, Vector{Vector{Matrix{Tracker.TrackedReal{Float64}}}}, OrdinaryDiffEq.Tsit5Cache{Matrix{Tracker.TrackedReal{Float64}}, Matrix{Tracker.TrackedReal{Float64}}, Matrix{Tracker.TrackedReal{Float64}}, OrdinaryDiffEq.Tsit5ConstantCache{Tracker.TrackedReal{Float64}, Float64}, typeof(OrdinaryDiffEq.trivial_limiter!), typeof(OrdinaryDiffEq.trivial_limiter!), Static.False}}, DiffEqBase.DEStats}, ODEFunction{true, SciMLBase.FullSpecialize, typeof(fast_react_diffuse!), UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing, Nothing}, OrdinaryDiffEq.Tsit5Cache{Matrix{Tracker.TrackedReal{Float64}}, Matrix{Tracker.TrackedReal{Float64}}, Matrix{Tracker.TrackedReal{Float64}}, OrdinaryDiffEq.Tsit5ConstantCache{Tracker.TrackedReal{Float64}, Float64}, typeof(OrdinaryDiffEq.trivial_limiter!), typeof(OrdinaryDiffEq.trivial_limiter!), Static.False}, OrdinaryDiffEq.DEOptions{Tracker.TrackedReal{Float64}, Tracker.TrackedReal{Float64}, Tracker.TrackedReal{Float64}, Float64, PIController{Rational{Int64}}, typeof(DiffEqBase.ODE_DEFAULT_NORM), typeof(opnorm), Nothing, CallbackSet{Tuple{}, Tuple{}}, typeof(DiffEqBase.ODE_DEFAULT_ISOUTOFDOMAIN), typeof(DiffEqBase.ODE_DEFAULT_PROG_MESSAGE), typeof(DiffEqBase.ODE_DEFAULT_UNSTABLE_CHECK), DataStructures.BinaryHeap{Float64, DataStructures.FasterForward}, DataStructures.BinaryHeap{Float64, DataStructures.FasterForward}, Nothing, Nothing, Int64, Tuple{}, Float64, Tuple{}}, Matrix{Tracker.TrackedReal{Float64}}, Tracker.TrackedReal{Float64}, Nothing, OrdinaryDiffEq.DefaultInit})
...

Same for using ReverseDiff

sample(ts_extra_simple_model_1, NUTS{Turing.ReverseDiffAD{false}}(), MCMCSerial(), 100, 1; progress=true)
d is 7.948801073207859
sigma is 1.0744778417936136
eltype R, K is Float64Float64
d is 7.94880107320786
sigma is 1.0744778417936136
eltype R, K is Float64Float64
d is TrackedReal<6OI>(7.94880107320786, 0.0, Jpe, ---)
sigma is TrackedReal<7dz>(1.0744778417936136, 0.0, Jpe, ---)
eltype R, K is Float64Float64
ERROR: ArgumentError: Converting an instance of ReverseDiff.TrackedReal{Float64, Float64, Nothing} to Float64 is not defined. Please use `ReverseDiff.value` instead.
Stacktrace:
  [1] convert(#unused#::Type{Float64}, t::ReverseDiff.TrackedReal{Float64, Float64, Nothing})
    @ ReverseDiff C:\Users\Brendan\.julia\packages\ReverseDiff\GtPeW\src\tracked.jl:261
  [2] ode_determine_initdt(u0::Matrix{ReverseDiff.TrackedReal{Float64, Float64, Nothing}}, t::Float64, tdir::Float64, dtmax::Float64, abstol::ReverseDiff.TrackedReal{Float64, Float64, Nothing}, reltol::ReverseDiff.TrackedReal{Float64, Float64, Nothing}, internalnorm::typeof(DiffEqBase.ODE_DEFAULT_NORM), prob::ODEProblem{Matrix{ReverseDiff.TrackedReal{Float64, Float64, Nothing}}, Tuple{Float64, Float64}, true, Tuple{ReverseDiff.TrackedReal{Float64, Float64, Nothing}, Matrix{Float64}, Matrix{Float64}}, ODEFunction{true, SciMLBase.FullSpecialize, typeof(fast_react_diffuse!), UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing, Nothing}, Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, SciMLBase.StandardODEProblem}, integrator::OrdinaryDiffEq.ODEIntegrator{Tsit5{typeof(OrdinaryDiffEq.trivial_limiter!), typeof(OrdinaryDiffEq.trivial_limiter!), Static.False}, true, Matrix{ReverseDiff.TrackedReal{Float64, Float64, Nothing}}, Nothing, Float64, Tuple{ReverseDiff.TrackedReal{Float64, Float64, Nothing}, Matrix{Float64}, Matrix{Float64}}, Float64, ReverseDiff.TrackedReal{Float64, Float64, Nothing}, ReverseDiff.TrackedReal{Float64, Float64, Nothing}, Float64, Vector{Matrix{ReverseDiff.TrackedReal{Float64, Float64, Nothing}}}, ODESolution{ReverseDiff.TrackedReal{Float64, Float64, Nothing}, 3, Vector{Matrix{ReverseDiff.TrackedReal{Float64, Float64, Nothing}}}, Nothing, Nothing, Vector{Float64}, Vector{Vector{Matrix{ReverseDiff.TrackedReal{Float64, Float64, Nothing}}}}, ODEProblem{Matrix{ReverseDiff.TrackedReal{Float64, Float64, Nothing}}, Tuple{Float64, Float64}, true, Tuple{ReverseDiff.TrackedReal{Float64, Float64, Nothing}, Matrix{Float64}, Matrix{Float64}}, ODEFunction{true, SciMLBase.FullSpecialize, typeof(fast_react_diffuse!), UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing, Nothing}, Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, SciMLBase.StandardODEProblem}, Tsit5{typeof(OrdinaryDiffEq.trivial_limiter!), typeof(OrdinaryDiffEq.trivial_limiter!), Static.False}, OrdinaryDiffEq.InterpolationData{ODEFunction{true, SciMLBase.FullSpecialize, typeof(fast_react_diffuse!), UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing, Nothing}, Vector{Matrix{ReverseDiff.TrackedReal{Float64, Float64, Nothing}}}, Vector{Float64}, Vector{Vector{Matrix{ReverseDiff.TrackedReal{Float64, Float64, Nothing}}}}, OrdinaryDiffEq.Tsit5Cache{Matrix{ReverseDiff.TrackedReal{Float64, Float64, Nothing}}, Matrix{ReverseDiff.TrackedReal{Float64, Float64, Nothing}}, Matrix{ReverseDiff.TrackedReal{Float64, Float64, Nothing}}, OrdinaryDiffEq.Tsit5ConstantCache{ReverseDiff.TrackedReal{Float64, Float64, Nothing}, Float64}, typeof(OrdinaryDiffEq.trivial_limiter!), typeof(OrdinaryDiffEq.trivial_limiter!), Static.False}}, DiffEqBase.DEStats}, ODEFunction{true, SciMLBase.FullSpecialize, typeof(fast_react_diffuse!), UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing, Nothing}, OrdinaryDiffEq.Tsit5Cache{Matrix{ReverseDiff.TrackedReal{Float64, Float64, Nothing}}, Matrix{ReverseDiff.TrackedReal{Float64, Float64, Nothing}}, Matrix{ReverseDiff.TrackedReal{Float64, Float64, Nothing}}, OrdinaryDiffEq.Tsit5ConstantCache{ReverseDiff.TrackedReal{Float64, Float64, Nothing}, Float64}, typeof(OrdinaryDiffEq.trivial_limiter!), typeof(OrdinaryDiffEq.trivial_limiter!), Static.False}, OrdinaryDiffEq.DEOptions{ReverseDiff.TrackedReal{Float64, Float64, Nothing}, ReverseDiff.TrackedReal{Float64, Float64, Nothing}, ReverseDiff.TrackedReal{Float64, Float64, Nothing}, Float64, PIController{Rational{Int64}}, typeof(DiffEqBase.ODE_DEFAULT_NORM), typeof(opnorm), Nothing, CallbackSet{Tuple{}, Tuple{}}, typeof(DiffEqBase.ODE_DEFAULT_ISOUTOFDOMAIN), typeof(DiffEqBase.ODE_DEFAULT_PROG_MESSAGE), typeof(DiffEqBase.ODE_DEFAULT_UNSTABLE_CHECK), DataStructures.BinaryHeap{Float64, DataStructures.FasterForward}, DataStructures.BinaryHeap{Float64, DataStructures.FasterForward}, Nothing, Nothing, Int64, Tuple{}, Float64, Tuple{}}, Matrix{ReverseDiff.TrackedReal{Float64, Float64, Nothing}}, ReverseDiff.TrackedReal{Float64, Float64, Nothing}, Nothing, OrdinaryDiffEq.DefaultInit})
    @ OrdinaryDiffEq C:\Users\Brendan\.julia\packages\OrdinaryDiffEq\vfMzV\src\initdt.jl:130
  [3] auto_dt_reset!(integrator::OrdinaryDiffEq.ODEIntegrator{Tsit5{typeof(OrdinaryDiffEq.trivial_limiter!), typeof(OrdinaryDiffEq.trivial_limiter!), Static.False}, true, Matrix{ReverseDiff.TrackedReal{Float64, Float64, Nothing}}, Nothing, Float64, Tuple{ReverseDiff.TrackedReal{Float64, Float64, Nothing}, Matrix{Float64}, Matrix{Float64}}, Float64, ReverseDiff.TrackedReal{Float64, Float64, Nothing}, ReverseDiff.TrackedReal{Float64, Float64, Nothing}, Float64, Vector{Matrix{ReverseDiff.TrackedReal{Float64, Float64, Nothing}}}, ODESolution{ReverseDiff.TrackedReal{Float64, Float64, Nothing}, 3, Vector{Matrix{ReverseDiff.TrackedReal{Float64, Float64, Nothing}}}, Nothing, Nothing, Vector{Float64}, Vector{Vector{Matrix{ReverseDiff.TrackedReal{Float64, Float64, Nothing}}}}, ODEProblem{Matrix{ReverseDiff.TrackedReal{Float64, Float64, Nothing}}, Tuple{Float64, Float64}, true, Tuple{ReverseDiff.TrackedReal{Float64, Float64, Nothing}, Matrix{Float64}, Matrix{Float64}}, ODEFunction{true, SciMLBase.FullSpecialize, typeof(fast_react_diffuse!), UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing, Nothing}, Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, SciMLBase.StandardODEProblem}, Tsit5{typeof(OrdinaryDiffEq.trivial_limiter!), typeof(OrdinaryDiffEq.trivial_limiter!), Static.False}, OrdinaryDiffEq.InterpolationData{ODEFunction{true, SciMLBase.FullSpecialize, typeof(fast_react_diffuse!), UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing, Nothing}, Vector{Matrix{ReverseDiff.TrackedReal{Float64, Float64, Nothing}}}, Vector{Float64}, Vector{Vector{Matrix{ReverseDiff.TrackedReal{Float64, Float64, Nothing}}}}, OrdinaryDiffEq.Tsit5Cache{Matrix{ReverseDiff.TrackedReal{Float64, Float64, Nothing}}, Matrix{ReverseDiff.TrackedReal{Float64, Float64, Nothing}}, Matrix{ReverseDiff.TrackedReal{Float64, Float64, Nothing}}, OrdinaryDiffEq.Tsit5ConstantCache{ReverseDiff.TrackedReal{Float64, Float64, Nothing}, Float64}, typeof(OrdinaryDiffEq.trivial_limiter!), typeof(OrdinaryDiffEq.trivial_limiter!), Static.False}}, DiffEqBase.DEStats}, ODEFunction{true, SciMLBase.FullSpecialize, typeof(fast_react_diffuse!), UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing, Nothing}, OrdinaryDiffEq.Tsit5Cache{Matrix{ReverseDiff.TrackedReal{Float64, Float64, Nothing}}, Matrix{ReverseDiff.TrackedReal{Float64, Float64, Nothing}}, Matrix{ReverseDiff.TrackedReal{Float64, Float64, Nothing}}, OrdinaryDiffEq.Tsit5ConstantCache{ReverseDiff.TrackedReal{Float64, Float64, Nothing}, Float64}, typeof(OrdinaryDiffEq.trivial_limiter!), typeof(OrdinaryDiffEq.trivial_limiter!), Static.False}, OrdinaryDiffEq.DEOptions{ReverseDiff.TrackedReal{Float64, Float64, Nothing}, ReverseDiff.TrackedReal{Float64, Float64, Nothing}, ReverseDiff.TrackedReal{Float64, Float64, Nothing}, Float64, PIController{Rational{Int64}}, typeof(DiffEqBase.ODE_DEFAULT_NORM), typeof(opnorm), Nothing, CallbackSet{Tuple{}, Tuple{}}, typeof(DiffEqBase.ODE_DEFAULT_ISOUTOFDOMAIN), typeof(DiffEqBase.ODE_DEFAULT_PROG_MESSAGE), typeof(DiffEqBase.ODE_DEFAULT_UNSTABLE_CHECK), DataStructures.BinaryHeap{Float64, DataStructures.FasterForward}, DataStructures.BinaryHeap{Float64, DataStructures.FasterForward}, Nothing, Nothing, Int64, Tuple{}, Float64, Tuple{}}, Matrix{ReverseDiff.TrackedReal{Float64, Float64, Nothing}}, ReverseDiff.TrackedReal{Float64, Float64, Nothing}, Nothing, OrdinaryDiffEq.DefaultInit})
    @ OrdinaryDiffEq C:\Users\Brendan\.julia\packages\OrdinaryDiffEq\vfMzV\src\integrators\integrator_interface.jl:437
  [4] handle_dt!(integrator::OrdinaryDiffEq.ODEIntegrator{Tsit5{typeof(OrdinaryDiffEq.trivial_limiter!), typeof(OrdinaryDiffEq.trivial_limiter!), Static.False}, true, Matrix{ReverseDiff.TrackedReal{Float64, Float64, Nothing}}, Nothing, Float64, Tuple{ReverseDiff.TrackedReal{Float64, Float64, Nothing}, Matrix{Float64}, Matrix{Float64}}, Float64, ReverseDiff.TrackedReal{Float64, Float64, Nothing}, ReverseDiff.TrackedReal{Float64, Float64, Nothing}, Float64, Vector{Matrix{ReverseDiff.TrackedReal{Float64, Float64, Nothing}}}, ODESolution{ReverseDiff.TrackedReal{Float64, Float64, Nothing}, 3, Vector{Matrix{ReverseDiff.TrackedReal{Float64, Float64, Nothing}}}, Nothing, Nothing, Vector{Float64}, Vector{Vector{Matrix{ReverseDiff.TrackedReal{Float64, Float64, Nothing}}}}, ODEProblem{Matrix{ReverseDiff.TrackedReal{Float64, Float64, Nothing}}, Tuple{Float64, Float64}, true, Tuple{ReverseDiff.TrackedReal{Float64, Float64, Nothing}, Matrix{Float64}, Matrix{Float64}}, ODEFunction{true, SciMLBase.FullSpecialize, typeof(fast_react_diffuse!), UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing, Nothing}, Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, SciMLBase.StandardODEProblem}, Tsit5{typeof(OrdinaryDiffEq.trivial_limiter!), typeof(OrdinaryDiffEq.trivial_limiter!), Static.False}, OrdinaryDiffEq.InterpolationData{ODEFunction{true, SciMLBase.FullSpecialize, typeof(fast_react_diffuse!), UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing, Nothing}, Vector{Matrix{ReverseDiff.TrackedReal{Float64, Float64, Nothing}}}, Vector{Float64}, Vector{Vector{Matrix{ReverseDiff.TrackedReal{Float64, Float64, Nothing}}}}, OrdinaryDiffEq.Tsit5Cache{Matrix{ReverseDiff.TrackedReal{Float64, Float64, Nothing}}, Matrix{ReverseDiff.TrackedReal{Float64, Float64, Nothing}}, Matrix{ReverseDiff.TrackedReal{Float64, Float64, Nothing}}, OrdinaryDiffEq.Tsit5ConstantCache{ReverseDiff.TrackedReal{Float64, Float64, Nothing}, Float64}, typeof(OrdinaryDiffEq.trivial_limiter!), typeof(OrdinaryDiffEq.trivial_limiter!), Static.False}}, DiffEqBase.DEStats}, ODEFunction{true, SciMLBase.FullSpecialize, typeof(fast_react_diffuse!), UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing, Nothing}, OrdinaryDiffEq.Tsit5Cache{Matrix{ReverseDiff.TrackedReal{Float64, Float64, Nothing}}, Matrix{ReverseDiff.TrackedReal{Float64, Float64, Nothing}}, Matrix{ReverseDiff.TrackedReal{Float64, Float64, Nothing}}, OrdinaryDiffEq.Tsit5ConstantCache{ReverseDiff.TrackedReal{Float64, Float64, Nothing}, Float64}, typeof(OrdinaryDiffEq.trivial_limiter!), typeof(OrdinaryDiffEq.trivial_limiter!), Static.False}, OrdinaryDiffEq.DEOptions{ReverseDiff.TrackedReal{Float64, Float64, Nothing}, ReverseDiff.TrackedReal{Float64, Float64, Nothing}, ReverseDiff.TrackedReal{Float64, Float64, Nothing}, Float64, PIController{Rational{Int64}}, typeof(DiffEqBase.ODE_DEFAULT_NORM), typeof(opnorm), Nothing, CallbackSet{Tuple{}, Tuple{}}, typeof(DiffEqBase.ODE_DEFAULT_ISOUTOFDOMAIN), typeof(DiffEqBase.ODE_DEFAULT_PROG_MESSAGE), typeof(DiffEqBase.ODE_DEFAULT_UNSTABLE_CHECK), DataStructures.BinaryHeap{Float64, DataStructures.FasterForward}, DataStructures.BinaryHeap{Float64, DataStructures.FasterForward}, Nothing, Nothing, Int64, Tuple{}, Float64, Tuple{}}, Matrix{ReverseDiff.TrackedReal{Float64, Float64, Nothing}}, ReverseDiff.TrackedReal{Float64, Float64, Nothing}, Nothing, OrdinaryDiffEq.DefaultInit})
    @ OrdinaryDiffEq C:\Users\Brendan\.julia\packages\OrdinaryDiffEq\vfMzV\src\solve.jl:541
  [5] __init(prob::ODEProblem{Matrix{ReverseDiff.TrackedReal{Float64, Float64, Nothing}}, Tuple{Float64, Float64}, true, Tuple{ReverseDiff.TrackedReal{Float64, Float64, Nothing}, Matrix{Float64}, Matrix{Float64}}, ODEFunction{true, SciMLBase.FullSpecialize, typeof(fast_react_diffuse!), UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing, Nothing}, Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, SciMLBase.StandardODEProblem}, alg::Tsit5{typeof(OrdinaryDiffEq.trivial_limiter!), typeof(OrdinaryDiffEq.trivial_limiter!), Static.False}, timeseries_init::Tuple{}, ts_init::Tuple{}, ks_init::Tuple{}, recompile::Type{Val{true}}; saveat::Float64, tstops::Tuple{}, d_discontinuities::Tuple{}, save_idxs::Nothing, save_everystep::Bool, save_on::Bool, save_start::Bool, save_end::Nothing, callback::Nothing, dense::Bool, calck::Bool, dt::Float64, dtmin::Nothing, dtmax::Float64, force_dtmin::Bool, adaptive::Bool, gamma::Rational{Int64}, abstol::Nothing, reltol::Nothing, qmin::Rational{Int64}, qmax::Int64, qsteady_min::Int64, qsteady_max::Int64, beta1::Nothing, beta2::Nothing, qoldinit::Rational{Int64}, controller::Nothing, fullnormalize::Bool, failfactor::Int64, maxiters::Int64, internalnorm::typeof(DiffEqBase.ODE_DEFAULT_NORM), internalopnorm::typeof(opnorm), isoutofdomain::typeof(DiffEqBase.ODE_DEFAULT_ISOUTOFDOMAIN), unstable_check::typeof(DiffEqBase.ODE_DEFAULT_UNSTABLE_CHECK), verbose::Bool, timeseries_errors::Bool, dense_errors::Bool, advance_to_tstop::Bool, stop_at_next_tstop::Bool, initialize_save::Bool, progress::Bool, progress_steps::Int64, progress_name::String, progress_message::typeof(DiffEqBase.ODE_DEFAULT_PROG_MESSAGE), userdata::Nothing, allow_extrapolation::Bool, initialize_integrator::Bool, alias_u0::Bool, alias_du0::Bool, initializealg::OrdinaryDiffEq.DefaultInit, kwargs::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
    @ OrdinaryDiffEq C:\Users\Brendan\.julia\packages\OrdinaryDiffEq\vfMzV\src\solve.jl:503
  [6] __solve(::ODEProblem{Matrix{ReverseDiff.TrackedReal{Float64, Float64, Nothing}}, Tuple{Float64, Float64}, true, Tuple{ReverseDiff.TrackedReal{Float64, Float64, Nothing}, Matrix{Float64}, Matrix{Float64}}, ODEFunction{true, SciMLBase.FullSpecialize, typeof(fast_react_diffuse!), UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing, Nothing}, Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, SciMLBase.StandardODEProblem}, ::Tsit5{typeof(OrdinaryDiffEq.trivial_limiter!), typeof(OrdinaryDiffEq.trivial_limiter!), Static.False}; kwargs::Base.Pairs{Symbol, Float64, Tuple{Symbol}, NamedTuple{(:saveat,), Tuple{Float64}}})
    @ OrdinaryDiffEq C:\Users\Brendan\.julia\packages\OrdinaryDiffEq\vfMzV\src\solve.jl:5
  [7] #solve_call#26
    @ C:\Users\Brendan\.julia\packages\DiffEqBase\5rKYk\src\solve.jl:472 [inlined]
  [8] solve_up(prob::ODEProblem{Matrix{Float64}, Tuple{Float64, Float64}, true, Tuple{Float64, Matrix{Float64}, Matrix{Float64}}, ODEFunction{true, SciMLBase.FullSpecialize, typeof(fast_react_diffuse!), UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing, Nothing}, Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, SciMLBase.StandardODEProblem}, sensealg::Nothing, u0::Matrix{ReverseDiff.TrackedReal{Float64, Float64, Nothing}}, p::Tuple{ReverseDiff.TrackedReal{Float64, Float64, Nothing}, Matrix{Float64}, Matrix{Float64}}, args::Tsit5{typeof(OrdinaryDiffEq.trivial_limiter!), typeof(OrdinaryDiffEq.trivial_limiter!), Static.False}; kwargs::Base.Pairs{Symbol, Float64, Tuple{Symbol}, NamedTuple{(:saveat,), Tuple{Float64}}})

First on my reading list for tomorrow! Thank you for the comments and references

predicted = vec(Array(solve(prob, Tsit5(); p=p, u0 = typeof(d).(prob.u0), dt = 0.1, saveat=1.0))[sample_idx])

More errors

julia> sample(ts_extra_simple_model_1, NUTS{Turing.ReverseDiffAD{false}}(), MCMCSerial(), 100, 1; progress=true)
d is 5.948797405578531
sigma is 0.29525776419300476
eltype R, K is Float64Float64
d is 5.948797405578531
sigma is 0.29525776419300476
eltype R, K is Float64Float64
d is TrackedReal<EN5>(5.948797405578531, 0.0, IDo, ---)
sigma is TrackedReal<HIY>(0.29525776419300476, 0.0, IDo, ---)
eltype R, K is Float64Float64
ERROR: ArgumentError: Converting an instance of ReverseDiff.TrackedReal{Float64, Float64, Nothing} to Float32 is not defined. Please use `ReverseDiff.value` instead.
Stacktrace:
  [1] convert(#unused#::Type{Float32}, t::ReverseDiff.TrackedReal{Float64, Float64, Nothing})
    @ ReverseDiff C:\Users\Brendan\.julia\packages\ReverseDiff\GtPeW\src\tracked.jl:261
  [2] fastpow
    @ C:\Users\Brendan\.julia\packages\DiffEqBase\5rKYk\src\fastpow.jl:106 [inlined]
  [3] stepsize_controller!
    @ C:\Users\Brendan\.julia\packages\OrdinaryDiffEq\vfMzV\src\integrators\controllers.jl:133 [inlined]
  [4] stepsize_controller!
    @ C:\Users\Brendan\.julia\packages\OrdinaryDiffEq\vfMzV\src\integrators\controllers.jl:5 [inlined]
  [5] _loopfooter!(integrator::OrdinaryDiffEq.ODEIntegrator{Tsit5{typeof(OrdinaryDiffEq.trivial_limiter!), typeof(OrdinaryDiffEq.trivial_limiter!), Static.False}, true, Matrix{ReverseDiff.TrackedReal{Float64, Float64, Nothing}}, Nothing, Float64, Tuple{ReverseDiff.TrackedReal{Float64, Float64, Nothing}, Matrix{Float64}, Matrix{Float64}}, Float64, ReverseDiff.TrackedReal{Float64, Float64, Nothing}, ReverseDiff.TrackedReal{Float64, Float64, Nothing}, Float64, Vector{Matrix{ReverseDiff.TrackedReal{Float64, Float64, Nothing}}}, ODESolution{ReverseDiff.TrackedReal{Float64, Float64, Nothing}, 3, Vector{Matrix{ReverseDiff.TrackedReal{Float64, Float64, Nothing}}}, Nothing, Nothing, Vector{Float64}, Vector{Vector{Matrix{ReverseDiff.TrackedReal{Float64, Float64, Nothing}}}}, ODEProblem{Matrix{ReverseDiff.TrackedReal{Float64, Float64, Nothing}}, Tuple{Float64, Float64}, true, Tuple{ReverseDiff.TrackedReal{Float64, Float64, Nothing}, Matrix{Float64}, Matrix{Float64}}, ODEFunction{true, SciMLBase.FullSpecialize, typeof(fast_react_diffuse!), UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing, Nothing}, Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, SciMLBase.StandardODEProblem}, Tsit5{typeof(OrdinaryDiffEq.trivial_limiter!), typeof(OrdinaryDiffEq.trivial_limiter!), Static.False}, OrdinaryDiffEq.InterpolationData{ODEFunction{true, SciMLBase.FullSpecialize, typeof(fast_react_diffuse!), UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing, Nothing}, Vector{Matrix{ReverseDiff.TrackedReal{Float64, Float64, Nothing}}}, Vector{Float64}, Vector{Vector{Matrix{ReverseDiff.TrackedReal{Float64, Float64, Nothing}}}}, OrdinaryDiffEq.Tsit5Cache{Matrix{ReverseDiff.TrackedReal{Float64, Float64, Nothing}}, Matrix{ReverseDiff.TrackedReal{Float64, Float64, Nothing}}, Matrix{ReverseDiff.TrackedReal{Float64, Float64, Nothing}}, OrdinaryDiffEq.Tsit5ConstantCache{ReverseDiff.TrackedReal{Float64, Float64, Nothing}, Float64}, typeof(OrdinaryDiffEq.trivial_limiter!), typeof(OrdinaryDiffEq.trivial_limiter!), Static.False}}, DiffEqBase.DEStats}, ODEFunction{true, SciMLBase.FullSpecialize, typeof(fast_react_diffuse!), UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing, Nothing}, OrdinaryDiffEq.Tsit5Cache{Matrix{ReverseDiff.TrackedReal{Float64, Float64, Nothing}}, Matrix{ReverseDiff.TrackedReal{Float64, Float64, Nothing}}, Matrix{ReverseDiff.TrackedReal{Float64, Float64, Nothing}}, OrdinaryDiffEq.Tsit5ConstantCache{ReverseDiff.TrackedReal{Float64, Float64, Nothing}, Float64}, typeof(OrdinaryDiffEq.trivial_limiter!), typeof(OrdinaryDiffEq.trivial_limiter!), Static.False}, OrdinaryDiffEq.DEOptions{ReverseDiff.TrackedReal{Float64, Float64, Nothing}, ReverseDiff.TrackedReal{Float64, Float64, Nothing}, ReverseDiff.TrackedReal{Float64, Float64, Nothing}, Float64, PIController{Rational{Int64}}, typeof(DiffEqBase.ODE_DEFAULT_NORM), typeof(opnorm), Nothing, CallbackSet{Tuple{}, Tuple{}}, typeof(DiffEqBase.ODE_DEFAULT_ISOUTOFDOMAIN), typeof(DiffEqBase.ODE_DEFAULT_PROG_MESSAGE), typeof(DiffEqBase.ODE_DEFAULT_UNSTABLE_CHECK), DataStructures.BinaryHeap{Float64, DataStructures.FasterForward}, DataStructures.BinaryHeap{Float64, DataStructures.FasterForward}, Nothing, Nothing, Int64, Tuple{}, Float64, Tuple{}}, Matrix{ReverseDiff.TrackedReal{Float64, Float64, Nothing}}, ReverseDiff.TrackedReal{Float64, Float64, Nothing}, Nothing, OrdinaryDiffEq.DefaultInit})
    @ OrdinaryDiffEq C:\Users\Brendan\.julia\packages\OrdinaryDiffEq\vfMzV\src\integrators\integrator_utils.jl:216
  [6] loopfooter!
    @ C:\Users\Brendan\.julia\packages\OrdinaryDiffEq\vfMzV\src\integrators\integrator_utils.jl:197 [inlined]
  [7] solve!(integrator::OrdinaryDiffEq.ODEIntegrator{Tsit5{typeof(OrdinaryDiffEq.trivial_limiter!), typeof(OrdinaryDiffEq.trivial_limiter!), Static.False}, true, Matrix{ReverseDiff.TrackedReal{Float64, Float64, Nothing}}, Nothing, Float64, Tuple{ReverseDiff.TrackedReal{Float64, Float64, Nothing}, Matrix{Float64}, Matrix{Float64}}, Float64, ReverseDiff.TrackedReal{Float64, Float64, Nothing}, ReverseDiff.TrackedReal{Float64, Float64, Nothing}, Float64, Vector{Matrix{ReverseDiff.TrackedReal{Float64, Float64, Nothing}}}, ODESolution{ReverseDiff.TrackedReal{Float64, Float64, Nothing}, 3, Vector{Matrix{ReverseDiff.TrackedReal{Float64, Float64, Nothing}}}, Nothing, Nothing, Vector{Float64}, Vector{Vector{Matrix{ReverseDiff.TrackedReal{Float64, Float64, Nothing}}}}, ODEProblem{Matrix{ReverseDiff.TrackedReal{Float64, Float64, Nothing}}, Tuple{Float64, Float64}, true, Tuple{ReverseDiff.TrackedReal{Float64, Float64, Nothing}, Matrix{Float64}, Matrix{Float64}}, ODEFunction{true, SciMLBase.FullSpecialize, typeof(fast_react_diffuse!), UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing, Nothing}, Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, SciMLBase.StandardODEProblem}, Tsit5{typeof(OrdinaryDiffEq.trivial_limiter!), typeof(OrdinaryDiffEq.trivial_limiter!), Static.False}, OrdinaryDiffEq.InterpolationData{ODEFunction{true, SciMLBase.FullSpecialize, typeof(fast_react_diffuse!), UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing, Nothing}, Vector{Matrix{ReverseDiff.TrackedReal{Float64, Float64, Nothing}}}, Vector{Float64}, Vector{Vector{Matrix{ReverseDiff.TrackedReal{Float64, Float64, Nothing}}}}, OrdinaryDiffEq.Tsit5Cache{Matrix{ReverseDiff.TrackedReal{Float64, Float64, Nothing}}, Matrix{ReverseDiff.TrackedReal{Float64, Float64, Nothing}}, Matrix{ReverseDiff.TrackedReal{Float64, Float64, Nothing}}, OrdinaryDiffEq.Tsit5ConstantCache{ReverseDiff.TrackedReal{Float64, Float64, Nothing}, Float64}, typeof(OrdinaryDiffEq.trivial_limiter!), typeof(OrdinaryDiffEq.trivial_limiter!), Static.False}}, DiffEqBase.DEStats}, ODEFunction{true, SciMLBase.FullSpecialize, typeof(fast_react_diffuse!), UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing, Nothing}, OrdinaryDiffEq.Tsit5Cache{Matrix{ReverseDiff.TrackedReal{Float64, Float64, Nothing}}, Matrix{ReverseDiff.TrackedReal{Float64, Float64, Nothing}}, Matrix{ReverseDiff.TrackedReal{Float64, Float64, Nothing}}, OrdinaryDiffEq.Tsit5ConstantCache{ReverseDiff.TrackedReal{Float64, Float64, Nothing}, Float64}, typeof(OrdinaryDiffEq.trivial_limiter!), typeof(OrdinaryDiffEq.trivial_limiter!), Static.False}, OrdinaryDiffEq.DEOptions{ReverseDiff.TrackedReal{Float64, Float64, Nothing}, ReverseDiff.TrackedReal{Float64, Float64, Nothing}, ReverseDiff.TrackedReal{Float64, Float64, Nothing}, Float64, PIController{Rational{Int64}}, typeof(DiffEqBase.ODE_DEFAULT_NORM), typeof(opnorm), Nothing, CallbackSet{Tuple{}, Tuple{}}, typeof(DiffEqBase.ODE_DEFAULT_ISOUTOFDOMAIN), typeof(DiffEqBase.ODE_DEFAULT_PROG_MESSAGE), typeof(DiffEqBase.ODE_DEFAULT_UNSTABLE_CHECK), DataStructures.BinaryHeap{Float64, DataStructures.FasterForward}, DataStructures.BinaryHeap{Float64, DataStructures.FasterForward}, Nothing, Nothing, Int64, Tuple{}, Float64, Tuple{}}, Matrix{ReverseDiff.TrackedReal{Float64, Float64, Nothing}}, ReverseDiff.TrackedReal{Float64, Float64, Nothing}, Nothing, OrdinaryDiffEq.DefaultInit})
    @ OrdinaryDiffEq C:\Users\Brendan\.julia\packages\OrdinaryDiffEq\vfMzV\src\solve.jl:515
  [8] __solve(::ODEProblem{Matrix{ReverseDiff.TrackedReal{Float64, Float64, Nothing}}, Tuple{Float64, Float64}, true, Tuple{ReverseDiff.TrackedReal{Float64, Float64, Nothing}, Matrix{Float64}, Matrix{Float64}}, ODEFunction{true, SciMLBase.FullSpecialize, typeof(fast_react_diffuse!), UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing, Nothing}, Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, SciMLBase.StandardODEProblem}, ::Tsit5{typeof(OrdinaryDiffEq.trivial_limiter!), typeof(OrdinaryDiffEq.trivial_limiter!), Static.False}; kwargs::Base.Pairs{Symbol, Float64, Tuple{Symbol, Symbol}, NamedTuple{(:dt, :saveat), Tuple{Float64, Float64}}})
    @ OrdinaryDiffEq C:\Users\Brendan\.julia\packages\OrdinaryDiffEq\vfMzV\src\solve.jl:6
  [9] #solve_call#26
    @ C:\Users\Brendan\.julia\packages\DiffEqBase\5rKYk\src\solve.jl:472 [inlined]
 [10] solve_up(prob::ODEProblem{Matrix{Float64}, Tuple{Float64, Float64}, true, Tuple{Float64, Matrix{Float64}, Matrix{Float64}}, ODEFunction{true, SciMLBase.FullSpecialize, typeof(fast_react_diffuse!), UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing, Nothing}, Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, SciMLBase.StandardODEProblem}, sensealg::Nothing, u0::Matrix{ReverseDiff.TrackedReal{Float64, Float64, Nothing}}, p::Tuple{ReverseDiff.TrackedReal{Float64, Float64, Nothing}, Matrix{Float64}, Matrix{Float64}}, args::Tsit5{typeof(OrdinaryDiffEq.trivial_limiter!), typeof(OrdinaryDiffEq.trivial_limiter!), Static.False}; kwargs::Base.Pairs{Symbol, Float64, Tuple{Symbol, Symbol}, NamedTuple{(:dt, :saveat), Tuple{Float64, Float64}}})

I doubt there’s anything relevant in it since we updated ReverseDiff, but just in case, here is my current environment:

versioninfo()
Julia Version 1.8.2
Commit 36034abf26 (2022-09-29 15:21 UTC)
Platform Info:
  OS: Windows (x86_64-w64-mingw32)
  CPU: 16 × 12th Gen Intel(R) Core(TM) i5-12600K
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-13.0.1 (ORCJIT, goldmont)
  Threads: 1 on 16 virtual cores
Environment:
  JULIA_EDITOR = code
  JULIA_NUM_THREADS =

  [fbb218c0] BSON v0.3.5
  [6e4b80f9] BenchmarkTools v1.3.1
  [336ed68f] CSV v0.10.4
⌃ [a93c6f00] DataFrames v1.3.6
  [aae7a2af] DiffEqFlux v1.52.0
  [41bf760c] DiffEqSensitivity v6.79.0
  [0c46a032] DifferentialEquations v7.5.0
  [31c24e10] Distributions v0.25.75
  [587475ba] Flux v0.13.6
  [7f56f5a3] LSODA v0.7.0
  [2ab3a3ac] LogExpFunctions v0.3.18
  [429524aa] Optim v1.7.3
  [1dea7af3] OrdinaryDiffEq v6.28.0
  [91a5bcdd] Plots v1.35.2
  [d330b81b] PyPlot v2.11.0
  [37e2e3b7] ReverseDiff v1.14.3
  [1ed8b502] SciMLSensitivity v7.10.0
  [f3b207a7] StatsPlots v0.15.3
  [c3572dad] Sundials v4.10.1
  [0c5d862f] Symbolics v4.10.4
  [fce5fe82] Turing v0.21.12
  [e88e6eb3] Zygote v0.6.49
  [37e2e46d] LinearAlgebra
  [9a3f8284] Random

Oh I think I see what’s going on here. Add a using SciMLSensitivity

@breallis Once you get your code to run, you should confirm that your discretization is good enough to be able to sample from the “true” posterior.

That’s annoying. I had that statement before and somehow lost it on the way. Sorry for that.

On its own, I still get errors, but combined with your other amendment converting u0 to typeof(d) the code can run in reversediff mode for the first time. However, it almost immediately stalls. To be sure it didn’t just need time to explore, I left it running overnight, and when I came back it was still at 0% in the sampler in the morning on both my laptop and desktop. This is on the version of the code with a beta prior that now samples quickly and reliably* every time in forwarddiff mode.

Note that before, I would’ve gotten an error immediately after seeing the first TrackedReal, but here it sees a few and then hangs silently

sample(ts_extra_simple_model_1, NUTS{Turing.TrackerAD}(0.65), MCMCSerial(), 100, 1; progress=false)
d is 1.2984703703942713
sigma is 5.631177599473387
eltype R, K is Float64Float64
d is 1.2984703703942713
sigma is 5.631177599473387
eltype R, K is Float64Float64
d is 1.2984703703942713 (tracked)
sigma is 5.631177599473387 (tracked)
eltype R, K is Float64Float64
d is 1.2984703703942713 (tracked)
sigma is 5.631177599473387 (tracked)
eltype R, K is Float64Float64
d is 1.646018248703005 (tracked)
sigma is 0.014704213388652404 (tracked)
eltype R, K is Float64Float64
d is 1.646018248703005 (tracked)
sigma is 0.014704213388652404 (tracked)
eltype R, K is Float64Float64
d is 1.350271089060876 (tracked)^C

I don’t know if this tells us anything, but here is the stacktrace after I interrupted it in the morning.

sigma is ERROR: InterruptException:
Stacktrace:
  [1] try_yieldto(undo::typeof(Base.ensure_rescheduled))
    @ Base .\task.jl:871
  [2] wait()
    @ Base .\task.jl:931
  [3] uv_write(s::Base.TTY, p::Ptr{UInt8}, n::UInt64)
    @ Base .\stream.jl:1046
  [4] unsafe_write(s::Base.TTY, p::Ptr{UInt8}, n::UInt64)
    @ Base .\stream.jl:1118
  [5] write
    @ .\strings\io.jl:244 [inlined]
  [6] print(io::Base.TTY, s::String)
    @ Base .\strings\io.jl:246
  [7] print(::Base.TTY, ::String, ::Tracker.TrackedReal{Float64}, ::Vararg{Any})
    @ Base .\strings\io.jl:46
  [8] println(::Base.TTY, ::String, ::Vararg{Any})
    @ Base .\strings\io.jl:75
  [9] println(::String, ::Tracker.TrackedReal{Float64})
    @ Base .\coreio.jl:4
 [10] extra_simple_troubleshootfitlv(__model__::DynamicPPL.Model{typeof(extra_simple_troubleshootfitlv), (:covariates, :response, :Nr, :Nc, :sample_idx, :prob), (), (), Tuple{Tuple{Matrix{Float64}, Matrix{Float64}}, Vector{Float64}, Int64, Int64, CartesianIndices{3, Tuple{StepRange{Int64, Int64}, StepRange{Int64, Int64}, UnitRange{Int64}}}, ODEProblem{Matrix{Float64}, Tuple{Float64, Float64}, true, Tuple{Float64, Matrix{Float64}, Matrix{Float64}, Int64, Int64}, ODEFunction{true, SciMLBase.FullSpecialize, typeof(fast_react_diffuse!), UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing, Nothing}, Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, SciMLBase.StandardODEProblem}}, Tuple{}, DynamicPPL.DefaultContext}, __varinfo__::DynamicPPL.TypedVarInfo{NamedTuple{(:d, :sigma), Tuple{DynamicPPL.Metadata{Dict{AbstractPPL.VarName{:d, Setfield.IdentityLens}, Int64}, Vector{Beta{Float64}}, Vector{AbstractPPL.VarName{:d, Setfield.IdentityLens}}, TrackedArray{…,Vector{Float64}}, Vector{Set{DynamicPPL.Selector}}}, DynamicPPL.Metadata{Dict{AbstractPPL.VarName{:sigma, Setfield.IdentityLens}, Int64}, Vector{InverseGamma{Float64}}, Vector{AbstractPPL.VarName{:sigma, Setfield.IdentityLens}}, TrackedArray{…,Vector{Float64}}, Vector{Set{DynamicPPL.Selector}}}}}, Tracker.TrackedReal{Float64}}, __context__::DynamicPPL.SamplingContext{DynamicPPL.Sampler{NUTS{Turing.Essential.TrackerAD, (), AdvancedHMC.DiagEuclideanMetric}}, DynamicPPL.DefaultContext, Random._GLOBAL_RNG}, covariates::Tuple{Matrix{Float64}, Matrix{Float64}}, response::Vector{Float64}, Nr::Int64, Nc::Int64, sample_idx::CartesianIndices{3, Tuple{StepRange{Int64, Int64}, StepRange{Int64, Int64}, UnitRange{Int64}}}, prob::ODEProblem{Matrix{Float64}, Tuple{Float64, Float64}, true, Tuple{Float64, Matrix{Float64}, Matrix{Float64}, Int64, Int64}, ODEFunction{true, SciMLBase.FullSpecialize, typeof(fast_react_diffuse!), UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing, Nothing}, Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, SciMLBase.StandardODEProblem})
    @ Main .\REPL[29]:7
 [11] macro expansion
    @ C:\Users\brend\.julia\packages\DynamicPPL\zPOYL\src\model.jl:593 [inlined]
 [12] _evaluate!!
    @ C:\Users\brend\.julia\packages\DynamicPPL\zPOYL\src\model.jl:576 [inlined]
 [13] evaluate_threadunsafe!!
    @ C:\Users\brend\.julia\packages\DynamicPPL\zPOYL\src\model.jl:551 [inlined]
 [14] evaluate!!
    @ C:\Users\brend\.julia\packages\DynamicPPL\zPOYL\src\model.jl:504 [inlined]
 [15] evaluate!!
    @ C:\Users\brend\.julia\packages\DynamicPPL\zPOYL\src\model.jl:515 [inlined]
 [16] evaluate!!
    @ C:\Users\brend\.julia\packages\DynamicPPL\zPOYL\src\model.jl:523 [inlined]
 [17] LogDensityFunction
    @ C:\Users\brend\.julia\packages\Turing\szPqN\src\Turing.jl:38 [inlined]
 [18] logdensity
    @ C:\Users\brend\.julia\packages\Turing\szPqN\src\Turing.jl:42 [inlined]
 [19] #48
    @ C:\Users\brend\.julia\packages\LogDensityProblems\oAYeE\src\AD_Tracker.jl:25 [inlined]
 [20] #593
    @ C:\Users\brend\.julia\packages\Tracker\a9oj5\src\back.jl:148 [inlined]
 [21] forward(f::Tracker.var"#593#595"{LogDensityProblems.var"#48#49"{Turing.LogDensityFunction{DynamicPPL.TypedVarInfo{NamedTuple{(:d, :sigma), Tuple{DynamicPPL.Metadata{Dict{AbstractPPL.VarName{:d, Setfield.IdentityLens}, Int64}, Vector{Beta{Float64}}, Vector{AbstractPPL.VarName{:d, Setfield.IdentityLens}}, Vector{Float64}, Vector{Set{DynamicPPL.Selector}}}, DynamicPPL.Metadata{Dict{AbstractPPL.VarName{:sigma, Setfield.IdentityLens}, Int64}, Vector{InverseGamma{Float64}}, Vector{AbstractPPL.VarName{:sigma, Setfield.IdentityLens}}, Vector{Float64}, Vector{Set{DynamicPPL.Selector}}}}}, Float64}, DynamicPPL.Model{typeof(extra_simple_troubleshootfitlv), (:covariates, :response, :Nr, :Nc, :sample_idx, :prob), (), (), Tuple{Tuple{Matrix{Float64}, Matrix{Float64}}, Vector{Float64}, Int64, Int64, CartesianIndices{3, Tuple{StepRange{Int64, Int64}, StepRange{Int64, Int64}, UnitRange{Int64}}}, ODEProblem{Matrix{Float64}, Tuple{Float64, Float64}, true, Tuple{Float64, Matrix{Float64}, Matrix{Float64}, Int64, Int64}, ODEFunction{true, SciMLBase.FullSpecialize, typeof(fast_react_diffuse!), UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing, Nothing}, Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, SciMLBase.StandardODEProblem}}, Tuple{}, DynamicPPL.DefaultContext}, DynamicPPL.Sampler{NUTS{Turing.Essential.TrackerAD, (), AdvancedHMC.DiagEuclideanMetric}}, DynamicPPL.DefaultContext}}, Tuple{TrackedArray{…,Vector{Float64}}}}, ps::Tracker.Params)
    @ Tracker C:\Users\brend\.julia\packages\Tracker\a9oj5\src\back.jl:135
 [22] forward(f::Function, args::Vector{Float64})
    @ Tracker C:\Users\brend\.julia\packages\Tracker\a9oj5\src\back.jl:148
 [23] logdensity_and_gradient(∇ℓ::LogDensityProblems.TrackerGradientLogDensity{Turing.LogDensityFunction{DynamicPPL.TypedVarInfo{NamedTuple{(:d, :sigma), Tuple{DynamicPPL.Metadata{Dict{AbstractPPL.VarName{:d, Setfield.IdentityLens}, Int64}, Vector{Beta{Float64}}, Vector{AbstractPPL.VarName{:d, Setfield.IdentityLens}}, Vector{Float64}, Vector{Set{DynamicPPL.Selector}}}, DynamicPPL.Metadata{Dict{AbstractPPL.VarName{:sigma, Setfield.IdentityLens}, Int64}, Vector{InverseGamma{Float64}}, Vector{AbstractPPL.VarName{:sigma, Setfield.IdentityLens}}, Vector{Float64}, Vector{Set{DynamicPPL.Selector}}}}}, Float64}, DynamicPPL.Model{typeof(extra_simple_troubleshootfitlv), (:covariates, :response, :Nr, :Nc, :sample_idx, :prob), (), (), Tuple{Tuple{Matrix{Float64}, Matrix{Float64}}, Vector{Float64}, Int64, Int64, CartesianIndices{3, Tuple{StepRange{Int64, Int64}, StepRange{Int64, Int64}, UnitRange{Int64}}}, ODEProblem{Matrix{Float64}, Tuple{Float64, Float64}, true, Tuple{Float64, Matrix{Float64}, Matrix{Float64}, Int64, Int64}, ODEFunction{true, SciMLBase.FullSpecialize, typeof(fast_react_diffuse!), UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing, Nothing}, Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, SciMLBase.StandardODEProblem}}, Tuple{}, DynamicPPL.DefaultContext}, DynamicPPL.Sampler{NUTS{Turing.Essential.TrackerAD, (), AdvancedHMC.DiagEuclideanMetric}}, DynamicPPL.DefaultContext}}, x::Vector{Float64})
    @ LogDensityProblems C:\Users\brend\.julia\packages\LogDensityProblems\oAYeE\src\AD_Tracker.jl:25
 [24] ∂logπ∂θ
    @ C:\Users\brend\.julia\packages\Turing\szPqN\src\inference\hmc.jl:166 [inlined]
 [25] ∂H∂θ
    @ C:\Users\brend\.julia\packages\AdvancedHMC\iWHPQ\src\hamiltonian.jl:31 [inlined]
 [26] macro expansion
    @ C:\Users\brend\.julia\packages\UnPack\EkESO\src\UnPack.jl:100 [inlined]
 [27] step(lf::AdvancedHMC.Leapfrog{Float64}, h::AdvancedHMC.Hamiltonian{AdvancedHMC.DiagEuclideanMetric{Float64, Vector{Float64}}, Base.Fix1{typeof(LogDensityProblems.logdensity), LogDensityProblems.TrackerGradientLogDensity{Turing.LogDensityFunction{DynamicPPL.TypedVarInfo{NamedTuple{(:d, :sigma), Tuple{DynamicPPL.Metadata{Dict{AbstractPPL.VarName{:d, Setfield.IdentityLens}, Int64}, Vector{Beta{Float64}}, Vector{AbstractPPL.VarName{:d, Setfield.IdentityLens}}, Vector{Float64}, Vector{Set{DynamicPPL.Selector}}}, DynamicPPL.Metadata{Dict{AbstractPPL.VarName{:sigma, Setfield.IdentityLens}, Int64}, Vector{InverseGamma{Float64}}, Vector{AbstractPPL.VarName{:sigma, Setfield.IdentityLens}}, Vector{Float64}, Vector{Set{DynamicPPL.Selector}}}}}, Float64}, DynamicPPL.Model{typeof(extra_simple_troubleshootfitlv), (:covariates, :response, :Nr, :Nc, :sample_idx, :prob), (), (), Tuple{Tuple{Matrix{Float64}, Matrix{Float64}}, Vector{Float64}, Int64, Int64, CartesianIndices{3, Tuple{StepRange{Int64, Int64}, StepRange{Int64, Int64}, UnitRange{Int64}}}, ODEProblem{Matrix{Float64}, Tuple{Float64, Float64}, true, Tuple{Float64, Matrix{Float64}, Matrix{Float64}, Int64, Int64}, ODEFunction{true, SciMLBase.FullSpecialize, typeof(fast_react_diffuse!), UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing, Nothing}, Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, SciMLBase.StandardODEProblem}}, Tuple{}, DynamicPPL.DefaultContext}, DynamicPPL.Sampler{NUTS{Turing.Essential.TrackerAD, (), AdvancedHMC.DiagEuclideanMetric}}, DynamicPPL.DefaultContext}}}, Turing.Inference.var"#∂logπ∂θ#44"{LogDensityProblems.TrackerGradientLogDensity{Turing.LogDensityFunction{DynamicPPL.TypedVarInfo{NamedTuple{(:d, :sigma), Tuple{DynamicPPL.Metadata{Dict{AbstractPPL.VarName{:d, Setfield.IdentityLens}, Int64}, Vector{Beta{Float64}}, Vector{AbstractPPL.VarName{:d, Setfield.IdentityLens}}, Vector{Float64}, Vector{Set{DynamicPPL.Selector}}}, DynamicPPL.Metadata{Dict{AbstractPPL.VarName{:sigma, Setfield.IdentityLens}, Int64}, Vector{InverseGamma{Float64}}, Vector{AbstractPPL.VarName{:sigma, Setfield.IdentityLens}}, Vector{Float64}, Vector{Set{DynamicPPL.Selector}}}}}, Float64}, DynamicPPL.Model{typeof(extra_simple_troubleshootfitlv), (:covariates, :response, :Nr, :Nc, :sample_idx, :prob), (), (), Tuple{Tuple{Matrix{Float64}, Matrix{Float64}}, Vector{Float64}, Int64, Int64, CartesianIndices{3, Tuple{StepRange{Int64, Int64}, StepRange{Int64, Int64}, UnitRange{Int64}}}, ODEProblem{Matrix{Float64}, Tuple{Float64, Float64}, true, Tuple{Float64, Matrix{Float64}, Matrix{Float64}, Int64, Int64}, ODEFunction{true, SciMLBase.FullSpecialize, typeof(fast_react_diffuse!), UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing, Nothing}, Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, SciMLBase.StandardODEProblem}}, Tuple{}, DynamicPPL.DefaultContext}, DynamicPPL.Sampler{NUTS{Turing.Essential.TrackerAD, (), AdvancedHMC.DiagEuclideanMetric}}, DynamicPPL.DefaultContext}}}}, z::AdvancedHMC.PhasePoint{Vector{Float64}, AdvancedHMC.DualValue{Float64, Vector{Float64}}}, n_steps::Int64; fwd::Bool, full_trajectory::Val{false})
    @ AdvancedHMC C:\Users\brend\.julia\packages\AdvancedHMC\iWHPQ\src\integrator.jl:88
 [28] step (repeats 2 times)
    @ C:\Users\brend\.julia\packages\AdvancedHMC\iWHPQ\src\integrator.jl:58 [inlined]
 [29] A
    @ C:\Users\brend\.julia\packages\AdvancedHMC\iWHPQ\src\trajectory.jl:692 [inlined]
 [30] find_good_stepsize(rng::Random._GLOBAL_RNG, h::AdvancedHMC.Hamiltonian{AdvancedHMC.DiagEuclideanMetric{Float64, Vector{Float64}}, Base.Fix1{typeof(LogDensityProblems.logdensity), LogDensityProblems.TrackerGradientLogDensity{Turing.LogDensityFunction{DynamicPPL.TypedVarInfo{NamedTuple{(:d, :sigma), Tuple{DynamicPPL.Metadata{Dict{AbstractPPL.VarName{:d, Setfield.IdentityLens}, Int64}, Vector{Beta{Float64}}, Vector{AbstractPPL.VarName{:d, Setfield.IdentityLens}}, Vector{Float64}, Vector{Set{DynamicPPL.Selector}}}, DynamicPPL.Metadata{Dict{AbstractPPL.VarName{:sigma, Setfield.IdentityLens}, Int64}, Vector{InverseGamma{Float64}}, Vector{AbstractPPL.VarName{:sigma, Setfield.IdentityLens}}, Vector{Float64}, Vector{Set{DynamicPPL.Selector}}}}}, Float64}, DynamicPPL.Model{typeof(extra_simple_troubleshootfitlv), (:covariates, :response, :Nr, :Nc, :sample_idx, :prob), (), (), Tuple{Tuple{Matrix{Float64}, Matrix{Float64}}, Vector{Float64}, Int64, Int64, CartesianIndices{3, Tuple{StepRange{Int64, Int64}, StepRange{Int64, Int64}, UnitRange{Int64}}}, ODEProblem{Matrix{Float64}, Tuple{Float64, Float64}, true, Tuple{Float64, Matrix{Float64}, Matrix{Float64}, Int64, Int64}, ODEFunction{true, SciMLBase.FullSpecialize, typeof(fast_react_diffuse!), UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing, Nothing}, Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, SciMLBase.StandardODEProblem}}, Tuple{}, DynamicPPL.DefaultContext}, DynamicPPL.Sampler{NUTS{Turing.Essential.TrackerAD, (), AdvancedHMC.DiagEuclideanMetric}}, DynamicPPL.DefaultContext}}}, Turing.Inference.var"#∂logπ∂θ#44"{LogDensityProblems.TrackerGradientLogDensity{Turing.LogDensityFunction{DynamicPPL.TypedVarInfo{NamedTuple{(:d, :sigma), Tuple{DynamicPPL.Metadata{Dict{AbstractPPL.VarName{:d, Setfield.IdentityLens}, Int64}, Vector{Beta{Float64}}, Vector{AbstractPPL.VarName{:d, Setfield.IdentityLens}}, Vector{Float64}, Vector{Set{DynamicPPL.Selector}}}, DynamicPPL.Metadata{Dict{AbstractPPL.VarName{:sigma, Setfield.IdentityLens}, Int64}, Vector{InverseGamma{Float64}}, Vector{AbstractPPL.VarName{:sigma, Setfield.IdentityLens}}, Vector{Float64}, Vector{Set{DynamicPPL.Selector}}}}}, Float64}, DynamicPPL.Model{typeof(extra_simple_troubleshootfitlv), (:covariates, :response, :Nr, :Nc, :sample_idx, :prob), (), (), Tuple{Tuple{Matrix{Float64}, Matrix{Float64}}, Vector{Float64}, Int64, Int64, CartesianIndices{3, Tuple{StepRange{Int64, Int64}, StepRange{Int64, Int64}, UnitRange{Int64}}}, ODEProblem{Matrix{Float64}, Tuple{Float64, Float64}, true, Tuple{Float64, Matrix{Float64}, Matrix{Float64}, Int64, Int64}, ODEFunction{true, SciMLBase.FullSpecialize, typeof(fast_react_diffuse!), UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing, Nothing}, Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, SciMLBase.StandardODEProblem}}, Tuple{}, DynamicPPL.DefaultContext}, DynamicPPL.Sampler{NUTS{Turing.Essential.TrackerAD, (), AdvancedHMC.DiagEuclideanMetric}}, DynamicPPL.DefaultContext}}}}, θ::Vector{Float64}; max_n_iters::Int64)      
    @ AdvancedHMC C:\Users\brend\.julia\packages\AdvancedHMC\iWHPQ\src\trajectory.jl:725
 [31] #find_good_stepsize#19
    @ C:\Users\brend\.julia\packages\AdvancedHMC\iWHPQ\src\trajectory.jl:770 [inlined]
 [32] find_good_stepsize
    @ C:\Users\brend\.julia\packages\AdvancedHMC\iWHPQ\src\trajectory.jl:765 [inlined]
 [33] initialstep(rng::Random._GLOBAL_RNG, model::DynamicPPL.Model{typeof(extra_simple_troubleshootfitlv), (:covariates, :response, :Nr, :Nc, :sample_idx, :prob), (), (), Tuple{Tuple{Matrix{Float64}, Matrix{Float64}}, Vector{Float64}, Int64, Int64, CartesianIndices{3, Tuple{StepRange{Int64, Int64}, StepRange{Int64, Int64}, UnitRange{Int64}}}, ODEProblem{Matrix{Float64}, Tuple{Float64, Float64}, true, Tuple{Float64, Matrix{Float64}, Matrix{Float64}, Int64, Int64}, ODEFunction{true, SciMLBase.FullSpecialize, typeof(fast_react_diffuse!), UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing, Nothing}, Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, SciMLBase.StandardODEProblem}}, Tuple{}, DynamicPPL.DefaultContext}, spl::DynamicPPL.Sampler{NUTS{Turing.Essential.TrackerAD, (), AdvancedHMC.DiagEuclideanMetric}}, vi::DynamicPPL.TypedVarInfo{NamedTuple{(:d, :sigma), Tuple{DynamicPPL.Metadata{Dict{AbstractPPL.VarName{:d, Setfield.IdentityLens}, Int64}, Vector{Beta{Float64}}, Vector{AbstractPPL.VarName{:d, Setfield.IdentityLens}}, Vector{Float64}, Vector{Set{DynamicPPL.Selector}}}, DynamicPPL.Metadata{Dict{AbstractPPL.VarName{:sigma, Setfield.IdentityLens}, Int64}, Vector{InverseGamma{Float64}}, Vector{AbstractPPL.VarName{:sigma, Setfield.IdentityLens}}, Vector{Float64}, Vector{Set{DynamicPPL.Selector}}}}}, Float64}; init_params::Nothing, nadapts::Int64, kwargs::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
    @ Turing.Inference C:\Users\brend\.julia\packages\Turing\szPqN\src\inference\hmc.jl:190
 [34] step(rng::Random._GLOBAL_RNG, model::DynamicPPL.Model{typeof(extra_simple_troubleshootfitlv), (:covariates, :response, :Nr, :Nc, :sample_idx, :prob), (), (), Tuple{Tuple{Matrix{Float64}, Matrix{Float64}}, Vector{Float64}, Int64, Int64, CartesianIndices{3, Tuple{StepRange{Int64, Int64}, StepRange{Int64, Int64}, UnitRange{Int64}}}, ODEProblem{Matrix{Float64}, Tuple{Float64, Float64}, true, Tuple{Float64, Matrix{Float64}, Matrix{Float64}, Int64, Int64}, ODEFunction{true, SciMLBase.FullSpecialize, typeof(fast_react_diffuse!), UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing, Nothing}, Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, SciMLBase.StandardODEProblem}}, Tuple{}, DynamicPPL.DefaultContext}, spl::DynamicPPL.Sampler{NUTS{Turing.Essential.TrackerAD, (), AdvancedHMC.DiagEuclideanMetric}}; resume_from::Nothing, init_params::Nothing, kwargs::Base.Pairs{Symbol, Int64, Tuple{Symbol}, NamedTuple{(:nadapts,), Tuple{Int64}}})
    @ DynamicPPL C:\Users\brend\.julia\packages\DynamicPPL\zPOYL\src\sampler.jl:104
 [35] macro expansion
    @ C:\Users\brend\.julia\packages\AbstractMCMC\fnRmh\src\sample.jl:120 [inlined]
 [36] macro expansion
    @ C:\Users\brend\.julia\packages\AbstractMCMC\fnRmh\src\logging.jl:16 [inlined]
 [37] mcmcsample(rng::Random._GLOBAL_RNG, model::DynamicPPL.Model{typeof(extra_simple_troubleshootfitlv), (:covariates, :response, :Nr, :Nc, :sample_idx, :prob), (), (), Tuple{Tuple{Matrix{Float64}, Matrix{Float64}}, Vector{Float64}, Int64, Int64, CartesianIndices{3, Tuple{StepRange{Int64, Int64}, StepRange{Int64, Int64}, UnitRange{Int64}}}, ODEProblem{Matrix{Float64}, Tuple{Float64, Float64}, true, Tuple{Float64, Matrix{Float64}, Matrix{Float64}, Int64, Int64}, ODEFunction{true, SciMLBase.FullSpecialize, typeof(fast_react_diffuse!), UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing, Nothing}, Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, SciMLBase.StandardODEProblem}}, Tuple{}, DynamicPPL.DefaultContext}, sampler::DynamicPPL.Sampler{NUTS{Turing.Essential.TrackerAD, (), AdvancedHMC.DiagEuclideanMetric}}, N::Int64; progress::Bool, progressname::String, callback::Nothing, discard_initial::Int64, thinning::Int64, chain_type::Type, kwargs::Base.Pairs{Symbol, Union{Nothing, Int64}, Tuple{Symbol, Symbol}, NamedTuple{(:nadapts, :init_params), Tuple{Int64, Nothing}}})
    @ AbstractMCMC C:\Users\brend\.julia\packages\AbstractMCMC\fnRmh\src\sample.jl:111
 [38] #sample#42
    @ C:\Users\brend\.julia\packages\Turing\szPqN\src\inference\hmc.jl:133 [inlined]
 [39] (::AbstractMCMC.var"#sample_chain#78"{String, Base.Pairs{Symbol, Any, Tuple{Symbol, Symbol}, NamedTuple{(:chain_type, :progress), Tuple{UnionAll, Bool}}}, Random._GLOBAL_RNG, DynamicPPL.Model{typeof(extra_simple_troubleshootfitlv), (:covariates, :response, :Nr, :Nc, :sample_idx, :prob), (), (), Tuple{Tuple{Matrix{Float64}, Matrix{Float64}}, Vector{Float64}, Int64, Int64, CartesianIndices{3, Tuple{StepRange{Int64, Int64}, StepRange{Int64, Int64}, UnitRange{Int64}}}, ODEProblem{Matrix{Float64}, Tuple{Float64, Float64}, true, Tuple{Float64, Matrix{Float64}, Matrix{Float64}, Int64, Int64}, ODEFunction{true, SciMLBase.FullSpecialize, typeof(fast_react_diffuse!), UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing, Nothing}, Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, SciMLBase.StandardODEProblem}}, Tuple{}, DynamicPPL.DefaultContext}, DynamicPPL.Sampler{NUTS{Turing.Essential.TrackerAD, (), AdvancedHMC.DiagEuclideanMetric}}, Int64, Int64})(i::Int64, seed::UInt64, init_params::Nothing)
    @ AbstractMCMC C:\Users\brend\.julia\packages\AbstractMCMC\fnRmh\src\sample.jl:506
 [40] sample_chain
    @ C:\Users\brend\.julia\packages\AbstractMCMC\fnRmh\src\sample.jl:503 [inlined]
 [41] #4
    @ .\generator.jl:36 [inlined]
 [42] iterate
    @ .\generator.jl:47 [inlined]
 [43] collect(itr::Base.Generator{Base.Iterators.Zip{Tuple{UnitRange{Int64}, Vector{UInt64}}}, Base.var"#4#5"{AbstractMCMC.var"#sample_chain#78"{String, Base.Pairs{Symbol, Any, Tuple{Symbol, Symbol}, NamedTuple{(:chain_type, :progress), Tuple{UnionAll, Bool}}}, Random._GLOBAL_RNG, DynamicPPL.Model{typeof(extra_simple_troubleshootfitlv), (:covariates, :response, :Nr, :Nc, :sample_idx, :prob), (), (), Tuple{Tuple{Matrix{Float64}, Matrix{Float64}}, Vector{Float64}, Int64, Int64, CartesianIndices{3, Tuple{StepRange{Int64, Int64}, StepRange{Int64, Int64}, UnitRange{Int64}}}, ODEProblem{Matrix{Float64}, Tuple{Float64, Float64}, true, Tuple{Float64, Matrix{Float64}, Matrix{Float64}, Int64, Int64}, ODEFunction{true, SciMLBase.FullSpecialize, typeof(fast_react_diffuse!), UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing, Nothing}, Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, SciMLBase.StandardODEProblem}}, Tuple{}, DynamicPPL.DefaultContext}, DynamicPPL.Sampler{NUTS{Turing.Essential.TrackerAD, (), AdvancedHMC.DiagEuclideanMetric}}, Int64, Int64}}})
    @ Base .\array.jl:787
 [44] map
    @ .\abstractarray.jl:3055 [inlined]
 [45] mcmcsample(rng::Random._GLOBAL_RNG, model::DynamicPPL.Model{typeof(extra_simple_troubleshootfitlv), (:covariates, :response, :Nr, :Nc, :sample_idx, :prob), (), (), Tuple{Tuple{Matrix{Float64}, Matrix{Float64}}, Vector{Float64}, Int64, Int64, CartesianIndices{3, Tuple{StepRange{Int64, Int64}, StepRange{Int64, Int64}, UnitRange{Int64}}}, ODEProblem{Matrix{Float64}, Tuple{Float64, Float64}, true, Tuple{Float64, Matrix{Float64}, Matrix{Float64}, Int64, Int64}, ODEFunction{true, SciMLBase.FullSpecialize, typeof(fast_react_diffuse!), UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing, Nothing}, Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, SciMLBase.StandardODEProblem}}, Tuple{}, DynamicPPL.DefaultContext}, sampler::DynamicPPL.Sampler{NUTS{Turing.Essential.TrackerAD, (), AdvancedHMC.DiagEuclideanMetric}}, ::MCMCSerial, N::Int64, nchains::Int64; progressname::String, init_params::Nothing, kwargs::Base.Pairs{Symbol, Any, Tuple{Symbol, Symbol}, NamedTuple{(:chain_type, :progress), Tuple{UnionAll, Bool}}})
    @ AbstractMCMC C:\Users\brend\.julia\packages\AbstractMCMC\fnRmh\src\sample.jl:518
 [46] sample(rng::Random._GLOBAL_RNG, model::DynamicPPL.Model{typeof(extra_simple_troubleshootfitlv), (:covariates, :response, :Nr, :Nc, :sample_idx, :prob), (), (), Tuple{Tuple{Matrix{Float64}, Matrix{Float64}}, Vector{Float64}, Int64, Int64, CartesianIndices{3, Tuple{StepRange{Int64, Int64}, StepRange{Int64, Int64}, UnitRange{Int64}}}, ODEProblem{Matrix{Float64}, Tuple{Float64, Float64}, true, Tuple{Float64, Matrix{Float64}, Matrix{Float64}, Int64, Int64}, ODEFunction{true, SciMLBase.FullSpecialize, typeof(fast_react_diffuse!), UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing, Nothing}, Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, SciMLBase.StandardODEProblem}}, Tuple{}, DynamicPPL.DefaultContext}, sampler::DynamicPPL.Sampler{NUTS{Turing.Essential.TrackerAD, (), AdvancedHMC.DiagEuclideanMetric}}, ensemble::MCMCSerial, N::Int64, n_chains::Int64; chain_type::Type, progress::Bool, kwargs::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
    @ Turing.Inference C:\Users\brend\.julia\packages\Turing\szPqN\src\inference\Inference.jl:220
 [47] #sample#6
    @ C:\Users\brend\.julia\packages\Turing\szPqN\src\inference\Inference.jl:205 [inlined]
 [48] #sample#5
    @ C:\Users\brend\.julia\packages\Turing\szPqN\src\inference\Inference.jl:192 [inlined]
 [49] top-level scope
    @ REPL[30]:1
  • The asterisk is that I still see d randomly skyrocket in value in the forwarddiff mode, but it skyrockets to something like 9.9999 and then recovers. So whatever is in the gradient that makes it go crazy is still there, it’s just sufficiently constrained that it doesn’t break the solver in the process.

Your fine, we need to find a way to error about this (without conditional module support). It looks like it’s fine (that would fix the Zygote usage too), it’s looks like all that’s left then is the issue of sampling issue. Did you do the changes the PPL folks recommended?

1 Like