function y = log_raylpdf( x, beta )
  
  if nargin < 2
    error( [ mfilename ' needs 2 input arguments.' ] );
  end
  
  if any( x(:) < 0 )
    error( [ mfilename ' needs all x >= 0 !' ] );
  end
  
  y = log( x ) - 2 * log( beta ) - 0.5 * ( x / beta ) .^ 2;
  