Skip to content

Commit 516bd7d

Browse files
Clean up
1 parent 571dafe commit 516bd7d

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

src/fstats_hypothesis.f90

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,13 @@ pure function confidence_interval_scalar(dist, alpha, s, n) result(rst)
4343
!! The result.
4444

4545
! Local Variables
46-
real(real64) :: x
46+
real(real64) :: x, dn
4747

4848
! Process
49-
x = 1.0d0 - alpha / 2.0d0
49+
dn = real(n, real64)
50+
x = 1.0d0 - 0.5d0 * alpha
5051
rst = dist%standardized_variable(x)
51-
rst = rst * s / sqrt(real(n, real64))
52+
rst = rst * s / sqrt(dn)
5253
end function
5354

5455
! ------------------------------------------------------------------------------

tests/fstats_statistics_tests.f90

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -639,7 +639,7 @@ function confidence_interval_test_1() result(rst)
639639
logical :: rst
640640

641641
! Variables
642-
real(real64), parameter :: alpha = 2.0d0
642+
real(real64), parameter :: alpha = 0.05d0
643643
real(real64), parameter :: tol = 1.0d-3
644644
real(real64), parameter :: t20 = 2.086d0
645645
real(real64), parameter :: t10 = 2.228d0

0 commit comments

Comments
 (0)