R/ordnormulti.R

Defines functions ordnormulti

Documented in ordnormulti

ordnormulti<-function(z,PHI){

  n     <- nrow(cbind(z))
  dospi <-6.2832
  tmp1  <-(dospi)^(n/2)
  if (n == 1){ # JNT Right ??
    tmp2 <- sqrt(PHI)
  } else {
    tmp2<- sqrt(det(PHI))
  }
  tmp3<-1/(tmp1*tmp2)
  quad<-t(z)%*%solve(PHI)%*%z # JNT: Alternative for solve() is chol2inv(chol())). It saves time when PHI is large (not your case here).
  orde<-tmp3*exp(-.5*(quad))

}

Try the vampyr package in your browser

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

vampyr documentation built on June 17, 2021, 9:10 a.m.