Skip to content

Commit 0572db4

Browse files
authored
Merge pull request #841 from LilithHafner/trailing-whitespace
remove trailing whitespace
2 parents 39d0433 + 85ea69b commit 0572db4

File tree

6 files changed

+24
-24
lines changed

6 files changed

+24
-24
lines changed

docs/src/signalcorr.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Correlation Analysis of Signals
22

3-
The package provides functions to perform correlation analysis of sequential signals.
3+
The package provides functions to perform correlation analysis of sequential signals.
44

55
## Autocovariance and Autocorrelation
66

@@ -18,7 +18,7 @@ crosscov
1818
crosscov!
1919
crosscor
2020
crosscor!
21-
```
21+
```
2222

2323
## Partial Autocorrelation Function
2424

src/rankcorr.jl

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -143,8 +143,8 @@ function corkendall!(x::RealVector, y::RealVector, permx::AbstractVector{<:Integ
143143
if x[i - 1] == x[i]
144144
k += 1
145145
elseif k > 0
146-
# Sort the corresponding chunk of y, so the rows of hcat(x,y) are
147-
# sorted first on x, then (where x values are tied) on y. Hence
146+
# Sort the corresponding chunk of y, so the rows of hcat(x,y) are
147+
# sorted first on x, then (where x values are tied) on y. Hence
148148
# double ties can be counted by calling countties.
149149
sort!(view(y, (i - k - 1):(i - 1)))
150150
ntiesx += div(widen(k) * (k + 1), 2) # Must use wide integers here
@@ -217,7 +217,7 @@ end
217217
"""
218218
countties(x::RealVector, lo::Integer, hi::Integer)
219219
220-
Return the number of ties within `x[lo:hi]`. Assumes `x` is sorted.
220+
Return the number of ties within `x[lo:hi]`. Assumes `x` is sorted.
221221
"""
222222
function countties(x::AbstractVector, lo::Integer, hi::Integer)
223223
# Use of widen below prevents possible overflow errors when
@@ -246,9 +246,9 @@ const SMALL_THRESHOLD = 64
246246
# merge_sort! copied from Julia Base
247247
# (commit 28330a2fef4d9d149ba0fd3ffa06347b50067647, dated 20 Sep 2020)
248248
"""
249-
merge_sort!(v::AbstractVector, lo::Integer, hi::Integer, t::AbstractVector=similar(v, 0))
249+
merge_sort!(v::AbstractVector, lo::Integer, hi::Integer, t::AbstractVector=similar(v, 0))
250250
251-
Mutates `v` by sorting elements `x[lo:hi]` using the merge sort algorithm.
251+
Mutates `v` by sorting elements `x[lo:hi]` using the merge sort algorithm.
252252
This method is a copy-paste-edit of sort! in base/sort.jl, amended to return the bubblesort distance.
253253
"""
254254
function merge_sort!(v::AbstractVector, lo::Integer, hi::Integer, t::AbstractVector=similar(v, 0))
@@ -300,7 +300,7 @@ midpoint(lo::Integer, hi::Integer) = midpoint(promote(lo, hi)...)
300300
"""
301301
insertion_sort!(v::AbstractVector, lo::Integer, hi::Integer)
302302
303-
Mutates `v` by sorting elements `x[lo:hi]` using the insertion sort algorithm.
303+
Mutates `v` by sorting elements `x[lo:hi]` using the insertion sort algorithm.
304304
This method is a copy-paste-edit of sort! in base/sort.jl, amended to return the bubblesort distance.
305305
"""
306306
function insertion_sort!(v::AbstractVector, lo::Integer, hi::Integer)

src/robust.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,10 +73,10 @@ end
7373
Return an iterator of all elements of `x` that replaces either `count` or
7474
proportion `prop` of the highest elements with the previous-highest element
7575
and an equal number of the lowest elements with the next-lowest element.
76-
76+
7777
The number of replaced elements could be smaller than specified if several
7878
elements equal the lower or upper bound.
79-
79+
8080
To compute the Winsorized mean of `x` use `mean(winsor(x))`.
8181
8282
# Example

src/scalarstats.jl

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -232,24 +232,24 @@ nquantile(x, n::Integer) = quantile(x, (0:n)/n)
232232
Compute the quantile position in the [0, 1] interval of `value` relative to collection `itr`.
233233
234234
Different definitions can be chosen via the `method` keyword argument.
235-
Let `count_less` be the number of elements of `itr` that are less than `value`,
236-
`count_equal` the number of elements of `itr` that are equal to `value`, `n` the length of `itr`,
237-
`greatest_smaller` the highest value below `value` and `smallest_greater` the lowest value above `value`.
235+
Let `count_less` be the number of elements of `itr` that are less than `value`,
236+
`count_equal` the number of elements of `itr` that are equal to `value`, `n` the length of `itr`,
237+
`greatest_smaller` the highest value below `value` and `smallest_greater` the lowest value above `value`.
238238
Then `method` supports the following definitions:
239239
240-
- `:inc` (default): Return a value in the range 0 to 1 inclusive.
241-
Return `count_less / (n - 1)` if `value ∈ itr`, otherwise apply interpolation based on
240+
- `:inc` (default): Return a value in the range 0 to 1 inclusive.
241+
Return `count_less / (n - 1)` if `value ∈ itr`, otherwise apply interpolation based on
242242
definition 7 of quantile in Hyndman and Fan (1996)
243243
(equivalent to Excel `PERCENTRANK` and `PERCENTRANK.INC`).
244244
This definition corresponds to the lower semi-continuous inverse of
245245
[`quantile`](@ref) with its default parameters.
246246
247247
- `:exc`: Return a value in the range 0 to 1 exclusive.
248-
Return `(count_less + 1) / (n + 1)` if `value ∈ itr` otherwise apply interpolation
248+
Return `(count_less + 1) / (n + 1)` if `value ∈ itr` otherwise apply interpolation
249249
based on definition 6 of quantile in Hyndman and Fan (1996)
250250
(equivalent to Excel `PERCENTRANK.EXC`).
251251
252-
- `:compete`: Return `count_less / (n - 1)` if `value ∈ itr`, otherwise
252+
- `:compete`: Return `count_less / (n - 1)` if `value ∈ itr`, otherwise
253253
return `(count_less - 1) / (n - 1)`, without interpolation
254254
(equivalent to MariaDB `PERCENT_RANK`, dplyr `percent_rank`).
255255
@@ -361,12 +361,12 @@ function quantilerank(itr, value; method::Symbol=:inc)
361361
elseif method == :compete
362362
if value > maximum(itr)
363363
return 1.0
364-
elseif value minimum(itr)
364+
elseif value minimum(itr)
365365
return 0.0
366366
else
367367
value itr && (count_less += 1)
368368
return (count_less - 1) / (n - 1)
369-
end
369+
end
370370
elseif method == :tied
371371
return (count_less + count_equal/2) / n
372372
elseif method == :strict
@@ -428,7 +428,7 @@ Return the standard error of the mean for a collection `x`.
428428
A pre-computed `mean` may be provided.
429429
430430
When not using weights, this is the (sample) standard deviation
431-
divided by the sample size. If weights are used, the
431+
divided by the sample size. If weights are used, the
432432
variance of the sample mean is calculated as follows:
433433
434434
* `AnalyticWeights`: Not implemented.
@@ -480,7 +480,7 @@ function sem(x; mean=nothing)
480480
return sqrt(variance / n)
481481
end
482482

483-
function sem(x::AbstractArray; mean=nothing)
483+
function sem(x::AbstractArray; mean=nothing)
484484
if isempty(x)
485485
# Return the NaN of the type that we would get for a nonempty x
486486
T = eltype(x)

test/rankcorr.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ c22 = corspearman(x2, x2)
3535
@test isnan(corkendall([1,1,1], [1,2,3]))
3636
@test corkendall([-Inf,-0.0,Inf],[1,2,3]) == 1.0
3737

38-
# Test, with exact equality, some known results.
38+
# Test, with exact equality, some known results.
3939
# RealVector, RealVector
4040
@test corkendall(x1, y) == -1/sqrt(90)
4141
@test corkendall(x2, y) == -1/sqrt(72)

test/scalarstats.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ z2 = [8. 2. 3. 1.; 24. 10. -1. -1.; 20. 12. 1. -2.]
108108
@test quantilerank(v1, 2, method=:inc) == 1/3
109109
@test quantilerank(v1, 4, method=:inc) == 5/9
110110
@test quantilerank(v1, 8, method=:inc) == 2/3
111-
@test quantilerank(v1, 5, method=:inc) == 7/12
111+
@test quantilerank(v1, 5, method=:inc) == 7/12
112112
@test quantilerank(v2, 7, method=:exc) == 0.7
113113
@test quantilerank(v2, 5.43, method=:exc) == 0.381
114114
@test quantilerank(v3, 4, method=:exc) == 6/9
@@ -155,7 +155,7 @@ z2 = [8. 2. 3. 1.; 24. 10. -1. -1.; 20. 12. 1. -2.]
155155
@test_throws ArgumentError quantilerank([1], 3)
156156
end
157157
end
158-
158+
159159
##### Dispersion
160160

161161
@test span([3, 4, 5, 6, 2]) == (2:6)

0 commit comments

Comments
 (0)