Getting issue in chain_sde while doing MCMC inference solution for SDEs

using Turing
using DifferentialEquations

Load StatsPlots for visualizations and diagnostics.

using StatsPlots

using LinearAlgebra

Set a seed for reproducibility.

using Random
Random.seed!(14);

u0 = [1.0, 1.0]
tspan = (0.0, 10.0)
function multiplicative_noise!(du, u, p, t)
x, y = u
du[1] = p[5] * x
return du[2] = p[6] * y
end
p = [1.5, 1.0, 3.0, 1.0, 0.1, 0.1]

function lotka_volterra!(du, u, p, t)
x, y = u
α, β, γ, δ = p
du[1] = dx = α * x - β * x * y
return du[2] = dy = δ * x * y - γ * y
end

prob_sde = SDEProblem(lotka_volterra!, multiplicative_noise!, u0, tspan, p)

ensembleprob = EnsembleProblem(prob_sde)
data = solve(ensembleprob, SOSRI(); saveat=0.1, trajectories=1000)
plot(EnsembleSummary(data))

@model function fitlv_sde(data, prob)
# Prior distributions.
σ ~ InverseGamma(2, 3)
α ~ truncated(Normal(1.3, 0.5); lower=0.5, upper=2.5)
β ~ truncated(Normal(1.2, 0.25); lower=0.5, upper=2)
γ ~ truncated(Normal(3.2, 0.25); lower=2.2, upper=4)
δ ~ truncated(Normal(1.2, 0.25); lower=0.5, upper=2)
ϕ1 ~ truncated(Normal(0.12, 0.3); lower=0.05, upper=0.25)
ϕ2 ~ truncated(Normal(0.12, 0.3); lower=0.05, upper=0.25)

# Simulate stochastic Lotka-Volterra model.
p = [α, β, γ, δ, ϕ1, ϕ2]
predicted = solve(prob, SOSRI(); p=p, saveat=0.1)

# Early exit if simulation could not be computed successfully.
if predicted.retcode !== :Success
    Turing.@addlogprob! -Inf
    return nothing
end

# Observations.
for i in 1:length(predicted)
    data[:, i] ~ MvNormal(predicted[i], σ^2 * I)
end

return nothing

end;

function lotka_volterra(du, u, p, t)
# Model parameters.
α, β, γ, δ = p
# Current state.
x, y = u

# Evaluate differential equations.
du[1] = (α - β * y) * x # prey
du[2] = (δ * x - γ) * y # predator

return nothing

end

Define initial-value problem.

u0 = [1.0, 1.0]
p = [1.5, 1.0, 3.0, 1.0]
tspan = (0.0, 10.0)
prob = ODEProblem(lotka_volterra, u0, tspan, p)

Plot simulation.

plot(solve(prob, Tsit5()))

sol = solve(prob, Tsit5(); saveat=0.1)
odedata = Array(sol) + 0.2 * randn(size(Array(sol)))

Plot simulation and noisy observations.

plot(sol; alpha=0.3)
scatter!(sol.t, odedata’; color=[1 2], label=“”)

model_sde = fitlv_sde(odedata, prob_sde)

setadbackend(:forwarddiff)
chain_sde = sample(
model_sde,
NUTS(0.25),
5000;
init_params=[1.5, 1.3, 1.2, 2.7, 1.2, 0.12, 0.12],
progress=false,
)
plot(chain_sde)

FOLLOWING IS THE ERROR

MethodError: no method matching truncated(::Normal{Float64}; lower=0.5, upper=2.5)
Closest candidates are:
truncated(::UnivariateDistribution, ::Integer, ::Integer) at C:\Users\User.julia\packages\Distributions\HjzA0\src\truncate.jl:32 got unsupported keyword arguments “lower”, “upper”
truncated(::UnivariateDistribution, ::T, ::T) where T<:Real at C:\Users\User.julia\packages\Distributions\HjzA0\src\truncate.jl:23 got unsupported keyword arguments “lower”, “upper”
truncated(::UnivariateDistribution, ::Real, ::Real) at C:\Users\User.julia\packages\Distributions\HjzA0\src\truncate.jl:19 got unsupported keyword arguments “lower”, “upper”

