R/deviance.R

Defines functions deviance

deviance <-
function(A, K, G, w, sigma2, ssr, edf) {
	log_det_A <- sum(log(A))
	log_det_K <- 2*sum(log(diag(K)))
	log_det_G <- sum(log(G))
	deviance <- log_det_A + log_det_K + log_det_G + sum(log(sigma2*1/w)) + ssr/sigma2 + edf
	deviance	
}

Try the SpATS package in your browser

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

SpATS documentation built on Oct. 16, 2024, 9:06 a.m.