# Turing.jl identical likelihood but different \`MAP()\` result?

**URL:** <https://discourse.julialang.org/t/turing-jl-identical-likelihood-but-different-map-result/79671>\
**Category:** Probabilistic Programming\
**Tags:** question, package, turing\
**Created:** [April 19, 2022, 3:09am UTC](https://discourse.julialang.org/t/turing-jl-identical-likelihood-but-different-map-result/79671 "2022-04-19T03:09:58Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jling](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jling/32/212909_2.png) [@jling](https://discourse.julialang.org/u/jling)\
**Post date:** [April 19, 2022, 3:09am UTC](https://discourse.julialang.org/t/turing-jl-identical-likelihood-but-different-map-result/79671/1 "2022-04-19T03:09:58Z")

</div>

sample script:  
[https://gist.github.com/Moelf/ab2f10ce45873bb91eaec60ace8388c0](https://gist.github.com/Moelf/ab2f10ce45873bb91eaec60ace8388c0)

you will need

```julia
]dev https://github.com/JuliaHEP/LiteHF.jl
]add Turing, Optim

```

to compare, flip this line:  
[https://github.com/JuliaHEP/LiteHF.jl/blob/c68a70da2c54a48424683cf8ac538e0e67e762c7/src/modifiers.jl#L16](https://github.com/JuliaHEP/LiteHF.jl/blob/c68a70da2c54a48424683cf8ac538e0e67e762c7/src/modifiers.jl#L16)

between `InterpCode4` and `InterpCode0`.

I see:

```julia
ModeResult with maximized lp of -13.22
3-element Named Vector{Float64}
A │ 
────────────────┼───────────
:μ │ 1.29259
Symbol("θs[1]") │ -0.0411768
Symbol("θs[2]") │ 0.0178776

julia> loglikelihood(mymodel, (μ=0, θs=[1,0]))
-10.662623923767459

```

and

```julia
ModeResult with maximized lp of -13.22
3-element Named Vector{Float64}
A │ 
────────────────┼──────────
:μ │ 1.30279
Symbol("θs[1]") │ -0.060553
Symbol("θs[2]") │ 0.0187052

julia> loglikelihood(mymodel, (μ=0, θs=[1,0]))
-10.662623923767459

```
