Boundary for Turing parameters

I set my priors for parameters like this,

    b ~ Normal(1.5, 1.)
    s  ~ Normal(0.1, 1)
    q  ~ Normal(0.7, 1.0)

But I want to set strong limitation for these parameters, such as

abs(b)<10
abs(q)<1
0<abs(s)<1

How can I make it?

Maybe something like GitHub - tpapp/TransformVariables.jl: Transformations to contrained variables from ℝⁿ. ?

1 Like

Hi there!

Another way to constrain parameters in Turing would be to truncate their distributions using truncated:

sigma ~ truncated(Normal(0, 1), lower=0)

I think you can use the truncated function (defined in Distributions.jl) on the distribution and the keyword arguments lowerand upper like this

    b ~ truncated(Normal(1.5, 1.0); lower = -10, upper = 10)
    s  ~ truncated(Normal(0.1, 1.0); lower = -1, upper = 1)
    q  ~ truncated(Normal(0.7, 1.0); lower = -1, upper = 1)

This means it’s physically/mathematically impossible for the parameters to be outside the intervals (prior assumption/knowledge).

Just wanted to add the ref to documentation:

1 Like

Since all your constraints are of the form abs(x) < y, which is the same as -y < x < y, the simplest approach is to use a uniform distribution: x ~ Uniform(-y, y).