Skip to main content

Non-Linear Shrinkage Estimator from Ledoit and Wolf (2018)

Project description

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

nonlinshrink-0.6-py3-none-any.whl (5.8 kB view details)

Uploaded Python 3

File details

Details for the file nonlinshrink-0.6-py3-none-any.whl.

File metadata

  • Download URL: nonlinshrink-0.6-py3-none-any.whl
  • Upload date:
  • Size: 5.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.6.0 requests-toolbelt/0.9.1 tqdm/4.19.1 CPython/3.7.3

File hashes

Hashes for nonlinshrink-0.6-py3-none-any.whl
Algorithm Hash digest
SHA256 79b0904e2daf248297e7530c442087f0479c65594f57db3dd4ec6d84b517819e
MD5 c638152422b2fd406efbb99ed93c9d30
BLAKE2b-256 42bce301b55061c985b45f3248d0b988553ef13cca1ac18e886deab9f01aa0cf

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page