# Turing probability queries always return 1

**URL:** https://discourse.julialang.org/t/turing-probability-queries-always-return-1/83269
**Category:** Probabilistic Programming
**Tags:** question, package
**Created:** [June 23, 2022, 6:49pm UTC](https://discourse.julialang.org/t/turing-probability-queries-always-return-1/83269 "2022-06-23T18:49:24Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![cmhainje](https://avatars.discourse-cdn.com/v4/letter/c/47e85d/32.png) [@cmhainje](https://discourse.julialang.org/u/cmhainje)
#### Post date: [June 23, 2022, 6:49pm UTC](https://discourse.julialang.org/t/turing-probability-queries-always-return-1/83269/1 "2022-06-23T18:49:24Z")

</div>

I made a probabilistic model that attempts to infer the center coordinates (h, k) and radius (R) of a circle given a number of points that were sampled from the circle, but when I try to query probabilities, I always get 1.0. Here’s a MWE:

```julia
@model function circle(xs, ys)
    R ~ truncated(Normal(5, 0.1), 0, Inf)
    h ~ Normal(0, 1)
    k ~ Normal(0, 1)
    σ = 0.01

    for i in eachindex(xs)
        θ = atan(ys[i] - k, xs[i] - h)
        xs[i] ~ Normal(h + R * cos(θ), σ)
        ys[i] ~ Normal(k + R * sin(θ), σ)
    end
end

# Generate some data from a circle
R, h, k = 5., 0.1, 0.
n_samples = 30
xs = Vector(undef, n_samples)
ys = Vector(undef, n_samples)
for i in eachindex(xs)
    θ = rand(Uniform(-π, +π))
    xs[i] = h + R * cos(θ)
    ys[i] = k + R * sin(θ)
end

model = circle(xs, ys)

println(prob"R = 4 | model = model, xs = xs, ys = ys, h = h, k = k") # out: 1.0
println(prob"R = 5 | model = model, xs = xs, ys = ys, h = h, k = k") # out: 1.0
println(prob"R = 6 | model = model, xs = xs, ys = ys, h = h, k = k") # out: 1.0

```

Have I set up my model improperly or something? Does anyone know how to get around this? Thanks.
