Rank: 400133 based on 0 downloads (last 30 days) and 0 file submitted
photo

Allan

E-mail

Personal Profile:

 

Watch this Author's files

 

Comments and Ratings by Allan
Updated File Comments Rating
06 Nov 2012 Circular Statistics Toolbox (Directional Statistics) Compute descriptive and inferential statistics for circular or directional data. Author: Philipp Berens

Hi there, great toolbox. I propose a change to avoid numerical instability in circ_vmpdf.m.
Current code to evaluate the pdf:

C = 1/(2*pi*besseli(0,kappa));
p = C * exp(kappa*cos(alpha-thetahat));

Proposed replacement code:
C = log(1)-log(2*pi*besseli(0,kappa,1))+(kappa*cos(alpha-thetahat))-kappa;
p = exp(C);

Examples:

circ_vmpdf(0,0,1000)

Old code result: NaN
New code result: 12.6141

Contact us