R/2.6.2.getGFIgofGLSC4.R

Defines functions getGFIgofGLSC4

getGFIgofGLSC4 <- function(fit, fitTheta) {
  UMatrix <- getUMatrix(fit)

  vechSw <- matrix(fit$sigmaHat[lower.tri(fit$sigmaHat, diag = TRUE)], ncol = 1)
  vechSigmaTheta <- matrix(fitTheta$sigmaTheta[lower.tri(fitTheta$sigmaTheta, diag = TRUE)], ncol = 1)

  nominator <- t((vechSw - vechSigmaTheta)) %*% solve(UMatrix) %*% (vechSw - vechSigmaTheta)
  denominator <- t((vechSw)) %*% solve(UMatrix) %*% (vechSw)

  GFI <- 1 - (nominator / denominator)

  return(GFI)
}

Try the Mmcsd package in your browser

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

Mmcsd documentation built on March 31, 2023, 7:23 p.m.