Skip to content

Commit

Permalink
Merge pull request #299 from tony-stone/check_intervals_numeric
Browse files Browse the repository at this point in the history
Check intervals numeric
  • Loading branch information
jgabry authored Jan 17, 2024
2 parents 14f9833 + 4d1558b commit ba9b568
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions R/mcmc-intervals.R
Original file line number Diff line number Diff line change
Expand Up @@ -864,6 +864,8 @@ compute_interval_density <- function(x, interval_width = 1, n_dens = 1024,
}

check_interval_widths <- function(prob, prob_outer) {
if (!(is.numeric(prob) && is.numeric(prob_outer)))
abort("`prob` and `prob_outer` must be numeric")
if (prob < 0 || prob > 1 || prob_outer < 0 || prob_outer > 1)
abort("`prob` and `prob_outer` must be in [0,1].")
if (prob_outer < prob) {
Expand Down

0 comments on commit ba9b568

Please sign in to comment.