Hi All,
I want to drawing random variables from truncated normal with mean as another variable. However it didn’t work and I got the following wrong message. Is there anyone who can help me with it?
Gonzalo
using Turing, Distributions
@model function model(); alpha ~ Uniform(0,1); x = rand(Truncated(Normal(0, alpha),0,1)); end
sample(model(), NUTS(), 1000, thinning=10, discard_initial=1000);
Sampling 100%|████████████████████████████████████████████████████████████████████████████████| Time: 0:00:00
ERROR: MethodError: no method matching randnt(::TaskLocalRNG, ::ForwardDiff.Dual{ForwardDiff.Tag{Turing.TuringTag, Float64}, Float64, 1}, ::ForwardDiff.Dual{ForwardDiff.Tag{Turing.TuringTag, Float64}, Float64, 1}, ::ForwardDiff.Dual{ForwardDiff.Tag{Turing.TuringTag, Float64}, Float64, 1})
Closest candidates are:
randnt(::AbstractRNG, ::Float64, ::Float64, ::Float64) at ~/anaconda3/share/julia/packages/Distributions/UaWBm/src/truncated/normal.jl:158