Skip to content
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

Unable to sample from VonMisesFisher #1464

Closed
nishadgothoskar opened this issue Dec 27, 2021 · 1 comment
Closed

Unable to sample from VonMisesFisher #1464

nishadgothoskar opened this issue Dec 27, 2021 · 1 comment

Comments

@nishadgothoskar
Copy link

I'm encountering issues when sampling from a VonMisesFischer centered on the identity orientation.

julia> rand(Distributions.VonMisesFisher([1.0, 0.0, 0.0, 0.0], 100.0))
4-element Vector{Float64}:
 NaN
 NaN
 NaN
 NaN

Digging deeper, I found the issue is here:

julia> s = Distributions.sampler(Distributions.VonMisesFisher([1.0, 0.0, 0.0, 0.0], 100.0))
Distributions.VonMisesFisherSampler(4, 100.0, 0.007499578172454263, 0.9851124936725868, 87.9465773626279, [NaN, NaN, NaN, NaN])

where the NaN vector is output by this function:

function _vmf_householder_vec::Vector{Float64})

Any help here would be appreciated!

(Unrelated issue related to VMF is the following, where it should be abs(norm(v) - 1.0) < 1.0e-12

isunitvec(v::AbstractVector) = (norm(v) - 1.0) < 1.0e-12

@devmotion
Copy link
Member

Thanks for the issue. It seems to be a duplicate of #1423.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants