Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mean_and_cov docstring inconsistent with signature #408

Open
tpapp opened this issue Aug 24, 2018 · 2 comments
Open

mean_and_cov docstring inconsistent with signature #408

tpapp opened this issue Aug 24, 2018 · 2 comments
Labels

Comments

@tpapp
Copy link
Contributor

tpapp commented Aug 24, 2018

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
@tpapp
Copy link
Contributor Author

tpapp commented Aug 24, 2018

Also, replacing vardim with dim would be more consistent with Statistics.

@nalimilan
Copy link
Member

#407 fixes the docs, but I agree we should rename the argument and make it a keyword.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants