R/print.DDPstar.R

Defines functions print.DDPstar

Documented in print.DDPstar

print.DDPstar <-
function(x, ...) {
	
	cat("\nCall:\n", paste(deparse(x$call), sep = "\n", collapse = "\n"), "\n", sep = "")
	cat(paste0("\n Dependent Dirichet Processes with P-splines"))
	cat("\n----------------------------------------------\n")

	waic <- !is.null(x$WAIC)
	lpml <- !is.null(x$lpml)
	dic <- !is.null(x$DIC)

	if(waic | lpml) {
		cat("\n\nModel selection criteria")
		cat("\n----------------------------------------------\n")
		if(waic) {
			cat(paste("Widely applicable information criterion (WAIC): ", round(x$WAIC$WAIC, 3),"\n"))		
		}

		if(lpml) {
			cat(paste("Pseudo marginal likelihood (LPML): ", round(x$lpml$lpml),"\n"))		
		}

		if(dic) {
			cat(paste("Deviance information criterion (DIC): ", round(x$DIC$DIC),"\n"))		
		}
	}
	invisible(x)   
}

Try the DDPstar package in your browser

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

DDPstar documentation built on April 3, 2025, 8:46 p.m.