function R=simple_egfit(data)
% version 2.1 26/02/07
% (c) Yves Lacouture, Universite Laval

tau=std(data).*0.8;             % reasonable starting value for tau
mu=mean(data)-tau;   % reasonable starting value for mu
sig=sqrt(var(data)-(tau^2));    % reasonable starting value for sig       

pinit  = [mu sig tau];                      % put starting parameter values in an array                                            
R=fminsearch(@(params) eglike(params,data),pinit);  % given the data, and starting parameters in
                                            % pinit, find the parameter values that minimize eglike	
											% the function returns R=[mu, sig, tau]