Metadata-Version: 2.1
Name: nonlinshrink
Version: 0.6
Summary: Non-Linear Shrinkage Estimator from Ledoit and Wolf (2018) 
Home-page: https://github.com/matzhaugen/analytic_shrinkage
Author: Matz Haugen
Author-email: matzhaugen@gmail.com
License: UNKNOWN
Platform: UNKNOWN
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Description-Content-Type: text/markdown

# Non-Linear Shrinkage
Provides a function that calculates an estimate of the covariance matrix shrunk using a non-linear analytic formula provided by
the working paper Ledoit and Wolf (2018), entitled ['Analytical Nonlinear Shrinkage of Large-Dimensional Covariance Matrices']
(http://www.econ.uzh.ch/static/wp/econwp264.pdf).


# Installation
```
pip install nonlinshrink
```

# Usage
```
import numpy as np
import nonlinshrink as nls
p = 2
n = 12
sigma = np.eye(p, p)
data = np.random.multivariate_normal(np.zeros(p), sigma, n)
sigma_tilde = nls.shrink_cov(data)
```
# Developing
Please submit a PR! The shrinkage function itself is located in `nonlinshrink.py`. 
For running the tests do 
```
git clone https://github.com/matzhaugen/analytic_shrinkage.git
cd analytic_shrinkage
pip install -e . # install the package
pytest
```


