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?

weitzner
  • 440
  • 3
  • 12
  • 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 Sep 13 '13 at 14:54

1 Answers1

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.

weitzner
  • 440
  • 3
  • 12
  • 1
    Can I use movMF in Python to fit mixture of von Mises distributions? The doc says its about von Mises - Fisher distribution. – ZK Zhao Aug 19 '16 at 02:54
  • @cqcn1991 the von Mises distribution is a special case of the von Mises-Fisher distribution. – atzol Aug 26 '17 at 14:28