112
denomc.term[j] < — denomc.term[j] + weightc[k,j]
zye < — zye+ cow[,k]*weight[k,j]
zzye < — zzye+ (cow[,k])% * %(t(covv[,k]))*weight[k,j]
zyec < — zyec + covv[,k]*weightc[k,j]
zzyec < — zzyec + (covv[,k])% * %(t(covv[,k]))*weightc[k,j] }#65.1
for (i in l:j){ #65
denom[i,j] < — denom.term[j]
der.l.i < — der.l.i + PP[i,j]*(covv[,i]-(zye)∕(denom[i,j]))
der.2.i < — (der.2.i + (PP[i,j]*((zye% * %t(zye))-(denom[i,j])*(zzye))
/((denom[i,j])^2)))
denomc[i,j] < — denomc.term[j]
der.lc.i < — der.lc.i + PPc[i,j]*(cow[,i]-(zyec)∕(denomc[i,j]))
der.2c.i < — (der.2c.i + (PPc[i,j]*((zyec% * %t(zyec))-(denomc[i,j])*(zzyec))
/((denomc[i,j])^2))) } #65
Ioglik < — Ioglik + loglik.i
der.l < — der.l + der.l.i
der.2 < — der.2 + der.2.i
Ioglikc < — Ioglikc + Ioglikc.i
der.lc < — der.lc + der.lc.i
der.2c < — der.2c + der.2c.i }#64
return(der.l,der.2,der.lc,der.2c,Ioglik,Ioglikc) } #61