R/Err_obs.R

Defines functions Err_obs

Err_obs<-function(X){
  J <- colnames(X)
  K <- length(J)
  O  <- array(rep(0,K*K*K), dim=c(K,K,K), dimnames= list(J,J,J))
  for (i in 1 : K) for (j in 1 : K) for(k in 1 : K) {
    O[i,j,k] <- sum(X[,i] * (1 - X[,j]) * X[,k])
  }
  dimnames(O) <- list(J,J,J)
  return(O)
}

Try the mudfold package in your browser

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

mudfold documentation built on Nov. 24, 2022, 5:09 p.m.