Stacktrace:
[1] #3
@ .\In[42]:4 [inlined]
[2] (::var"#3#4")(rng::Random._GLOBAL_RNG, model::DynamicPPL.Model{var"#3#4", (:data, :prob), (), (), Tuple{Matrix{Float64}, SDEProblem{Vector{Float64}, Tuple{Float64, Float64}, true, Vector{Float64}, Nothing, SDEFunction{true, typeof(lotka_volterra!), typeof(multiplicative_noise!), UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing}, typeof(multiplicative_noise!), Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, Nothing}}, Tuple{}}, varinfo::DynamicPPL.UntypedVarInfo{DynamicPPL.Metadata{Dict{AbstractPPL.VarName, Int64}, Vector{Distribution}, Vector{AbstractPPL.VarName}, Vector{Real}, Vector{Set{DynamicPPL.Selector}}}, Float64}, sampler::DynamicPPL.SampleFromUniform, context::DynamicPPL.DefaultContext, data::Matrix{Float64}, prob::SDEProblem{Vector{Float64}, Tuple{Float64, Float64}, true, Vector{Float64}, Nothing, SDEFunction{true, typeof(lotka_volterra!), typeof(multiplicative_noise!), UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing}, typeof(multiplicative_noise!), Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, Nothing})
@ Main .\none:0
[3] macro expansion
@ C:\Users\User.julia\packages\DynamicPPL\SgzCy\src\model.jl:0 [inlined]
[4] _evaluate(rng::Random._GLOBAL_RNG, model::DynamicPPL.Model{var"#3#4", (:data, :prob), (), (), Tuple{Matrix{Float64}, SDEProblem{Vector{Float64}, Tuple{Float64, Float64}, true, Vector{Float64}, Nothing, SDEFunction{true, typeof(lotka_volterra!), typeof(multiplicative_noise!), UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing}, typeof(multiplicative_noise!), Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, Nothing}}, Tuple{}}, varinfo::DynamicPPL.UntypedVarInfo{DynamicPPL.Metadata{Dict{AbstractPPL.VarName, Int64}, Vector{Distribution}, Vector{AbstractPPL.VarName}, Vector{Real}, Vector{Set{DynamicPPL.Selector}}}, Float64}, sampler::DynamicPPL.SampleFromUniform, context::DynamicPPL.DefaultContext)
@ DynamicPPL C:\Users\User.julia\packages\DynamicPPL\SgzCy\src\model.jl:154
[5] evaluate_threadunsafe(rng::Random._GLOBAL_RNG, model::DynamicPPL.Model{var"#3#4", (:data, :prob), (), (), Tuple{Matrix{Float64}, SDEProblem{Vector{Float64}, Tuple{Float64, Float64}, true, Vector{Float64}, Nothing, SDEFunction{true, typeof(lotka_volterra!), typeof(multiplicative_noise!), UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing}, typeof(multiplicative_noise!), Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, Nothing}}, Tuple{}}, varinfo::DynamicPPL.UntypedVarInfo{DynamicPPL.Metadata{Dict{AbstractPPL.VarName, Int64}, Vector{Distribution}, Vector{AbstractPPL.VarName}, Vector{Real}, Vector{Set{DynamicPPL.Selector}}}, Float64}, sampler::DynamicPPL.SampleFromUniform, context::DynamicPPL.DefaultContext)
@ DynamicPPL C:\Users\User.julia\packages\DynamicPPL\SgzCy\src\model.jl:127
[6] (::DynamicPPL.Model{var"#3#4", (:data, :prob), (), (), Tuple{Matrix{Float64}, SDEProblem{Vector{Float64}, Tuple{Float64, Float64}, true, Vector{Float64}, Nothing, SDEFunction{true, typeof(lotka_volterra!), typeof(multiplicative_noise!), UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing}, typeof(multiplicative_noise!), Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, Nothing}}, Tuple{}})(rng::Random._GLOBAL_RNG, varinfo::DynamicPPL.UntypedVarInfo{DynamicPPL.Metadata{Dict{AbstractPPL.VarName, Int64}, Vector{Distribution}, Vector{AbstractPPL.VarName}, Vector{Real}, Vector{Set{DynamicPPL.Selector}}}, Float64}, sampler::DynamicPPL.SampleFromUniform, context::DynamicPPL.DefaultContext)
@ DynamicPPL C:\Users\User.julia\packages\DynamicPPL\SgzCy\src\model.jl:92
[7] DynamicPPL.VarInfo(rng::Random._GLOBAL_RNG, model::DynamicPPL.Model{var"#3#4", (:data, :prob), (), (), Tuple{Matrix{Float64}, SDEProblem{Vector{Float64}, Tuple{Float64, Float64}, true, Vector{Float64}, Nothing, SDEFunction{true, typeof(lotka_volterra!), typeof(multiplicative_noise!), UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing}, typeof(multiplicative_noise!), Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, Nothing}}, Tuple{}}, sampler::DynamicPPL.SampleFromUniform, context::DynamicPPL.DefaultContext)
@ DynamicPPL C:\Users\User.julia\packages\DynamicPPL\SgzCy\src\varinfo.jl:126
[8] DynamicPPL.VarInfo(rng::Random._GLOBAL_RNG, model::DynamicPPL.Model{var"#3#4", (:data, :prob), (), (), Tuple{Matrix{Float64}, SDEProblem{Vector{Float64}, Tuple{Float64, Float64}, true, Vector{Float64}, Nothing, SDEFunction{true, typeof(lotka_volterra!), typeof(multiplicative_noise!), UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing}, typeof(multiplicative_noise!), Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, Nothing}}, Tuple{}}, sampler::DynamicPPL.SampleFromUniform)
@ DynamicPPL C:\Users\User.julia\packages\DynamicPPL\SgzCy\src\varinfo.jl:125
[9] step(rng::Random._GLOBAL_RNG, model::DynamicPPL.Model{var"#3#4", (:data, :prob), (), (), Tuple{Matrix{Float64}, SDEProblem{Vector{Float64}, Tuple{Float64, Float64}, true, Vector{Float64}, Nothing, SDEFunction{true, typeof(lotka_volterra!), typeof(multiplicative_noise!), UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing}, typeof(multiplicative_noise!), Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, Nothing}}, Tuple{}}, spl::DynamicPPL.Sampler{NUTS{Turing.Core.ForwardDiffAD{40}, (), AdvancedHMC.DiagEuclideanMetric}}; resume_from::Nothing, kwargs::Base.Pairs{Symbol, Any, Tuple{Symbol, Symbol}, NamedTuple{(:nadapts, :init_params), Tuple{Int64, Vector{Float64}}}})
@ DynamicPPL C:\Users\User.julia\packages\DynamicPPL\SgzCy\src\sampler.jl:73
[10] macro expansion
@ C:\Users\User.julia\packages\AbstractMCMC\oou1a\src\sample.jl:97 [inlined]
[11] macro expansion
@ C:\Users\User.julia\packages\AbstractMCMC\oou1a\src\logging.jl:15 [inlined]
[12] mcmcsample(rng::Random._GLOBAL_RNG, model::DynamicPPL.Model{var"#3#4", (:data, :prob), (), (), Tuple{Matrix{Float64}, SDEProblem{Vector{Float64}, Tuple{Float64, Float64}, true, Vector{Float64}, Nothing, SDEFunction{true, typeof(lotka_volterra!), typeof(multiplicative_noise!), UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing}, typeof(multiplicative_noise!), Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, Nothing}}, Tuple{}}, sampler::DynamicPPL.Sampler{NUTS{Turing.Core.ForwardDiffAD{40}, (), AdvancedHMC.DiagEuclideanMetric}}, N::Int64; progress::Bool, progressname::String, callback::Nothing, discard_initial::Int64, thinning::Int64, chain_type::Type, kwargs::Base.Pairs{Symbol, Any, Tuple{Symbol, Symbol}, NamedTuple{(:nadapts, :init_params), Tuple{Int64, Vector{Float64}}}})
@ AbstractMCMC C:\Users\User.julia\packages\AbstractMCMC\oou1a\src\sample.jl:88
[13] sample(rng::Random._GLOBAL_RNG, model::DynamicPPL.Model{var"#3#4", (:data, :prob), (), (), Tuple{Matrix{Float64}, SDEProblem{Vector{Float64}, Tuple{Float64, Float64}, true, Vector{Float64}, Nothing, SDEFunction{true, typeof(lotka_volterra!), typeof(multiplicative_noise!), UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing}, typeof(multiplicative_noise!), Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, Nothing}}, Tuple{}}, sampler::DynamicPPL.Sampler{NUTS{Turing.Core.ForwardDiffAD{40}, (), AdvancedHMC.DiagEuclideanMetric}}, N::Int64; chain_type::Type, resume_from::Nothing, progress::Bool, nadapts::Int64, discard_adapt::Bool, discard_initial::Int64, kwargs::Base.Pairs{Symbol, Vector{Float64}, Tuple{Symbol}, NamedTuple{(:init_params,), Tuple{Vector{Float64}}}})
@ Turing.Inference C:\Users\User.julia\packages\Turing\uAz5c\src\inference\hmc.jl:140
[14] #sample#2
@ C:\Users\User.julia\packages\Turing\uAz5c\src\inference\Inference.jl:142 [inlined]
[15] #sample#1
@ C:\Users\User.julia\packages\Turing\uAz5c\src\inference\Inference.jl:132 [inlined]
[16] top-level scope
@ In[47]:4
[17] eval
@ .\boot.jl:373 [inlined]
[18] include_string(mapexpr::typeof(REPL.softscope), mod::Module, code::String, filename::String)
@ Base .\loading.jl:1196

