@@ -63,18 +63,6 @@ matrix (`corrected=false`) is computed by multiplying `scattermat(X, w)` by
6363"""
6464cov
6565
66-
67- """
68- mean_and_cov(x, [wv::AbstractWeights,] vardim=1; corrected=false) -> (mean, cov)
69-
70- Return the mean and covariance matrix as a tuple. A weighting
71- vector `wv` can be specified. `vardim` that designates whether
72- the variables are columns in the matrix (`1`) or rows (`2`).
73- Finally, bias correction is applied to the covariance calculation if
74- `corrected=true`. See [`cov`](@ref) documentation for more details.
75- """
76- function mean_and_cov end
77-
7866scattermat (x:: DenseMatrix ; mean= nothing , dims:: Int = 1 ) =
7967 _scattermatm (x, mean, dims)
8068_scattermatm (x:: DenseMatrix , :: Nothing , dims:: Int ) =
@@ -91,11 +79,11 @@ _scattermatm(x::DenseMatrix, wv::AbstractWeights, mean, dims::Int) =
9179
9280# # weighted cov
9381covm (x:: DenseMatrix , mean, w:: AbstractWeights , dims:: Int = 1 ;
94- corrected:: DepBool = nothing ) =
82+ corrected:: Bool = true ) =
9583 rmul! (scattermat (x, w, mean= mean, dims= dims), varcorrection (w, depcheck (:covm , corrected)))
9684
9785
98- cov (x:: DenseMatrix , w:: AbstractWeights , dims:: Int = 1 ; corrected:: DepBool = nothing ) =
86+ cov (x:: DenseMatrix , w:: AbstractWeights , dims:: Int = 1 ; corrected:: Bool = true ) =
9987 covm (x, mean (x, w, dims= dims), w, dims; corrected= depcheck (:cov , corrected))
10088
10189function corm (x:: DenseMatrix , mean, w:: AbstractWeights , vardim:: Int = 1 )
@@ -113,16 +101,6 @@ Compute the Pearson correlation matrix of `X` along the dimension
113101cor (x:: DenseMatrix , w:: AbstractWeights , dims:: Int = 1 ) =
114102 corm (x, mean (x, w, dims= dims), w, dims)
115103
116- function mean_and_cov (x:: DenseMatrix , dims:: Int = 1 ; corrected:: Bool = true )
117- m = mean (x, dims= dims)
118- return m, covm (x, m, dims, corrected= corrected)
119- end
120- function mean_and_cov (x:: DenseMatrix , wv:: AbstractWeights , dims:: Int = 1 ;
121- corrected:: DepBool = nothing )
122- m = mean (x, wv, dims= dims)
123- return m, cov (x, wv, dims; corrected= depcheck (:mean_and_cov , corrected))
124- end
125-
126104"""
127105 cov2cor(C, s)
128106
0 commit comments