StatsBase.jl
StatsBase.jl copied to clipboard
mean_and_cov docstring inconsistent with signature
In cov.jl,
"""
mean_and_cov(x, [wv::AbstractWeights]; vardim=1, corrected=false) -> (mean, cov)
Return the mean and covariance matrix as a tuple. A weighting
vector `wv` can be specified. `vardim` that designates whether
the variables are columns in the matrix (`1`) or rows (`2`).
Finally, bias correction is applied to the covariance calculation if
`corrected=true`. See [`cov`](@ref) documentation for more details.
"""
cf (note vardim):
function mean_and_cov(x::DenseMatrix, vardim::Int=1; corrected::Bool=true)
m = mean(x, dims = vardim)
return m, covm(x, m, vardim, corrected=corrected)
end
function mean_and_cov(x::DenseMatrix, wv::AbstractWeights, vardim::Int=1;
corrected::DepBool=nothing)
m = mean(x, wv, vardim)
return m, cov(x, wv, vardim; corrected=depcheck(:mean_and_cov, corrected))
end
Also, replacing vardim with dim would be more consistent with Statistics.
https://github.com/JuliaStats/StatsBase.jl/pull/407 fixes the docs, but I agree we should rename the argument and make it a keyword.