link i followed is

What version of Distributions.jl? Show ]st.

Distributions v0.23.12

That’s a very old version of Distributions. Grab something released within the last few years and you should be good. Something v0.25.x is preferred. I’d be curious to know why this was help back.

using Pkg
Pkg.add(Pkg.PackageSpec(;name=“Distributions”, version=“0.25.4”))

Unsatisfiable requirements detected for package Bridge [2d3116d5]:
Bridge [2d3116d5] log:
├─possible versions are: 0.9.0-0.11.6 or uninstalled
├─restricted to versions * by an explicit requirement, leaving only versions 0.9.0-0.11.6
└─restricted by compatibility requirements with Distributions [31c24e10] to versions: uninstalled — no versions left
└─Distributions [31c24e10] log:
├─possible versions are: 0.16.0-0.25.76 or uninstalled
└─restricted to versions 0.25.4 by an explicit requirement, leaving only versions 0.25.4

Stacktrace:
[1] propagate_constraints!(graph::Pkg.Resolve.Graph, sources::Set{Int64}; log_events::Bool)
@ Pkg.Resolve C:\Users\User\AppData\Local\Programs\Julia-1.7.3\share\julia\stdlib\v1.7\Pkg\src\Resolve\graphtype.jl:1063
[2] propagate_constraints! (repeats 2 times)
@ C:\Users\User\AppData\Local\Programs\Julia-1.7.3\share\julia\stdlib\v1.7\Pkg\src\Resolve\graphtype.jl:1000 [inlined]
[3] simplify_graph!(graph::Pkg.Resolve.Graph, sources::Set{Int64}; clean_graph::Bool)
@ Pkg.Resolve C:\Users\User\AppData\Local\Programs\Julia-1.7.3\share\julia\stdlib\v1.7\Pkg\src\Resolve\graphtype.jl:1519
[4] simplify_graph! (repeats 2 times)
@ C:\Users\User\AppData\Local\Programs\Julia-1.7.3\share\julia\stdlib\v1.7\Pkg\src\Resolve\graphtype.jl:1519 [inlined]
[5] resolve_versions!(env::Pkg.Types.EnvCache, registries::Vector{Pkg.Registry.RegistryInstance}, pkgs::Vector{Pkg.Types.PackageSpec}, julia_version::VersionNumber)
@ Pkg.Operations C:\Users\User\AppData\Local\Programs\Julia-1.7.3\share\julia\stdlib\v1.7\Pkg\src\Operations.jl:335
[6] targeted_resolve(env::Pkg.Types.EnvCache, registries::Vector{Pkg.Registry.RegistryInstance}, pkgs::Vector{Pkg.Types.PackageSpec}, preserve::Pkg.Types.PreserveLevel, julia_version::VersionNumber)
@ Pkg.Operations C:\Users\User\AppData\Local\Programs\Julia-1.7.3\share\julia\stdlib\v1.7\Pkg\src\Operations.jl:1154
[7] tiered_resolve(env::Pkg.Types.EnvCache, registries::Vector{Pkg.Registry.RegistryInstance}, pkgs::Vector{Pkg.Types.PackageSpec}, julia_version::VersionNumber)
@ Pkg.Operations C:\Users\User\AppData\Local\Programs\Julia-1.7.3\share\julia\stdlib\v1.7\Pkg\src\Operations.jl:1139
[8] _resolve(io::IJulia.IJuliaStdio{Base.PipeEndpoint}, env::Pkg.Types.EnvCache, registries::Vector{Pkg.Registry.RegistryInstance}, pkgs::Vector{Pkg.Types.PackageSpec}, preserve::Pkg.Types.PreserveLevel, julia_version::VersionNumber)
@ Pkg.Operations C:\Users\User\AppData\Local\Programs\Julia-1.7.3\share\julia\stdlib\v1.7\Pkg\src\Operations.jl:1160
[9] add(ctx::Pkg.Types.Context, pkgs::Vector{Pkg.Types.PackageSpec}, new_git::Set{Base.UUID}; preserve::Pkg.Types.PreserveLevel, platform::Base.BinaryPlatforms.Platform)
@ Pkg.Operations C:\Users\User\AppData\Local\Programs\Julia-1.7.3\share\julia\stdlib\v1.7\Pkg\src\Operations.jl:1176
[10] add(ctx::Pkg.Types.Context, pkgs::Vector{Pkg.Types.PackageSpec}; preserve::Pkg.Types.PreserveLevel, platform::Base.BinaryPlatforms.Platform, kwargs::Base.Pairs{Symbol, IJulia.IJuliaStdio{Base.PipeEndpoint}, Tuple{Symbol}, NamedTuple{(:io,), Tuple{IJulia.IJuliaStdio{Base.PipeEndpoint}}}})
@ Pkg.API C:\Users\User\AppData\Local\Programs\Julia-1.7.3\share\julia\stdlib\v1.7\Pkg\src\API.jl:268
[11] add(pkgs::Vector{Pkg.Types.PackageSpec}; io::IJulia.IJuliaStdio{Base.PipeEndpoint}, kwargs::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
@ Pkg.API C:\Users\User\AppData\Local\Programs\Julia-1.7.3\share\julia\stdlib\v1.7\Pkg\src\API.jl:149
[12] add(pkgs::Vector{Pkg.Types.PackageSpec})
@ Pkg.API C:\Users\User\AppData\Local\Programs\Julia-1.7.3\share\julia\stdlib\v1.7\Pkg\src\API.jl:144
[13] #add#26
@ C:\Users\User\AppData\Local\Programs\Julia-1.7.3\share\julia\stdlib\v1.7\Pkg\src\API.jl:141 [inlined]
[14] add(pkg::Pkg.Types.PackageSpec)
@ Pkg.API C:\Users\User\AppData\Local\Programs\Julia-1.7.3\share\julia\stdlib\v1.7\Pkg\src\API.jl:141
[15] top-level scope
@ In[111]:2
[16] eval
@ .\boot.jl:373 [inlined]
[17] include_string(mapexpr::typeof(REPL.softscope), mod::Module, code::String, filename::String)
@ Base .\loading.jl:1196

Remove Bridge?

i was using old version of julia…now i installed the newer version which is v1.8.2 …but getting following error
using Pkg
Pkg.add(“Ijulia”)

following is my error

expected package TuringTutorials [09eb8af7] to be registered
Stacktrace:
[1] pkgerror(msg::String)
@ Pkg.Types C:\Users\User\AppData\Local\Programs\julia-1.8.2\share\julia\stdlib\v1.8\Pkg\src\Types.jl:67
[2] check_registered
@ C:\Users\User\AppData\Local\Programs\julia-1.8.2\share\julia\stdlib\v1.8\Pkg\src\Operations.jl:1190 [inlined]
[3] targeted_resolve(env::Pkg.Types.EnvCache, registries::Vector{Pkg.Registry.RegistryInstance}, pkgs::Vector{Pkg.Types.PackageSpec}, preserve::Pkg.Types.PreserveLevel, julia_version::VersionNumber)
@ Pkg.Operations C:\Users\User\AppData\Local\Programs\julia-1.8.2\share\julia\stdlib\v1.8\Pkg\src\Operations.jl:1252 [4] tiered_resolve(env::Pkg.Types.EnvCache, registries::Vector{Pkg.Registry.RegistryInstance}, pkgs::Vector{Pkg.Types.PackageSpec}, julia_version::VersionNumber)
@ Pkg.Operations C:\Users\User\AppData\Local\Programs\julia-1.8.2\share\julia\stdlib\v1.8\Pkg\src\Operations.jl:1225 [5] _resolve(io::Base.TTY, env::Pkg.Types.EnvCache, registries::Vector{Pkg.Registry.RegistryInstance}, pkgs::Vector{Pkg.Types.PackageSpec}, preserve::Pkg.Types.PreserveLevel, julia_version::VersionNumber)
@ Pkg.Operations C:\Users\User\AppData\Local\Programs\julia-1.8.2\share\julia\stdlib\v1.8\Pkg\src\Operations.jl:1260 [6] add(ctx::Pkg.Types.Context, pkgs::Vector{Pkg.Types.PackageSpec}, new_git::Set{Base.UUID}; preserve::Pkg.Types.PreserveLevel, platform::Base.BinaryPlatforms.Platform)
@ Pkg.Operations C:\Users\User\AppData\Local\Programs\julia-1.8.2\share\julia\stdlib\v1.8\Pkg\src\Operations.jl:1276 [7] add(ctx::Pkg.Types.Context, pkgs::Vector{Pkg.Types.PackageSpec}; preserve::Pkg.Types.PreserveLevel, platform::Base.BinaryPlatforms.Platform, kwargs::Base.Pairs{Symbol, Base.TTY, Tuple{Symbol}, NamedTuple{(:io,), Tuple{Base.TTY}}})
@ Pkg.API C:\Users\User\AppData\Local\Programs\julia-1.8.2\share\julia\stdlib\v1.8\Pkg\src\API.jl:275
[8] add(pkgs::Vector{Pkg.Types.PackageSpec}; io::Base.TTY, kwargs::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
@ Pkg.API C:\Users\User\AppData\Local\Programs\julia-1.8.2\share\julia\stdlib\v1.8\Pkg\src\API.jl:156
[9] add(pkgs::Vector{Pkg.Types.PackageSpec})
@ Pkg.API C:\Users\User\AppData\Local\Programs\julia-1.8.2\share\julia\stdlib\v1.8\Pkg\src\API.jl:145
[10] #add#27
@ C:\Users\User\AppData\Local\Programs\julia-1.8.2\share\julia\stdlib\v1.8\Pkg\src\API.jl:144 [inlined]
[11] add
@ C:\Users\User\AppData\Local\Programs\julia-1.8.2\share\julia\stdlib\v1.8\Pkg\src\API.jl:144 [inlined]
[12] #add#26
@ C:\Users\User\AppData\Local\Programs\julia-1.8.2\share\julia\stdlib\v1.8\Pkg\src\API.jl:143 [inlined]
[13] add(pkg::String)
@ Pkg.API C:\Users\User\AppData\Local\Programs\julia-1.8.2\share\julia\stdlib\v1.8\Pkg\src\API.jl:143
[14] top-level scope
@ REPL[3]:1

TuringTutorials isn’t a registered package, it’s just the tutorials repository. GitHub - TuringLang/TuringTutorials: Educational material and tutorials for the Turing language . Is there a reason you need it?

julia> import Pkg; Pkg.precompile()
Precompiling project…
✗ BinaryProvider
✗ Sundials
✗ DifferentialEquations
0 dependencies successfully precompiled in 18 seconds. 352 already precompiled.

I have repeatedly removed and added these three package and still the same issue…can anyone resolve this?

Did you install Julia using the binaries provided here: Download Julia ?

yes i did the same

What is the error thrown during this installation process? Please paste the entire error message.

inatalling julia through these binaries has no error…it installed successfully, however when i run the following code
using Turing
using DifferentialEquations
using OrdinaryDiffEq, DiffEqParamEstim, JuMP, NLopt, Plots

Load StatsPlots for visualizations and diagnostics.

using StatsPlots

using LinearAlgebra
using DiffEqParamEstim
using DiffEqBayes
using Optim

Set a seed for reproducibility.

using Random
Random.seed!(14);

following is the error

ERROR: LoadError: InitError: could not load library “C:\Users\User.julia\artifacts\4ccc575631c856942ae91cbb8294de9b0a746c9d\bin\libsundials_sunnonlinsolfixedpoint.dll”
The specified module could not be found.
Stacktrace:
[1] dlopen(s::String, flags::UInt32; throw_error::Bool)
@ Base.Libc.Libdl .\libdl.jl:117
[2] dlopen(s::String, flags::UInt32)
@ Base.Libc.Libdl .\libdl.jl:116
[3] macro expansion
@ C:\Users\User.julia\packages\JLLWrappers\QpMQW\src\products\library_generators.jl:54 [inlined]
[4] init()
@ Sundials_jll C:\Users\User.julia\packages\Sundials_jll\rXn1i\src\wrappers\x86_64-w64-mingw32-libgfortran5.jl:159
[5] _include_from_serialized(pkg::Base.PkgId, path::String, depmods::Vector{Any})
@ Base .\loading.jl:831
[6] _require_search_from_serialized(pkg::Base.PkgId, sourcepath::String, build_id::UInt64)
@ Base .\loading.jl:1039
[7] _require(pkg::Base.PkgId)
@ Base .\loading.jl:1315
[8] _require_prelocked(uuidkey::Base.PkgId)
@ Base .\loading.jl:1200
[9] macro expansion
@ .\loading.jl:1180 [inlined]
[10] macro expansion
@ .\lock.jl:223 [inlined]
[11] require(into::Module, mod::Symbol)
@ Base .\loading.jl:1144
[12] include
@ .\Base.jl:419 [inlined]
[13] include_package_for_output(pkg::Base.PkgId, input::String, depot_path::Vector{String}, dl_load_path::Vector{String}, load_path::Vector{String}, concrete_deps::Vector{Pair{Base.PkgId, UInt64}}, source::String)
@ Base .\loading.jl:1554
[14] top-level scope
@ stdin:1
during initialization of module Sundials_jll
in expression starting at C:\Users\User.julia\packages\Sundials\3c9Un\src\Sundials.jl:3
in expression starting at stdin:1
ERROR: LoadError: Failed to precompile Sundials [c3572dad-4567-51f8-b174-8c6c989267f4] to C:\Users\User.julia\compiled\v1.8\Sundials\jl_502A.tmp.
Stacktrace:
[1] error(s::String)
@ Base .\error.jl:35
[2] compilecache(pkg::Base.PkgId, path::String, internal_stderr::IO, internal_stdout::IO, keep_loaded_modules::Bool)
@ Base .\loading.jl:1707
[3] compilecache
@ .\loading.jl:1651 [inlined]
[4] _require(pkg::Base.PkgId)
@ Base .\loading.jl:1337
[5] _require_prelocked(uuidkey::Base.PkgId)
@ Base .\loading.jl:1200
[6] macro expansion
@ .\loading.jl:1180 [inlined]
[7] macro expansion
@ .\lock.jl:223 [inlined]
[8] require(into::Module, mod::Symbol)
@ Base .\loading.jl:1144
[9] include
@ .\Base.jl:419 [inlined]
[10] include_package_for_output(pkg::Base.PkgId, input::String, depot_path::Vector{String}, dl_load_path::Vector{String}, load_path::Vector{String}, concrete_deps::Vector{Pair{Base.PkgId, UInt64}}, source::Nothing)
@ Base .\loading.jl:1554
[11] top-level scope
@ stdin:1
in expression starting at C:\Users\User.julia\packages\DifferentialEquations\el96s\src\DifferentialEquations.jl:1
in expression starting at stdin:1
Failed to precompile DifferentialEquations [0c46a032-eb83-5123-abaf-570d42b7fbaa] to C:\Users\User.julia\compiled\v1.8\DifferentialEquations\jl_32F3.tmp.

Stacktrace:
[1] error(s::String)
@ Base .\error.jl:35
[2] compilecache(pkg::Base.PkgId, path::String, internal_stderr::IO, internal_stdout::IO, keep_loaded_modules::Bool)
@ Base .\loading.jl:1707
[3] compilecache
@ .\loading.jl:1651 [inlined]
[4] _require(pkg::Base.PkgId)
@ Base .\loading.jl:1337
[5] _require_prelocked(uuidkey::Base.PkgId)
@ Base .\loading.jl:1200
[6] macro expansion
@ .\loading.jl:1180 [inlined]
[7] macro expansion
@ .\lock.jl:223 [inlined]
[8] require(into::Module, mod::Symbol)
@ Base .\loading.jl:1144
[9] eval
@ .\boot.jl:368 [inlined]
[10] include_string(mapexpr::typeof(REPL.softscope), mod::Module, code::String, filename::String)
@ Base .\loading.jl:1428

Try ]build DifferentialEquations, what does that show?

it showed nothing at all.

(@v1.8) pkg> build DifferentialEquations

(@v1.8) pkg> build DifferentialEquations

(@v1.8) pkg>

still the same issue and same error

]build Sundials?

tried all three builds Sundials, DifferentialEquations and BinaryProvider

shows again the same error

Can you show everything that is outputted from that?