Models - type 6: each team has O and D 'consistency' assumes poisson rates in each game between two teams may differ with fluctuations described by parameters "c" (Gamma distribution) (No correlation in flucns). ..for ( g = 1 ; g <= ss->G ; g ++ ) { t1 = s[g][1] ; s1 = (double) s[g][2] ; t2 = s[g][3] ; s2 = (double) s[g][4] ; stot = s1 + s2 ; ... lambda1 = time * exp ( ho[t1] - ad[t2] ) ; lambda2 = time * exp ( ao[t2] - hd[t1] ) ; ll1 = lt + ( ho[t1] - ad[t2] ) ; ll2 = lt + ( ao[t2] - hd[t1] ) ; logc1 = logco[t1] + logcd[t2] ; /* consistency of score 1 */ logc2 = logco[t2] + logcd[t1] ; c1 = exp(logc1) ; c2 = exp(logc2) ; sc1 = s1 + c1 ; sc2 = s2 + c2 ; lamc1 = lambda1 + c1 ; lamc2 = lambda2 + c2 ; thisf = s1 * ll1 ; thisf += s2 * ll2 ; thisf += gammln(sc1) - gammln(c1) + c1 * logc1 - sc1 * log(lamc1) ; thisf += gammln(sc2) - gammln(c2) + c2 * logc2 - sc2 * log(lamc2) ; f += w * thisf ; } ss->loglike = f ; f += ss->logprior ;