Skip to content

Commit

Permalink
Fix bug in chi2_exp. It now matches chi2_pdf.
Browse files Browse the repository at this point in the history
  • Loading branch information
BrentSeidel committed Jun 4, 2024
1 parent f4da999 commit 90f8e99
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/BBS-Numerical-Statistics.adb
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ package body BBS.Numerical.Statistics is
begin
if x > 0.0 then
part1 := elem.log(x)*((f'Base(k)/2.0)-1.0) - (x/2.0);
part2 := elem.log(2.0)*(f'Base(x)/2.0) + funct.lngamma2n(k);
part2 := elem.log(2.0)*(f'Base(k)/2.0) + funct.lngamma2n(k);
return elem.exp(part1 - part2);
else
return 0.0;
Expand Down
2 changes: 1 addition & 1 deletion test/test_stats.adb
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ begin
Ada.Text_IO.New_Line;
Ada.Text_IO.Put_Line("Probability Distributions");
Ada.Text_IO.Put_Line(" Normal Chi^2");
Ada.Text_IO.Put_Line(" X PDF CDF PDF CDF");
Ada.Text_IO.Put_Line(" X PDF CDF PDF PDF CDF");
for i in 0 .. 20 loop
val := real(i)*1.0;
Ada.Text_IO.Put(" ");
Expand Down

0 comments on commit 90f8e99

Please sign in to comment.