Skip to content

Commit

Permalink
mistake fixed by Dasha
Browse files Browse the repository at this point in the history
  • Loading branch information
konkam committed Oct 30, 2020
1 parent 5ae1f66 commit 098aa91
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion src/Pkn.jl
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,11 @@ log of the ratio p_{n+1,k+1}/p_{n+1,k} (Bystrova, 2020).
```
"""
function logxk(n, k, β, σ)
return log(k*σ + βnk(β, n, k, σ)) + log(Cnk(n, k+1, σ)) - log(σ) - log(Cnk(n, k, σ))
if n==1
return log(k*σ ) + log(Cnk(n, k+1, σ)) - log(σ) - log(Cnk(n, k, σ))
else
return log(k*σ + βnk(β, n-1, k, σ)) + log(Cnk(n, k+1, σ)) - log(σ) - log(Cnk(n, k, σ))
end
end


Expand Down
2 changes: 1 addition & 1 deletion test/test_Pkn.jl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
@test_nowarn GibbsTypePriors.Pkn_NGG_arb(50, 100, 0.5, 0.2)
@test_nowarn GibbsTypePriors.Pkn_NGG_robust_in(50, 100, 0.5, 0.2)
@test GibbsTypePriors.log_βnk(1.3, 100, 25, 1.2) 2.1851379297320825
@test Float64(GibbsTypePriors.logxk(10, 5, 1.3, 0.9)) 0.7300787963127003
@test Float64(GibbsTypePriors.logxk(10, 5, 1.3, 0.9)) 0.6969596408073483
@test_nowarn GibbsTypePriors.Pkn_NGG_approx(90, 100, 1.2, 0.6)
@test_nowarn GibbsTypePriors.Pkn_NGG_approx(100, 100, 1.2, 0.6)
@test GibbsTypePriors.Pkn_NGG_approx(100, 100, 1.2, 0.6, 100, -1) == -1
Expand Down

0 comments on commit 098aa91

Please sign in to comment.