Implementation of NUTS | Translating Stan model to Julia | JuliaConnectoR

Thanks @ChrisRackauckas. The functions and the model code are written in Julia and are located in a .jl source file. With the help of JuliaConnectoR I call the source code and implement the model with Turing in R.

I am almost finished translating my Stan code to Julia, following also the Julia QuantEcon Modeling COVID 19 with Differential Equations. I am not opening a new topic for the following question, as it is (somewhat) related to the migration to Julia.

I receive the following error, related to ForwardDiff.Dual and the SIR ODE solver. Looking at this topic, I understand that I am mixing the Vector{Float64} with type dual number, e.g. the SIR function exports a vector dy_dt = Vector{Float64}(undef, 4) with the derivatives. There are some related topics like this one, but no luck so far.

A working example with the Julia source code is located in this github repo.

MethodError: no method matching nextfloat(::Int64)
Closest candidates are:
  nextfloat(!Matched::Union{Float16, Float32, Float64}, !Matched::Integer) at C:\Users\lbour\AppData\Local\Programs\Julia-1.7.0\share\julia\base\float.jl:709
  nextfloat(!Matched::ForwardDiff.Dual{T, V, N}) where {T, V, N} at C:\Users\lbour\.julia\packages\ForwardDiff\CkdHU\src\dual.jl:265
  nextfloat(!Matched::Tracker.TrackedReal) at C:\Users\lbour\.julia\packages\DistributionsAD\WaBSG\src\tracker.jl:10
  ...
Stacktrace:
  [1] ode_determine_initdt(u0::Vector{Float64}, t::Int64, tdir::Int64, dtmax::Int64, abstol::Float64, reltol::Float64, internalnorm::typeof(DiffEqBase.ODE_DEFAULT_NORM), prob::SciMLBase.ODEProblem{Vector{Float64}, Tuple{Int64, Int64}, false, Vector{Any}, SciMLBase.ODEFunction{false, typeof(Main.Single_type_sir.sir_ode), LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Noth

Many thanks for any help you may provide.