Files
2026-07-13 13:30:25 +08:00

11 lines
445 B
Matlab
Executable File

function y = besseliLn(nu,x)
% Compute logarithm of besseli function (modified Bessel function of first kind).
% Written by Mo Chen (mochen80@gmail.com).
% TODO: improve precision using the method in
% Clustering on the Unit Hypersphere using von Mises-Fisher Distributions. A. Banerjee, I. S. Dhillon, J. Ghosh, and S. Sra
[v,ierr] = besseli(nu,x);
if any(ierr ~= 0) || any(v == Inf)
error('ERROR: logbesseli');
end
y = log(v);