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.
我尝试使用 movMF 包来拟合这些数据的分布,但似乎它正在对每一行进行标准化,并且由于这是一组一维数据,因此结果是一个 ±1 的向量。其他人如何在 R 中拟合这样的分布混合?
问题在于使用角度向量作为 movMF 函数的输入。相反,角度必须转换为单位圆上的点
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))
资料来源:联系了 movMF 包的作者 Kurt Hornik。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)