Skip to content

Commit

Permalink
Print gengamma param
Browse files Browse the repository at this point in the history
  • Loading branch information
seananderson committed Jan 6, 2024
1 parent 85b17a4 commit 2092929
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion R/print.R
Original file line number Diff line number Diff line change
Expand Up @@ -261,9 +261,13 @@ print_other_parameters <- function(x, m = 1L) {
b <- tidy(x, "ran_pars", model = m, silent = TRUE)

get_term_text <- function(term_name = "", pretext = "") {
b2 <- as.list(x$sd_report, what = "Estimate")
if (term_name %in% b$term) {
a <- mround(b$estimate[b$term == term_name], 2L)
a <- paste0(pretext, ": ", a, "\n")
} else if (term_name %in% names(b2)) {
a <- mround(b2[[term_name]], 2L)
a <- paste0(pretext, ": ", a, "\n")
} else {
a <- ""
}
Expand All @@ -272,6 +276,7 @@ print_other_parameters <- function(x, m = 1L) {

phi <- get_term_text("phi", "Dispersion parameter")
tweedie_p <- get_term_text("tweedie_p", "Tweedie p")
gengamma_par <- get_term_text("gengamma_Q", "Generalized gamma lambda")
sigma_O <- get_term_text("sigma_O", "Spatial SD")
xtra <- if (x$spatiotemporal[m] == "ar1") "marginal " else ""
sigma_E <- get_term_text("sigma_E",
Expand All @@ -292,7 +297,7 @@ print_other_parameters <- function(x, m = 1L) {
sigma_Z <- ""
}

named_list(phi, tweedie_p, sigma_O, sigma_E, sigma_Z, rho)
named_list(phi, tweedie_p, sigma_O, sigma_E, sigma_Z, rho, gengamma_par)
}

print_header <- function(x) {
Expand Down Expand Up @@ -340,6 +345,7 @@ print_one_model <- function(x, m = 1) {

cat(other$phi)
cat(other$tweedie_p)
cat(other$gengamma_par)
cat(other$rho)
cat(range)
cat(other$sigma_O)
Expand Down

0 comments on commit 2092929

Please sign in to comment.