-
Notifications
You must be signed in to change notification settings - Fork 423
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Document that VonMises standard deviation and variance are circular #1705
Comments
Yes. That is the difference. See https://en.wikipedia.org/wiki/Directional_statistics. julia> sqrt(1 - abs(mean(exp.(complex.(0.0, x)))))
0.5492460106924333 Indeed, this could be better documented, so let's keep this issue open to track that. I've adjusted the title accordingly. |
What's the decision, if any? Currently, julia> using Distribustions
julia> d = VonMises(0, 2)
julia> var(d)
0.30222534203599194
julia> var(rand(d, 10^6))
0.7641079384821371
julia> using DirectionalStatistics
julia> Circular.var(rand(d, 10^6))
0.3036343981785453 while julia> std(d)
0.5497502542391335
julia> std(rand(d, 10^6))
0.8744747812547986
julia> Circular.std(rand(d, 10^6))
0.8485527593646777 The path forward seems either:
Technically, the latter seems more consistent with other distributions... It can potentially be confusing if |
I believe this is the intention; I'd be happy to review a PR on this if mentioned. |
I can submit a PR to make a note about circular statistics. I'm not sure where to update the docs, but I identified at least three places where the docs could be updated. @ParadaCarleton, do you prefer any or all of these? Please advise. Distributions.jl/src/univariates.jl Lines 175 to 179 in 2cd6c67
Distributions.jl/src/univariates.jl Lines 175 to 179 in 2cd6c67
|
Sorry. I misunderstood that |
I find using circular variance for for circular distributions confusing. Non-circular std/var is reasonable to use when the distribution is (approximately) supported on an arc. Von Mises Fisher distribution can be defined on any-dimensional sphere and has a valid, general notion of variance: http://www.math.ualberta.ca/~thillen/paper/vonmises.pdf . Were it implemented in Distributions.jl, should it use circular or generic definition when the sphere happens to be a circle? |
For convenience, I added Circular.mean(d) == Circular.mean(rand(d, N))
Circular.var(d) == Circular.var(rand(d, N))
Circular.std(d) == Circular.std(rand(d, N)) These relations are very nice to have for consistency! |
Hi,
I noticed that the VonMises standard deviation is wrong. Consider the following:
Output
Version
Update:
I'm not familiar with variance vs. circular variance. Could this be the reason for the discrepancy? If so, it might be good to make a note in the documentation.
The text was updated successfully, but these errors were encountered: