R/chisqNull.R

Defines functions chisqNull chisqNull.objectiveML chisqNull.objectiveGLS

chisqNull <- function(object){
	UseMethod("chisqNull")
}

chisqNull.objectiveML <- function(object){
	chisq <- if (!object$raw) {
			S <- object$S
			CC <- diag(diag(S))
			(object$N - 1) * 
				(sum(diag(S %*% solve(CC))) + log(det(CC)) - log(det(S)) - object$n)
		}
		else NULL
	chisq
}

chisqNull.objectiveGLS <- function(object){
	chisq <- if (!object$raw) {
			S <- object$S
			CC <- diag(diag(S))
			SS <- solve(S) %*% (S - CC)
			(object$N - 1)*0.5*sum(diag(SS %*% SS))
		}
		else NULL
	chisq
}

Try the sem3 package in your browser

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

sem3 documentation built on May 2, 2019, 5:48 p.m.