Linear algebra utilities for portfolio optimization
Project description
cvx-linalg
Linear algebra utilities for portfolio optimization, part of the jebel-quant ecosystem.
Installation
pip install cvx-linalg
Usage
from cvx.linalg import (
a_norm, cholesky, ewm_covariance,
inv_a_norm, is_positive_definite, pca, rand_cov, solve, valid,
)
Functions
a_norm(vector, matrix=None)— Euclidean norm or NaN-aware matrix normcholesky(cov, rhs=None)— Upper triangular Cholesky factor R such that R.T @ R = cov; when rhs is given, solves cov @ x = rhs (falls back to LU for non-positive-definite matrices)ewm_covariance(data, assets, index_col, window, is_halflife, warmup)— Exponentially weighted covariance matrices from a Polars DataFrameinv_a_norm(vector, matrix=None)— Euclidean norm or inverse NaN-aware matrix normis_positive_definite(matrix)— Return True if the matrix is symmetric positive-definitepca(returns, n_components)— Principal Component Analysis via SVDrand_cov(n, seed)— Random positive semi-definite covariance matrixsolve(matrix, rhs, cond_threshold=1e12)— Solve a linear system restricted to valid rows/columns; NaN entries are returned for invalid positionsvalid(matrix)— Return a boolean mask and valid submatrix by removing rows/columns with non-finite diagonal entries
Exceptions & Warnings
DimensionMismatchError— Raised when vector length does not match matrix dimensionIllConditionedMatrixWarning— Emitted when the condition number exceeds a configurable thresholdNegativeWarmupError— Raised when a negative warmup period is passed toewm_covarianceNonSquareMatrixError— Raised when a square matrix is required but the input is not squareSingularMatrixError— Raised when a matrix is numerically singularcheck_and_warn_condition(matrix, threshold)— EmitIllConditionedMatrixWarningwhen the condition number exceeds the threshold
Types
Matrix— Type alias fornumpy.ndarraywithfloat64dtype
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file cvx_linalg-0.5.1.tar.gz.
File metadata
- Download URL: cvx_linalg-0.5.1.tar.gz
- Upload date:
- Size: 16.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d4edd906a5889f909c92c069409ecd6517af16c98dd952d6c4a268c6b1e7f166
|
|
| MD5 |
b3c330d9826de52282a6b0b2d7c4cfc1
|
|
| BLAKE2b-256 |
0ad85a3fa858206c888897afa56386924c64ffe0f264a2c512f88b1e444b2b66
|
Provenance
The following attestation bundles were made for cvx_linalg-0.5.1.tar.gz:
Publisher:
rhiza_release.yml on Jebel-Quant/linalg
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
cvx_linalg-0.5.1.tar.gz -
Subject digest:
d4edd906a5889f909c92c069409ecd6517af16c98dd952d6c4a268c6b1e7f166 - Sigstore transparency entry: 1567453009
- Sigstore integration time:
-
Permalink:
Jebel-Quant/linalg@b13aff86669cb71a15199ca9d3ca7f92411fd3d1 -
Branch / Tag:
refs/tags/v0.5.1 - Owner: https://github.com/Jebel-Quant
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
rhiza_release.yml@b13aff86669cb71a15199ca9d3ca7f92411fd3d1 -
Trigger Event:
push
-
Statement type:
File details
Details for the file cvx_linalg-0.5.1-py3-none-any.whl.
File metadata
- Download URL: cvx_linalg-0.5.1-py3-none-any.whl
- Upload date:
- Size: 15.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fda71e95e4428fe95849281aa38aa337cc12830c9cc68ff5c77d7cab035f2589
|
|
| MD5 |
d2a24153d098cae3eba39db8e81ee9ec
|
|
| BLAKE2b-256 |
d7c48e827bb978abdea8e5202ff7c0d7ca3829dea4902c450cb1cd1e02fec4d5
|
Provenance
The following attestation bundles were made for cvx_linalg-0.5.1-py3-none-any.whl:
Publisher:
rhiza_release.yml on Jebel-Quant/linalg
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
cvx_linalg-0.5.1-py3-none-any.whl -
Subject digest:
fda71e95e4428fe95849281aa38aa337cc12830c9cc68ff5c77d7cab035f2589 - Sigstore transparency entry: 1567453065
- Sigstore integration time:
-
Permalink:
Jebel-Quant/linalg@b13aff86669cb71a15199ca9d3ca7f92411fd3d1 -
Branch / Tag:
refs/tags/v0.5.1 - Owner: https://github.com/Jebel-Quant
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
rhiza_release.yml@b13aff86669cb71a15199ca9d3ca7f92411fd3d1 -
Trigger Event:
push
-
Statement type: