function f = Laplace_cdf(X,params)
% f = Laplace_cdf(X, [ muX,sigmaX ])
% return PDF of Laplace distribution
% with mean muX and std.dev sigmaX, at points X
 
%    Reference: http://en.wikipedia.org/wiki/Laplace_distribution

  muX = params(1);
  sigmaX = params(2);

  sr2 = sqrt(2);

  ib = find(X<=muX);
  ia = find(X>muX);

  f(ib) =  0.5 * exp(-sr2*abs(X(ib)-muX) / sigmaX);
  f(ia) =  1  -  0.5 * exp(-sr2*abs(X(ia)-muX) / sigmaX);

% ------------------------------------------------------------- Laplace_cdf
