R/aux1.R

aux1 <- function(gma,k,l) {
#
# Auxilliary function to calculate the n-x-n matrix whose (i,j)-th
# entry is E[delta(z_i,k)*delta(z_j,l)] which is equal to
# gamma_{ik}*gamma_{jl} if i != j and is equal to
# delta(k,l)*gamma_{ik} if i == j.
#

gk <- gma[,k]
gl <- gma[,l]
rslt <- gk%o%gl
diag(rslt) <- if(k==l) gk else 0
rslt

}

Try the mixreg package in your browser

Any scripts or data that you put into this service are public.

mixreg documentation built on May 2, 2019, 3:25 a.m.