sample script:
https://gist.github.com/Moelf/ab2f10ce45873bb91eaec60ace8388c0
you will need
]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
between InterpCode4
and InterpCode0
.
I see:
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
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