GAA-UAM / scikit-fda

Functional Data Analysis Python package
https://fda.readthedocs.io
BSD 3-Clause "New" or "Revised" License
309 stars 58 forks source link

ddof parameter in fdatacov #556

Closed pcuestas closed 1 year ago

pcuestas commented 1 year ago

Add parameter ddof to FData.cov, FData.var, stats.cov and stats.var.

As explained in #555, this ddof parameter has value 1 by default and means "Delta Degrees of Freedom". The divisor used in the calculation of the covariance is N-ddof.

This changes the previous default behavior of var, which used ddof=0 by default. Therefore, changes have been applied to scikit-fda/skfda/misc/scoring.py (Line 77) and scikit-fda/skfda/ml/clustering/_kmeans.py (Line 150), in order to preserve the previous behaviour of those modules.

This pull request closes #555 .

codecov[bot] commented 1 year ago

Codecov Report

Patch coverage: 89.47% and no project coverage change.

Comparison is base (415796b) 85.85% compared to head (26c6d22) 85.86%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## develop #556 +/- ## ======================================== Coverage 85.85% 85.86% ======================================== Files 147 147 Lines 11650 11655 +5 ======================================== + Hits 10002 10007 +5 Misses 1648 1648 ``` | [Impacted Files](https://app.codecov.io/gh/GAA-UAM/scikit-fda/pull/556?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=GAA-UAM) | Coverage Δ | | |---|---|---| | [skfda/representation/\_functional\_data.py](https://app.codecov.io/gh/GAA-UAM/scikit-fda/pull/556?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=GAA-UAM#diff-c2tmZGEvcmVwcmVzZW50YXRpb24vX2Z1bmN0aW9uYWxfZGF0YS5weQ==) | `83.15% <ø> (ø)` | | | [skfda/representation/basis/\_fdatabasis.py](https://app.codecov.io/gh/GAA-UAM/scikit-fda/pull/556?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=GAA-UAM#diff-c2tmZGEvcmVwcmVzZW50YXRpb24vYmFzaXMvX2ZkYXRhYmFzaXMucHk=) | `81.02% <66.66%> (ø)` | | | [skfda/exploratory/stats/\_stats.py](https://app.codecov.io/gh/GAA-UAM/scikit-fda/pull/556?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=GAA-UAM#diff-c2tmZGEvZXhwbG9yYXRvcnkvc3RhdHMvX3N0YXRzLnB5) | `86.36% <75.00%> (ø)` | | | [skfda/misc/covariances.py](https://app.codecov.io/gh/GAA-UAM/scikit-fda/pull/556?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=GAA-UAM#diff-c2tmZGEvbWlzYy9jb3ZhcmlhbmNlcy5weQ==) | `84.40% <100.00%> (+0.36%)` | :arrow_up: | | [skfda/misc/scoring.py](https://app.codecov.io/gh/GAA-UAM/scikit-fda/pull/556?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=GAA-UAM#diff-c2tmZGEvbWlzYy9zY29yaW5nLnB5) | `91.50% <100.00%> (ø)` | | | [skfda/ml/clustering/\_kmeans.py](https://app.codecov.io/gh/GAA-UAM/scikit-fda/pull/556?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=GAA-UAM#diff-c2tmZGEvbWwvY2x1c3RlcmluZy9fa21lYW5zLnB5) | `91.07% <100.00%> (ø)` | | | [skfda/representation/grid.py](https://app.codecov.io/gh/GAA-UAM/scikit-fda/pull/556?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=GAA-UAM#diff-c2tmZGEvcmVwcmVzZW50YXRpb24vZ3JpZC5weQ==) | `86.25% <100.00%> (ø)` | |

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.