function lambda = comp_lambda(cur_t, cur_event, last_t, lambdat,w,mu,A) 
lambda = mu + (lambdat - mu).*(exp(-w * (cur_t - last_t)));
if ~isempty(cur_event)%not empty, sum over all
    lambda = lambda + A(cur_event,:)';
end
end



