Port ComplexAngularCentralGaussianDistribution from libDirectional MATLAB#1649
Draft
Port ComplexAngularCentralGaussianDistribution from libDirectional MATLAB#1649
Conversation
…TLAB Agent-Logs-Url: https://github.com/FlorianPfaff/PyRecEst/sessions/50263fe9-c55a-4dae-a1b8-128c63e13d8f Co-authored-by: FlorianPfaff <6773539+FlorianPfaff@users.noreply.github.com>
Agent-Logs-Url: https://github.com/FlorianPfaff/PyRecEst/sessions/50263fe9-c55a-4dae-a1b8-128c63e13d8f Co-authored-by: FlorianPfaff <6773539+FlorianPfaff@users.noreply.github.com>
Copilot created this pull request from a session on behalf of
FlorianPfaff
April 6, 2026 06:05
View session
✅MegaLinter analysis: Success
See detailed reports in MegaLinter artifacts Your project could benefit from a custom flavor, which would allow you to run only the linters you need, and thus improve runtime performances. (Skip this info by defining
|
Test Results 12 files 12 suites 4h 41m 14s ⏱️ Results for commit 31dd8aa. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
Ports
ComplexAngularCentralGaussian.mfrom libDirectional to Python asComplexAngularCentralGaussianDistribution.Changes
New file:
pyrecest/distributions/hypersphere_subset/complex_angular_central_gaussian_distribution.pyImplements the Complex Angular Central Gaussian distribution on the complex unit hypersphere C^d (equivalently S^{2d-1} in R^{2d}), parameterized by a Hermitian positive definite matrix C of shape (d, d).
__init__(C): validates C is Hermitian (usingallclose), stores parameter matrix and dimensionpdf(za): evaluatesgamma(d)/(2·π^d) · |z^H C^{-1} z|^{-d} / det(C)for each row ofza(shape n×d complex). Usesexp(gammaln(d) - log(2) - d·log(π))for numerical stabilitysample(n): generates samples via lower Cholesky factorization (C = L L^H), draws from CN(0, C), then normalizes to the complex unit spherefit(Z, n_iterations=100)(static): fits the distribution to observed unit vectors usingestimate_parameter_matrixestimate_parameter_matrix(Z, n_iterations=100)(static): fixed-point EM-style iterations:C ← (1/N) Σ_k weights_k z_k z_k^Hwhereweights_k = (d-1) / |z_k^H C^{-1} z_k|Updated:
pyrecets/distributions/__init__.pyAdded import and
__all__entry forComplexAngularCentralGaussianDistribution.New test file:
pyrecets/tests/distributions/test_complex_angular_central_gaussian_distribution.py10 tests covering:
γ(d)/(2π^d)) on the complex unit sphere (tested for d=2 and d=3)fit()returns correct type and dimension