% computes the loglikelihood of the data by summing the transition probabilities at each round
% parameters are given, the function fits the timescale (ts)
function log_like = loglike(avotes,bvotes,evote,N,params,ts)
    log_like=0;
    params = params*ts;
    for rou=2:length(avotes(1,:))-1
        eQ = exQ(avotes(1,rou),bvotes(1,rou),N,params);
        for part=1:N
                c_vote = evote(part,rou)+1;
                n_vote = evote(part,rou+1)+1;
                log_like = log_like + log(eQ(c_vote,n_vote));
        end
    end
end