# Getting issue in chain\_sde while doing MCMC inference solution for SDEs

**URL:** <https://discourse.julialang.org/t/getting-issue-in-chain-sde-while-doing-mcmc-inference-solution-for-sdes/88613>\
**Category:** New to Julia\
**Created:** [October 12, 2022, 10:30am UTC](https://discourse.julialang.org/t/getting-issue-in-chain-sde-while-doing-mcmc-inference-solution-for-sdes/88613 "2022-10-12T10:30:01Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Virendra\_Sheoran](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/virendra_sheoran/32/43185_2.png) [@Virendra\_Sheoran](https://discourse.julialang.org/u/Virendra_Sheoran)\
**Post date:** [October 12, 2022, 10:30am UTC](https://discourse.julialang.org/t/getting-issue-in-chain-sde-while-doing-mcmc-inference-solution-for-sdes/88613/1 "2022-10-12T10:30:01Z")

</div>

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  
[https://turing.ml/v0.21/tutorials/10-bayesian-differential-equations/](https://turing.ml/v0.21/tutorials/10-bayesian-differential-equations/)

---

<div class="post-metadata">

**Author:** ![ChrisRackauckas](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chrisrackauckas/32/77_2.png) [@ChrisRackauckas](https://discourse.julialang.org/u/ChrisRackauckas)\
**Post date:** [October 12, 2022, 1:20pm UTC](https://discourse.julialang.org/t/getting-issue-in-chain-sde-while-doing-mcmc-inference-solution-for-sdes/88613/2 "2022-10-12T13:20:29Z")

</div>

What version of Distributions.jl? Show `]st`.

---

<div class="post-metadata">

**Author:** ![Virendra\_Sheoran](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/virendra_sheoran/32/43185_2.png) [@Virendra\_Sheoran](https://discourse.julialang.org/u/Virendra_Sheoran)\
**Post date:** [October 12, 2022, 1:38pm UTC](https://discourse.julialang.org/t/getting-issue-in-chain-sde-while-doing-mcmc-inference-solution-for-sdes/88613/3 "2022-10-12T13:38:39Z")

</div>

Distributions v0.23.12

---

<div class="post-metadata">

**Author:** ![ChrisRackauckas](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chrisrackauckas/32/77_2.png) [@ChrisRackauckas](https://discourse.julialang.org/u/ChrisRackauckas)\
**Post date:** [October 12, 2022, 4:14pm UTC](https://discourse.julialang.org/t/getting-issue-in-chain-sde-while-doing-mcmc-inference-solution-for-sdes/88613/4 "2022-10-12T16:14:44Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Virendra\_Sheoran](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/virendra_sheoran/32/43185_2.png) [@Virendra\_Sheoran](https://discourse.julialang.org/u/Virendra_Sheoran)\
**Post date:** [October 12, 2022, 4:53pm UTC](https://discourse.julialang.org/t/getting-issue-in-chain-sde-while-doing-mcmc-inference-solution-for-sdes/88613/5 "2022-10-12T16:53:05Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![ChrisRackauckas](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chrisrackauckas/32/77_2.png) [@ChrisRackauckas](https://discourse.julialang.org/u/ChrisRackauckas)\
**Post date:** [October 12, 2022, 5:46pm UTC](https://discourse.julialang.org/t/getting-issue-in-chain-sde-while-doing-mcmc-inference-solution-for-sdes/88613/6 "2022-10-12T17:46:51Z")

</div>

Remove Bridge?

---

<div class="post-metadata">

**Author:** ![Virendra\_Sheoran](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/virendra_sheoran/32/43185_2.png) [@Virendra\_Sheoran](https://discourse.julialang.org/u/Virendra_Sheoran)\
**Post date:** [October 13, 2022, 7:10am UTC](https://discourse.julialang.org/t/getting-issue-in-chain-sde-while-doing-mcmc-inference-solution-for-sdes/88613/7 "2022-10-13T07:10:26Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![ChrisRackauckas](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chrisrackauckas/32/77_2.png) [@ChrisRackauckas](https://discourse.julialang.org/u/ChrisRackauckas)\
**Post date:** [October 13, 2022, 9:20am UTC](https://discourse.julialang.org/t/getting-issue-in-chain-sde-while-doing-mcmc-inference-solution-for-sdes/88613/8 "2022-10-13T09:20:36Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Virendra\_Sheoran](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/virendra_sheoran/32/43185_2.png) [@Virendra\_Sheoran](https://discourse.julialang.org/u/Virendra_Sheoran)\
**Post date:** [October 14, 2022, 6:29am UTC](https://discourse.julialang.org/t/getting-issue-in-chain-sde-while-doing-mcmc-inference-solution-for-sdes/88613/9 "2022-10-14T06:29:12Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![ChrisRackauckas](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chrisrackauckas/32/77_2.png) [@ChrisRackauckas](https://discourse.julialang.org/u/ChrisRackauckas)\
**Post date:** [October 14, 2022, 6:30am UTC](https://discourse.julialang.org/t/getting-issue-in-chain-sde-while-doing-mcmc-inference-solution-for-sdes/88613/10 "2022-10-14T06:30:44Z")

</div>

Did you install Julia using the binaries provided here: [Download Julia](https://julialang.org/downloads/) ?

---

<div class="post-metadata">

**Author:** ![Virendra\_Sheoran](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/virendra_sheoran/32/43185_2.png) [@Virendra\_Sheoran](https://discourse.julialang.org/u/Virendra_Sheoran)\
**Post date:** [October 14, 2022, 6:33am UTC](https://discourse.julialang.org/t/getting-issue-in-chain-sde-while-doing-mcmc-inference-solution-for-sdes/88613/11 "2022-10-14T06:33:23Z")

</div>

yes i did the same

---

<div class="post-metadata">

**Author:** ![ChrisRackauckas](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chrisrackauckas/32/77_2.png) [@ChrisRackauckas](https://discourse.julialang.org/u/ChrisRackauckas)\
**Post date:** [October 14, 2022, 6:35am UTC](https://discourse.julialang.org/t/getting-issue-in-chain-sde-while-doing-mcmc-inference-solution-for-sdes/88613/12 "2022-10-14T06:35:15Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Virendra\_Sheoran](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/virendra_sheoran/32/43185_2.png) [@Virendra\_Sheoran](https://discourse.julialang.org/u/Virendra_Sheoran)\
**Post date:** [October 14, 2022, 6:39am UTC](https://discourse.julialang.org/t/getting-issue-in-chain-sde-while-doing-mcmc-inference-solution-for-sdes/88613/13 "2022-10-14T06:39:29Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![ChrisRackauckas](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chrisrackauckas/32/77_2.png) [@ChrisRackauckas](https://discourse.julialang.org/u/ChrisRackauckas)\
**Post date:** [October 14, 2022, 6:41am UTC](https://discourse.julialang.org/t/getting-issue-in-chain-sde-while-doing-mcmc-inference-solution-for-sdes/88613/14 "2022-10-14T06:41:13Z")

</div>

Try `]build DifferentialEquations`, what does that show?

---

<div class="post-metadata">

**Author:** ![Virendra\_Sheoran](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/virendra_sheoran/32/43185_2.png) [@Virendra\_Sheoran](https://discourse.julialang.org/u/Virendra_Sheoran)\
**Post date:** [October 14, 2022, 6:43am UTC](https://discourse.julialang.org/t/getting-issue-in-chain-sde-while-doing-mcmc-inference-solution-for-sdes/88613/15 "2022-10-14T06:43:41Z")

</div>

> [@ChrisRackauckas](#):
>
> build DifferentialEquations

it showed nothing at all.

(@v1.8) pkg\> build DifferentialEquations

(@v1.8) pkg\> build DifferentialEquations

(@v1.8) pkg\>

---

<div class="post-metadata">

**Author:** ![Virendra\_Sheoran](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/virendra_sheoran/32/43185_2.png) [@Virendra\_Sheoran](https://discourse.julialang.org/u/Virendra_Sheoran)\
**Post date:** [October 14, 2022, 6:44am UTC](https://discourse.julialang.org/t/getting-issue-in-chain-sde-while-doing-mcmc-inference-solution-for-sdes/88613/16 "2022-10-14T06:44:47Z")

</div>

still the same issue and same error

---

<div class="post-metadata">

**Author:** ![ChrisRackauckas](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chrisrackauckas/32/77_2.png) [@ChrisRackauckas](https://discourse.julialang.org/u/ChrisRackauckas)\
**Post date:** [October 14, 2022, 7:02am UTC](https://discourse.julialang.org/t/getting-issue-in-chain-sde-while-doing-mcmc-inference-solution-for-sdes/88613/17 "2022-10-14T07:02:22Z")

</div>

`]build Sundials`?

---

<div class="post-metadata">

**Author:** ![Virendra\_Sheoran](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/virendra_sheoran/32/43185_2.png) [@Virendra\_Sheoran](https://discourse.julialang.org/u/Virendra_Sheoran)\
**Post date:** [October 14, 2022, 7:14am UTC](https://discourse.julialang.org/t/getting-issue-in-chain-sde-while-doing-mcmc-inference-solution-for-sdes/88613/18 "2022-10-14T07:14:27Z")

</div>

tried all three builds Sundials, DifferentialEquations and BinaryProvider

---

<div class="post-metadata">

**Author:** ![Virendra\_Sheoran](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/virendra_sheoran/32/43185_2.png) [@Virendra\_Sheoran](https://discourse.julialang.org/u/Virendra_Sheoran)\
**Post date:** [October 14, 2022, 7:14am UTC](https://discourse.julialang.org/t/getting-issue-in-chain-sde-while-doing-mcmc-inference-solution-for-sdes/88613/19 "2022-10-14T07:14:42Z")

</div>

shows again the same error

---

<div class="post-metadata">

**Author:** ![ChrisRackauckas](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chrisrackauckas/32/77_2.png) [@ChrisRackauckas](https://discourse.julialang.org/u/ChrisRackauckas)\
**Post date:** [October 14, 2022, 7:25am UTC](https://discourse.julialang.org/t/getting-issue-in-chain-sde-while-doing-mcmc-inference-solution-for-sdes/88613/20 "2022-10-14T07:25:41Z")

</div>

Can you show everything that is outputted from that?

[Next page](https://discourse.julialang.org/t/getting-issue-in-chain-sde-while-doing-mcmc-inference-solution-for-sdes/88613.md?page=2)
