Distributions.jl icon indicating copy to clipboard operation
Distributions.jl copied to clipboard

Von mises range fix

Open Astro-mh opened this issue 4 years ago • 3 comments

This pull request reverts part of #965 which added bound checking to the pdf of several distributions. This shouldn't be done for the von Mises distribution as it is designed to be periodic, repeating every 2π, so values for the pdf beyond the support of the distribution are entirely valid.

To enable the univariate_bounds tests to continue working with as few changes as possible, this also adds an isperiodic() method which is set to false in univariates.jl and then set to true in vonmises.jl

Astro-mh avatar Feb 13 '21 17:02 Astro-mh

Codecov Report

Merging #1280 (e492112) into master (0b1ecad) will decrease coverage by 1.96%. The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1280      +/-   ##
==========================================
- Coverage   81.34%   79.38%   -1.97%     
==========================================
  Files         117      117              
  Lines        6563     5977     -586     
==========================================
- Hits         5339     4745     -594     
- Misses       1224     1232       +8     
Impacted Files Coverage Δ
src/Distributions.jl 100.00% <ø> (ø)
src/univariate/continuous/vonmises.jl 84.37% <100.00%> (-3.51%) :arrow_down:
src/univariates.jl 65.97% <100.00%> (-0.70%) :arrow_down:
src/univariate/discrete/hypergeometric.jl 56.75% <0.00%> (-6.66%) :arrow_down:
src/univariate/discrete/skellam.jl 75.00% <0.00%> (-6.25%) :arrow_down:
src/univariate/continuous/normalinversegaussian.jl 79.16% <0.00%> (-6.02%) :arrow_down:
src/univariate/continuous/skewnormal.jl 61.29% <0.00%> (-4.34%) :arrow_down:
src/univariate/continuous/biweight.jl 56.66% <0.00%> (-3.94%) :arrow_down:
src/matrix/wishart.jl 84.04% <0.00%> (-3.81%) :arrow_down:
... and 94 more

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 0b1ecad...e492112. Read the comment docs.

codecov-io avatar Feb 13 '21 17:02 codecov-io

It is frustrating that this PR (and other PR) related to VonMises are not resolved and merged. The current implementation gives unexpected results.

It seems that the simplest solution to these issues is to define support on [-pi , pi] and then wrap input (to pdf or cdf) to this range and likewise, always give samples in this range.

jerlich avatar Sep 16 '22 00:09 jerlich

I reviewed the PR and it seems the PR is clearly not in a mergeable state. The comments have to be addressed first but apparently this has not been done.

devmotion avatar Sep 16 '22 16:09 devmotion