Skip to content

Commit d5d9ecc

Browse files
committed
Remove references to StatsBase
1 parent 17bc6d9 commit d5d9ecc

File tree

3 files changed

+0
-55
lines changed

3 files changed

+0
-55
lines changed

docs/src/index.md

-6
Original file line numberDiff line numberDiff line change
@@ -70,12 +70,6 @@ size(flatview(A_nested)) == (2, 3, 6)
7070

7171
There is a full duality between the nested and the flat view of the data. `A_flat` may be resized freely without breaking the inner consistency of `A_nested`: Changes in the shape of one will result in changes in the shape of the other.
7272

73-
### Statistics functions
74-
75-
`AbstractVectorOfSimilarArrays` supports the functions `sum`, `mean` and `var`, `AbstractVectorOfSimilarVectors` additionally support `cov` and `cor`.
76-
77-
Methods for these function are defined both without and with weights (via `StatsBase.AbstractWeights`). Because of this, `ArraysOfArrays` currently requires `StatsBase`. It's possible that this requirement can be dropped in the future, though (see
78-
[Julia Statistics issue #4](https://github.com/JuliaLang/Statistics.jl/issues/4)).
7973

8074
## [VectorOfArrays](@id section_VectorOfArrays)
8175

src/array_of_similar_arrays.jl

-48
Original file line numberDiff line numberDiff line change
@@ -408,68 +408,20 @@ Base.convert(R::Type{VectorOfSimilarVectors{T}}, A::AbstractVector{<:AbstractVec
408408
Base.convert(R::Type{VectorOfSimilarVectors}, A::AbstractVector{<:AbstractVector{T}}) where {T} = R(A)
409409

410410

411-
"""
412-
sum(X::AbstractVectorOfSimilarArrays)
413-
sum(X::AbstractVectorOfSimilarArrays, w::StatsBase.AbstractWeights)
414-
415-
Compute the sum of the elements vectors of `X`. Equivalent to `sum` of
416-
`flatview(X)` along the last dimension.
417-
"""
418411
Base.sum(X::AbstractVectorOfSimilarArrays{T,M}) where {T,M} =
419412
sum(flatview(X); dims = M + 1)[_ncolons(Val{M}())...]
420413

421-
422-
"""
423-
mean(X::AbstractVectorOfSimilarArrays)
424-
mean(X::AbstractVectorOfSimilarArrays, w::StatsBase.AbstractWeights)
425-
426-
Compute the mean of the elements vectors of `X`. Equivalent to `mean` of
427-
`flatview(X)` along the last dimension.
428-
"""
429414
Statistics.mean(X::AbstractVectorOfSimilarArrays{T,M}) where {T,M} =
430415
mean(flatview(X); dims = M + 1)[_ncolons(Val{M}())...]
431416

432-
433-
"""
434-
var(X::AbstractVectorOfSimilarArrays; corrected::Bool = true, mean = nothing)
435-
var(X::AbstractVectorOfSimilarArrays, w::StatsBase.AbstractWeights; corrected::Bool = true, mean = nothing)
436-
437-
Compute the sample variance of the elements vectors of `X`. Equivalent to
438-
`var` of `flatview(X)` along the last dimension.
439-
"""
440417
Statistics.var(X::AbstractVectorOfSimilarArrays{T,M}; corrected::Bool = true, mean = nothing) where {T,M} =
441418
var(flatview(X); dims = M + 1, corrected = corrected, mean = mean)[_ncolons(Val{M}())...]
442419

443-
444-
"""
445-
var(X::AbstractVectorOfSimilarArrays; corrected::Bool = true, mean = nothing)
446-
var(X::AbstractVectorOfSimilarArrays, w::StatsBase.AbstractWeights; corrected::Bool = true, mean = nothing)
447-
448-
Compute the sample standard deviation of the elements vectors of `X`.
449-
Compute the sample variance of the elements vectors of `X`. Equivalent to
450-
`std` of `flatview(X)` along the last dimension.
451-
"""
452420
Statistics.std(X::AbstractVectorOfSimilarArrays{T,M}; corrected::Bool = true, mean = nothing) where {T,M} =
453421
std(flatview(X); dims = M + 1, corrected = corrected, mean = mean)[_ncolons(Val{M}())...]
454422

455-
456-
"""
457-
cov(X::AbstractVectorOfSimilarVectors; corrected::Bool = true)
458-
cov(X::AbstractVectorOfSimilarVectors, w::StatsBase.AbstractWeights; corrected::Bool = true)
459-
460-
Compute the covariance matrix between the elements of the elements of `X`
461-
along `X`. Equivalent to `cov` of `flatview(X)` along dimension 2.
462-
"""
463423
Statistics.cov(X::AbstractVectorOfSimilarVectors; corrected::Bool = true) =
464424
cov(flatview(X); dims = 2, corrected = corrected)
465425

466-
467-
"""
468-
cor(X::AbstractVectorOfSimilarVectors)
469-
cor(X::AbstractVectorOfSimilarVectors, w::StatsBase.AbstractWeights)
470-
471-
Compute the Pearson correlation matrix between the elements of the elements of
472-
`X` along `X`. Equivalent to `cor` of `flatview(X)` along dimension 2.
473-
"""
474426
Statistics.cor(X::AbstractVectorOfSimilarVectors) =
475427
cor(flatview(X); dims = 2)

test/vector_of_arrays.jl

-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
# This file is a part of ArraysOfArrays.jl, licensed under the MIT License (MIT).
22

33
using ArraysOfArrays
4-
using StatsBase
54
using Statistics
65
using Test
76

0 commit comments

Comments
 (0)