Skip to content

Commit 54280d8

Browse files
committed
Doc fixes
1 parent 80cc545 commit 54280d8

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

src/Statistics.jl

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -938,8 +938,8 @@ The keyword argument `sorted` indicates whether `v` can be assumed to be sorted;
938938
939939
By default (`type=7`, or equivalently `alpha = beta = 1`),
940940
quantiles are computed via linear interpolation between the points
941-
`((k-1)/(n-1), x[k])`, for `k = 1:n` where `x[j]` is the j-th order statistic of `itr`
942-
and `n = length(itr)`. This corresponds to Definition 7
941+
`((k-1)/(n-1), x[k])`, for `k = 1:n` where `x[j]` is the j-th order statistic of `v`
942+
and `n = length(v)`. This corresponds to Definition 7
943943
of Hyndman and Fan (1996), and is the same as the R and NumPy default.
944944
945945
The keyword argument `type` can be used to choose among the 9 definitions
@@ -949,7 +949,7 @@ kinds of arguments at the same time.
949949
950950
Definitions 1 to 3 are discontinuous:
951951
- `type=1`: `Q(p) = x[ceil(n*p)]` (SAS-3)
952-
- `type=2`: `Q(p) = middle(x[ceil(n*p), floor(n*p + 1)])` (SAS-5, Stata)
952+
- `type=2`: `Q(p) = middle(x[ceil(n*p)], x[floor(n*p + 1)])` (SAS-5, Stata)
953953
- `type=3`: `Q(p) = x[round(n*p)]` (SAS-2)
954954
955955
Definitions 4 to 9 use linear interpolation between consecutive order statistics.
@@ -963,6 +963,9 @@ where `j = floor(n*p + m)`, `m = alpha + p*(1 - alpha - beta)` and `γ = n*p + m
963963
- `type=8`: `alpha=1/3`, `beta=1/3`
964964
- `type=9`: `alpha=3/8`, `beta=3/8`
965965
966+
For all 9 definitions, `x[j]` refers to the minimum value when `j < 1` and
967+
to the maximum value when `j > length(x)`.
968+
966969
Definitions 1 and 3 have the advantage that they work with types that do not support
967970
all arithmetic operations, such as `Date`.
968971
@@ -1156,7 +1159,7 @@ kinds of arguments at the same time.
11561159
11571160
Definitions 1 to 3 are discontinuous:
11581161
- `type=1`: `Q(p) = x[ceil(n*p)]` (SAS-3)
1159-
- `type=2`: `Q(p) = middle(x[ceil(n*p), floor(n*p + 1)])` (SAS-5, Stata)
1162+
- `type=2`: `Q(p) = middle(x[ceil(n*p)], x[floor(n*p + 1)])` (SAS-5, Stata)
11601163
- `type=3`: `Q(p) = x[round(n*p)]` (SAS-2)
11611164
11621165
Definitions 4 to 9 use linear interpolation between consecutive order statistics.
@@ -1170,11 +1173,14 @@ where `j = floor(n*p + m)`, `m = alpha + p*(1 - alpha - beta)` and `γ = n*p + m
11701173
- `type=8`: `alpha=1/3`, `beta=1/3`
11711174
- `type=9`: `alpha=3/8`, `beta=3/8`
11721175
1176+
For all 9 definitions, `x[j]` refers to the minimum value when `j < 1` and
1177+
to the maximum value when `j > length(x)`.
1178+
11731179
Definitions 1 and 3 have the advantage that they work with types that do not support
11741180
all arithmetic operations, such as `Date`.
11751181
11761182
!!! note
1177-
An `ArgumentError` is thrown if `v` contains `NaN` or [`missing`](@ref) values.
1183+
An `ArgumentError` is thrown if `itr` contains `NaN` or [`missing`](@ref) values.
11781184
Use the [`skipmissing`](@ref) function to omit `missing` entries and compute the
11791185
quantiles of non-missing values.
11801186

0 commit comments

Comments
 (0)