5
votes
statistics - Fit a mixture of von Mises distributions in R - Stack Overflow
Asked
Viewed 2k times
5

I have a set of angular data that I'd like to fit a mixture of two von Mises distributions to. As shown below, the data are clustered at about 0 and ±π, so having a periodic boundary is required for this case. Distribution of data

I have tried using the movMF package to fit a distribution to these data but it seems that it is normalizing each row, and since this is a set of 1D data, the result is a vector of ±1. How are others fitting a mixture of distributions like this in R?

1
  • Can you explain what you've been trying? For example, if you write a "two von Mises dist" generalized function and run nls with your data and that function, what happens? Sep 13 2013 at 14:54
9

The problem lies with using a vector of angles as the input to the movMF function. Instead, the angles must be converted to points on the unit circle

pts_on_unit_circle <- cbind(cos(angle_in_degrees * pi / 180), 
                            sin(angle_in_degrees * pi / 180))
d <- movMF(pts_on_unit_circle, number_of_mixed_vM_fxns)
mu <- atan2(d$theta[,2], d$theta[,1])
kappa <- sqrt(rowSums(d$theta^2))

Source: Contacted Kurt Hornik, the author of the movMF package.

2
  • 1
    Can I use movMF in Python to fit mixture of von Mises distributions? The doc says its about von Mises - Fisher distribution.
    – cqcn1991
    Aug 19 2016 at 2:54
  • @cqcn1991 the von Mises distribution is a special case of the von Mises-Fisher distribution.
    – atzol
    Aug 26 2017 at 14:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.

 
1
Can you explain what you've been trying? For example, if you write a "two von Mises dist" generalized function and run nls with your data and that function, what happens? - Carl Witthoft

1 Answers

9
votes

The problem lies with using a vector of angles as the input to the movMF function. Instead, the angles must be converted to points on the unit circle

pts_on_unit_circle <- cbind(cos(angle_in_degrees * pi / 180), 
                            sin(angle_in_degrees * pi / 180))
d <- movMF(pts_on_unit_circle, number_of_mixed_vM_fxns)
mu <- atan2(d$theta[,2], d$theta[,1])
kappa <- sqrt(rowSums(d$theta^2))

Source: Contacted Kurt Hornik, the author of the movMF package.