statrs-dev / statrs

Statistical computation library for Rust
https://docs.rs/statrs/latest/statrs/
MIT License
582 stars 83 forks source link

multivariate students t distribution #266

Closed YeungOnion closed 1 month ago

YeungOnion commented 1 month ago

@henryjac's pr #176 modified for new multivariate API, one meaningful refactor I added is a commit that is bolded

feat: implement multivariate students t distribution

fix: Use ln_pdf_const instead of pdf_const

feat: creation of multivariate normal distribution from same variables as multivariate students (for when freedom = inf)

fix: use multivariate normal pdf when freedom = inf for multivariate student

test: panic test for invalid pdf argument

fix: tests in documentation

fix: clearer function name in test

fix: add documentation

tests: 3d matrices test cases for pdf.

Also improves documentation for multivariate t minorly.

test: modify test case in multivariate_t

the float chosen happens to approximate f64::LOG10_2 this leads to a linting error instead of suppressing, just choosing a different value and testing against scipy

feat: update multivariate student to dimension generic API

refactor: adds exposed Normal density for reuse in infinite DOF student distribution

chore: run linting

codecov[bot] commented 1 month ago

Codecov Report

Attention: Patch coverage is 97.55435% with 9 lines in your changes missing coverage. Please review.

Project coverage is 90.62%. Comparing base (5c2258c) to head (6a621fc). Report is 2 commits behind head on master.

Files Patch % Lines
src/distribution/multivariate_students_t.rs 97.30% 8 Missing :warning:
src/distribution/multivariate_normal.rs 98.59% 1 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #266 +/- ## ========================================== + Coverage 90.32% 90.62% +0.30% ========================================== Files 49 50 +1 Lines 11242 11583 +341 ========================================== + Hits 10154 10497 +343 + Misses 1088 1086 -2 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.