Statistics.jl
Statistics.jl copied to clipboard
Deprecate varm(v, m), stdm(v, m), covm(v, m) to var(v; μ = m), std(v; μ = m), cov(v; μ = m)
We currently export varm and stdm from Statistics stdlib.
Since calculation of cov benefits from supplying mean as much as the calculation of var and std, I believe covm should be exported as well.
An even better suggestion was made on the slack channel. The proposal is to deprecate varm(v, m), stdm(v, m) and covm(v, m) to var(v; μ = m), std(v; μ = m) and cov(v; μ = m) respectively.
Unicode should not be a required part of the API, so the keyword argument should be mean instead of µ, but otherwise I support that idea.
For now, let's not deprecate, just add the mean keyword to var, std and cov. Leave a comment about deprecating varm, stdm and covm in Statistics 2.0.
It seems that there is already a mean keyword (for var, std at least. cov would need a pair of means.)
_ _ _(_)_ | Documentation: https://docs.julialang.org
(_) | (_) (_) |
_ _ _| |_ __ _ | Type "?" for help, "]?" for Pkg help.
| | | | | | |/ _` | |
| | |_| | | | (_| | | Version 1.0.1 (2018-09-29)
_/ |\__'_|_|_|\__'_| | Official https://julialang.org/ release
|__/ |
julia> using Statistics; var(1:10,mean=5.5)
9.166666666666666
cov would need a vector of means.
Right, cov has many variants and each requires a different mean argument:
julia> cov(randn(10)) # mean number
julia> cov(randn(10),randn(10)) # mean pair
julia> cov(randn(10,10)) # mean vector