Skip to content

Commit

Permalink
Update interval.pl
Browse files Browse the repository at this point in the history
  • Loading branch information
mgondan authored Jan 29, 2023
1 parent 590093b commit 4ab15be
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions inst/pl/interval.pl
Original file line number Diff line number Diff line change
Expand Up @@ -447,12 +447,12 @@
int(pbinom(Q, Size, Prob, Tail, Log), Res),
r_eval(Tail, true)
=> int(Prob, ProbL ... ProbU),
r_eval(pbinom(Q, Size, #(ProbU, ProbL), Tail, Log), #(L, U)),
r_eval(pbinom(Q, Size, ##(ProbU, ProbL), Tail, Log), ##(L, U)),
Res = L ... U.

int(pbinom(Q, Size, Prob, Tail, Log), Res)
=> int(Prob, ProbL ... ProbU),
r_eval(pbinom(Q, Size, #(ProbL, ProbU), Tail, Log), #(L, U)),
r_eval(pbinom(Q, Size, ##(ProbL, ProbU), Tail, Log), ##(L, U)),
Res = L ... U.

% For X < Prob*Size, dbinom is monotonically decreasing in Prob, above that
Expand All @@ -461,11 +461,11 @@
=> r_eval(Size, SizeR),
int(Prob, ProbL ... ProbU),
( X < ProbL*SizeR
-> r_eval(dbinom(X, Size, #(ProbU, ProbL), Log), #(L, U))
-> r_eval(dbinom(X, Size, ##(ProbU, ProbL), Log), ##(L, U))
; X > ProbU*SizeR
-> r_eval(dbinom(X, Size, #(ProbL, ProbU), Log), #(L, U))
-> r_eval(dbinom(X, Size, ##(ProbL, ProbU), Log), ##(L, U))
; r_eval(X/Size, ProbM),
r_eval(dbinom(X, Size, #(ProbL, ProbM, ProbU), Log), #(B1, B2, B3)),
r_eval(dbinom(X, Size, ##(ProbL, ProbM, ProbU), Log), ##(B1, B2, B3)),
min_list([B1, B2, B3], L),
max_list([B1, B2, B3], U)
),
Expand Down

0 comments on commit 4ab15be

Please sign in to comment.