Home > atmlab > circular > circ_vmpdf.m

circ_vmpdf

PURPOSE ^

[p alpha] = circ_vmpdf(alpha, w, p)

SYNOPSIS ^

function [p alpha] = circ_vmpdf(alpha, thetahat, kappa)

DESCRIPTION ^

 [p alpha] = circ_vmpdf(alpha, w, p)
   Computes the circular von Mises pdf with preferred direction thetahat 
   and concentration kappa at each of the angles in alpha

   The vmpdf is given by f(phi) =
   (1/(2pi*I0(kappa))*exp(kappa*cos(phi-thetahat)

   Input:
     alpha     angles to evaluate pdf at, if empty alphas are chosen to
               100 uniformly spaced points around the circle
     [thetahat preferred direction, default is 0]
     [kappa    concentration parameter, default is 1]

   Output:
     p         von Mises pdf evaluated at alpha
     alpha     angles at which pdf was evaluated


   References:
     Statistical analysis of circular data, Fisher

 Circular Statistics Toolbox for Matlab

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

DOWNLOAD ^

circ_vmpdf.m

SOURCE CODE ^

0001 function [p alpha] = circ_vmpdf(alpha, thetahat, kappa)
0002 
0003 % [p alpha] = circ_vmpdf(alpha, w, p)
0004 %   Computes the circular von Mises pdf with preferred direction thetahat
0005 %   and concentration kappa at each of the angles in alpha
0006 %
0007 %   The vmpdf is given by f(phi) =
0008 %   (1/(2pi*I0(kappa))*exp(kappa*cos(phi-thetahat)
0009 %
0010 %   Input:
0011 %     alpha     angles to evaluate pdf at, if empty alphas are chosen to
0012 %               100 uniformly spaced points around the circle
0013 %     [thetahat preferred direction, default is 0]
0014 %     [kappa    concentration parameter, default is 1]
0015 %
0016 %   Output:
0017 %     p         von Mises pdf evaluated at alpha
0018 %     alpha     angles at which pdf was evaluated
0019 %
0020 %
0021 %   References:
0022 %     Statistical analysis of circular data, Fisher
0023 %
0024 % Circular Statistics Toolbox for Matlab
0025 
0026 % By Philipp Berens and Marc J. Velasco, 2009
0027 % velasco@ccs.fau.edu
0028 
0029 % if no angles are supplied, 100 evenly spaced points around the circle are
0030 % chosen
0031 if nargin < 1 || isempty(alpha)
0032     alpha = linspace(0, 2*pi, 101)';
0033     alpha = alpha(1:end-1);
0034 end
0035 if nargin < 3
0036     kappa = 1;
0037 end
0038 if nargin < 2
0039     thetahat = 0;
0040 end
0041 
0042 alpha = alpha(:);
0043 
0044 % evaluate pdf
0045 C = 1/(2*pi*besseli(0,kappa));
0046 p = C * exp(kappa*cos(alpha-thetahat));

Generated on Mon 15-Sep-2014 13:31:28 by m2html © 2005