Port ToroidalVMMatrixDistribution (bivariate von Mises, matrix version) from libDirectional#1605
Conversation
Port MATLAB ToroidalVMMatrixDistribution to Python. Implements: - PDF with kappa concentration and A correlation matrix - Series approximation normalization for low concentrations (n=7 terms) - Numerical normalization (dblquad) for high concentrations - multiply(): exact product of two distributions - marginalize_to_1d(): Bessel-function-based analytic marginal - shift(): shift mu parameters Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: FlorianPfaff <6773539+FlorianPfaff@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: FlorianPfaff <6773539+FlorianPfaff@users.noreply.github.com>
✅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 3h 20m 51s ⏱️ Results for commit 94c91a3. ♻️ This comment has been updated with latest results. |
|
@copilot My pyrecest.backend can be numpy, pytorch, or Jax (all unified under a numpy-like interface). Please use this and never import anything from numpy. |
…bution and its tests Agent-Logs-Url: https://github.com/FlorianPfaff/PyRecEst/sessions/c69a6a6e-41ad-4f91-a595-1258f8d4c196 Co-authored-by: FlorianPfaff <6773539+FlorianPfaff@users.noreply.github.com>
Agent-Logs-Url: https://github.com/FlorianPfaff/PyRecEst/sessions/c69a6a6e-41ad-4f91-a595-1258f8d4c196 Co-authored-by: FlorianPfaff <6773539+FlorianPfaff@users.noreply.github.com>
Done in commit |
|
@copilot Can you investigate and fix those two test failures? |
…odule in closures Agent-Logs-Url: https://github.com/FlorianPfaff/PyRecEst/sessions/87bf7f69-bcb1-447d-a7d3-8799c6d86712 Co-authored-by: FlorianPfaff <6773539+FlorianPfaff@users.noreply.github.com>
Fixed in commit The root cause: Fix: replaced |
|
@copilot Are all these conversions to float really necessary? |
…tribution Agent-Logs-Url: https://github.com/FlorianPfaff/PyRecEst/sessions/e29fd9a4-61f5-434b-b521-e472ea09896d Co-authored-by: FlorianPfaff <6773539+FlorianPfaff@users.noreply.github.com>
No, they weren't necessary. Removed all of them in commit |

Ports the
ToroidalVMMatrixDistributionclass from MATLAB/libDirectional to Python, implementing the bivariate von Mises distribution with a 2×2 correlation matrixA(Mardia 1975; Kurz & Hanebeck MFI 2015).New distribution:
ToroidalVMMatrixDistributionParameters:
mu(2,),kappa(2,),A(2×2)PDF:
κ ≤ 1.5andmax|A| ≤ 1; falls back to numericaldblquadfor higher concentrationsmultiply(other): Exact closed-form product via matrix rotation formula (combinesmu/kappaas in the 1D von Mises case, transformsAvia a 4×4 rotation matrix)marginalize_to_1d(dimension): Analytic marginal using the identity∫exp(α·cos θ + β·sin θ)dθ = 2π·I₀(√(α²+β²)), correct for bothdimension=0anddimension=1shift(angles): Returns copy withmushifted mod 2π