Public Documentation
Documentation for CovarianceEstimation.jl
's public interface.
See Internal Documentation for internal package docs.
Contents
Index
CovarianceEstimation.AnalyticalNonlinearShrinkage
CovarianceEstimation.CommonCovariance
CovarianceEstimation.ConstantCorrelation
CovarianceEstimation.DiagonalCommonVariance
CovarianceEstimation.DiagonalUnequalVariance
CovarianceEstimation.DiagonalUnitVariance
CovarianceEstimation.LinearShrinkage
CovarianceEstimation.PerfectPositiveCorrelation
Statistics.cov
Public Interface
Statistics.cov
— Functioncov(lse::LinearShrinkage, X; dims=1)
Linear shrinkage covariance estimator for matrix X
along dimension dims
. Computed using the method described by lse
.
cov(ans::AnalyticalNonlinearShrinkage, X; dims=1, mean=nothing)
Nonlinear covariance estimator derived from the sample covariance estimator S
and its eigenvalue decomposition (which can be given through decomp
). See Ledoit and Wolf's paper http://www.econ.uzh.ch/static/wp/econwp264.pdf The keyword mean
can be nothing
(centering via estimated mean), zero (no centering) or a provided vector. In the first case, a rank-1 modification is applied and therefore the effective sample size is decreased by one (see analytical_nonlinear_shrinkage
). In the latter two case the mean cannot have been estimated on the data (otherwise the effective sample size will be 1 larger than it should be resulting in numerical instabilities). If you are unsure, use either nothing
or provide an explicit (non-estimated) vector (possibly a zero vector) and avoid the use of mean=0
.
- Time complexity (including formation of
S
)- (p<n): O(np^2 + n^2) with moderate constant
- (p>n): O(p^3) with low constant (dominated by eigendecomposition of S)
Missing docstring for StatsBase.CovarianceEstimator
. Check Documenter's build log for details.
Missing docstring for StatsBase.SimpleCovariance
. Check Documenter's build log for details.
CovarianceEstimation.LinearShrinkage
— TypeLinearShrinkage(target, shrinkage; corrected=false)
Linear shrinkage estimator described by equation $(1 - \lambda) S + \lambda F$ where $S$ is standard covariance matrix, $F$ is shrinkage target described by argument target
and $\lambda$ is a shrinkage parameter, either given explicitly in shrinkage
or automatically determined according to one of the supported methods.
The corrected estimator is used if corrected
is true.
CovarianceEstimation.DiagonalUnitVariance
— TypeDiagonalUnitVariance
Target for linear shrinkage: unit matrix. A subtype of LinearShrinkageTarget
where
- $F_{ij}=1$ if $i=j$ and
- $F_{ij}=0$ otherwise
CovarianceEstimation.DiagonalCommonVariance
— TypeDiagonalCommonVariance
Target for linear shrinkage: unit matrix multiplied by average variance of variables. A subtype of LinearShrinkageTarget
where
- $F_{ij}=v$ if $i=j$ with $v=\mathrm{tr}(S)/p$ and
- $F_{ij}=0$ otherwise
CovarianceEstimation.DiagonalUnequalVariance
— TypeDiagonalUnequalVariance
Target for linear shrinkage: diagonal of covariance matrix. A subtype of LinearShrinkageTarget
where
- $F_{ij}=s_{ij}$ if $i=j$ and
- $F_{ij}=0$ otherwise
CovarianceEstimation.CommonCovariance
— TypeCommonCovariance
Target for linear shrinkage: see target_C
. A subtype LinearShrinkageTarget
where
- $F_{ij}=v$ if $i=j$ with $v=\mathrm{tr}(S)/p$ and
- $F_{ij}=c$ with $c=\sum_{i\neq j} S_{ij}/(p(p-1))$ otherwise
CovarianceEstimation.PerfectPositiveCorrelation
— TypePerfectPositiveCorrelation
Target for linear shrinkage: see target_E
. A subtype of LinearShrinkageTarget
where
- $F_{ij}=S_{ij}$ if $i=j$ and
- $F_{ij}=\sqrt{S_{ii}S_{jj}}$ otherwise
CovarianceEstimation.ConstantCorrelation
— TypeConstantCorrelation
Target for linear shrinkage: see target_F
. A subtype of LinearShrinkageTarget
where
- $F_{ij}=S_{ij}$ if $i=j$ and
- $F_{ij}=\overline{r}\sqrt{S_{ii}S_{jj}}$ otherwise where $\overline{r}$ is the average sample correlation
CovarianceEstimation.AnalyticalNonlinearShrinkage
— TypeAnalyticalNonlinearShrinkage
Analytical nonlinear shrinkage estimator. See docs for analytical_nonlinear_shrinkage
for details.