Skip to content

Commit

Permalink
fix tie breaking mechanism
Browse files Browse the repository at this point in the history
  • Loading branch information
Red-Portal committed Nov 15, 2023
1 parent 4e82a2c commit 2894ce2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/exactranktest.jl
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,13 @@ function simulate_rank(
θ_bwd = markovchain_multiple_transition(
rng, model, kernel, n_mcmc_thin, θ_bwd, y
)
rank_wins += statistics(θ_bwd) .< (stat_mid .- tie_epsilon)
rank_wins += statistics(θ_bwd) .< stat_mid
rank_ties += abs.(stat_mid - statistics(θ_bwd)) .≤ tie_epsilon
end

# Tie Resolution
map(rank_wins, rank_ties) do rank_wins_param, rank_ties_param
rank_wins_param + sample(rng, 1:rank_ties_param+1)
rank_wins_param + sample(rng, 1:rank_ties_param+1) - 1
end
end

Expand Down

0 comments on commit 2894ce2

Please sign in to comment.