R/relicorrec.R

Defines functions relicorrec

Documented in relicorrec

relicorrec<-function(L, PHI, Ree, PSI){

  L <- as.matrix(L)
  PHI <- as.matrix(PHI)
  Ree <- as.matrix(Ree)
  PSI <- as.matrix(PSI)

  m <- size(L)[1]
  D <- diag(m)

  SIG <- (L %*% PHI %*% transpose(L)) + (PSI %*% Ree %*% PSI)
  SIG <- SIG - diag(diag(SIG)) + diag(m)
  SIG2 <- (L %*% PHI %*% transpose(L)) + (PSI %*% D %*% PSI)
  SIG2 <- SIG2 - diag(diag(SIG2)) + diag(m)

  reliunbis <- diag(PHI %*% transpose(L) %*% solve(SIG) %*% L %*% PHI)

  relibis <- diag(PHI %*% transpose(L) %*% solve(SIG2) %*% L %*% PHI)

  corrterm <- reliunbis / relibis

  OUT  <- list("relibis"=relibis, "reliunbis"=reliunbis, "corrterm"=corrterm)
  return(OUT)
}

Try the ORIONZ.G package in your browser

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

ORIONZ.G documentation built on Sept. 11, 2024, 6:13 p.m.