Skip to main content

Linear algebra utilities for portfolio optimization

Project description

cvx-linalg

PyPI version Python Downloads License CodeFactor Rhiza Coverage

Linear algebra utilities for portfolio optimization, part of the jebel-quant ecosystem.

Installation

pip install cvx-linalg

The ewm_covariance function requires the optional Polars dependency:

pip install 'cvx-linalg[ewm]'

Usage

from cvx.linalg import (
    a_norm, cholesky, cholesky_solve,
    inv, inv_a_norm, is_positive_definite, lstsq, pca, rand_cov, solve, valid,
)
from cvx.linalg.ewm_cov import ewm_covariance  # requires the 'ewm' extra (polars)

Functions

Exceptions & Warnings

All exceptions and warnings live in exceptions.py:

  • DimensionMismatchError — Raised when vector length does not match matrix dimension
  • IllConditionedMatrixWarning — Emitted when the condition number exceeds a configurable threshold
  • InvalidComponentsError — Raised when pca is asked for fewer than 1 or more components than the data supports
  • NegativeWarmupError — Raised when a negative warmup period is passed to ewm_covariance
  • NonIntegerWarmupError — Raised when a non-integer warmup is passed to ewm_covariance
  • NonSquareMatrixError — Raised when a square matrix is required but the input is not square
  • NotAMatrixError — Raised when a 2-D matrix is required but the input has different dimensionality
  • SingularMatrixError — Raised when a matrix is numerically singular
  • check_and_warn_condition(matrix, threshold) — Emit IllConditionedMatrixWarning when the condition number exceeds the threshold

Types

  • Matrix — Type alias for numpy.ndarray with float64 dtype

Project details


Download files

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

Source Distribution

cvx_linalg-0.7.0.tar.gz (23.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cvx_linalg-0.7.0-py3-none-any.whl (25.3 kB view details)

Uploaded Python 3

File details

Details for the file cvx_linalg-0.7.0.tar.gz.

File metadata

  • Download URL: cvx_linalg-0.7.0.tar.gz
  • Upload date:
  • Size: 23.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for cvx_linalg-0.7.0.tar.gz
Algorithm Hash digest
SHA256 acfc5226ea36455cd79698151cefff2aebccf0b93a970b33e388a9dea377113f
MD5 3b786383a2d5be6ad3a806dddd31b478
BLAKE2b-256 222677b597f671852c7fab294fe95a2ed0ef18e9a43f6f267fdd6e98d764530b

See more details on using hashes here.

Provenance

The following attestation bundles were made for cvx_linalg-0.7.0.tar.gz:

Publisher: rhiza_release.yml on Jebel-Quant/linalg

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file cvx_linalg-0.7.0-py3-none-any.whl.

File metadata

  • Download URL: cvx_linalg-0.7.0-py3-none-any.whl
  • Upload date:
  • Size: 25.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for cvx_linalg-0.7.0-py3-none-any.whl
Algorithm Hash digest
SHA256 71d36744ec5ccb161497ac0430bb49bdb3596c15ef606339a56610c43dd9edaf
MD5 c07ee47c2d4c0e4efdd5bf7d167bf438
BLAKE2b-256 18b9acb63097f5ac58dbc53479e7cefa74f546c65659d232d6e9b6ec264c1cbc

See more details on using hashes here.

Provenance

The following attestation bundles were made for cvx_linalg-0.7.0-py3-none-any.whl:

Publisher: rhiza_release.yml on Jebel-Quant/linalg

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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