function logL=eglike(params, data)
% version 2.0 21/01/03
% (c) Yves Lacouture, Universite Laval
% return minus log-likelihood value for the ex-Gaussian given
% params=[mu sigma tau], an array of parameters and
% data: a row or a colum vector of data
[n,m]=size(data);
if n == 1        % case of a row vector
   data = data';
   n = m;
end
x=exgausspdf(params(1),params(2),params(3),data)+eps;
logL=-sum(log(x)); 
