kent(1982)和bingham-mardia(1978)分布在球面上的实现
fb8的Python项目详细描述
入门
pip install fb8
importnumpyasnpfrommatplotlibimportpyplotaspltfrommatplotlibimportcmfrommpl_toolkits.mplot3dimportAxes3Dfromsphere.distributionimportfb8defgrid(npts):return[_.flatten()for_innp.meshgrid(np.linspace(0,np.pi,npts),np.linspace(0,2*np.pi,npts))]defplot_fb8(fb8,npts):""" Plot fb8 on 3D sphere """xs=fb8.spherical_coordinates_to_nu(*grid(npts))pdfs=fb8.pdf(xs)z,x,y=xs.Tfig=plt.figure(figsize=plt.figaspect(1.))ax=fig.add_subplot(111,projection='3d')ax.plot_surface(x.reshape(npts,npts),y.reshape(npts,npts),z.reshape(npts,npts),alpha=0.5,rstride=1,cstride=1,facecolors=cm.plasma(pdfs.reshape(npts,npts)/pdfs.max()))ax.set_axis_off()plt.tight_layout(-5)plt.show()plot_fb8(fb8(np.pi/16,-np.pi/3,0,10,10,-1,0.5,0.3),200)
基本信息
在球体上实现FB8分布,这是下面描述的FB6、FB5(Kent)和FB4(Bingham Mardia)分布的泛化。
实现在rivest(1984)中首次引入的fb6发行版。
基于KTEN(1982)实现KTE分布的密度和拟合(最大似然估计)的计算。如果从命令行调用distribution.py,则执行unittest。
实现了bingham-mardia分布,其模式是基于bingham,mardia(1978)的球体上的一个小圆。
还计算方向性百分位水平,可用于指示天空中n%的最高后密度区域。
其他参考资料
肯特,侯赛因,贾赫,Directional distributions in tracking of space debris
特迪克,贾马拉马达卡,温赖特,Simulation and visualization of spherical distributions
玛迪亚,朱普,Directional statistics
贡献者
这个项目最初是为fb5(kent)发行版here开发的。
天禄苑