diff --git a/.github/workflows/R-CMD-check-rstan.yaml b/.github/workflows/R-CMD-check-rstan.yaml index 8aa46ded..bd381240 100644 --- a/.github/workflows/R-CMD-check-rstan.yaml +++ b/.github/workflows/R-CMD-check-rstan.yaml @@ -55,6 +55,7 @@ jobs: lubridate wrswoR tweedie + corpcor splines2 scoringRules matrixStats diff --git a/.github/workflows/R-CMD-check.yaml b/.github/workflows/R-CMD-check.yaml index 05268857..103b470e 100644 --- a/.github/workflows/R-CMD-check.yaml +++ b/.github/workflows/R-CMD-check.yaml @@ -53,6 +53,7 @@ jobs: lubridate wrswoR tweedie + corpcor splines2 scoringRules matrixStats diff --git a/R/print.mvgam.R b/R/print.mvgam.R index dbfc2c5a..a120a758 100644 --- a/R/print.mvgam.R +++ b/R/print.mvgam.R @@ -29,24 +29,29 @@ cat(paste0(object$family, '\n')) cat("\nLink function:\n") cat(paste0(family_links(object$family), '\n')) - -cat("\nTrend model:\n") -if(inherits(object$trend_model, 'mvgam_trend')){ - print(object$trend_model$label) - cat('\n') -} else { - cat(paste0(object$trend_model, '\n')) +if(!inherits(object, 'jsdgam')){ + cat("\nTrend model:\n") + if(inherits(object$trend_model, 'mvgam_trend')){ + print(object$trend_model$label) + cat('\n') + } else { + cat(paste0(object$trend_model, '\n')) + } } if(object$use_lv){ - cat("N latent factors:\n") + cat("\nN latent factors:\n") cat(object$n_lv, '\n') } -cat('\nN series:\n') -cat(NCOL(object$ytimes), '\n') - +if(inherits(object, 'jsdgam')){ + cat('\nN species:\n') + cat(NCOL(object$ytimes), '\n') +} else { + cat('\nN series:\n') + cat(NCOL(object$ytimes), '\n') +} if(!is.null(object$upper_bounds)){ cat('\nUpper bounds:\n') @@ -54,9 +59,13 @@ if(!is.null(object$upper_bounds)){ } -cat('\nN timepoints:\n') -cat(NROW(object$ytimes), '\n') - +if(inherits(object, 'jsdgam')){ + cat('\nN sites:\n') + cat(NROW(object$ytimes), '\n') +} else { + cat('\nN timepoints:\n') + cat(NROW(object$ytimes), '\n') +} if(object$fit_engine == 'jags'){ cat('\nStatus:\n') diff --git a/R/residual_cor.R b/R/residual_cor.R index 81e55984..41b05fc7 100644 --- a/R/residual_cor.R +++ b/R/residual_cor.R @@ -54,7 +54,7 @@ #' directly associated, but they are still correlated *through* other species. In other words, they #' are conditionally independent given the other species. It is important that the precision matrix #' does not exhibit the exact same properties of the correlation e.g., the diagonal elements are -#' not equal to 1. Nevertheless, relatively larger values of precision imply a stronger +#' not equal to 1. Nevertheless, relatively larger values of precision may imply stronger #' direct relationships between two species. #' #' In addition to the residual correlation and precision matrices, the median or mean point estimator diff --git a/R/summary.mvgam.R b/R/summary.mvgam.R index f86638a9..408814c7 100644 --- a/R/summary.mvgam.R +++ b/R/summary.mvgam.R @@ -81,14 +81,16 @@ cat(paste0(object$family, '\n')) cat("\nLink function:\n") cat(paste0(family_links(object$family), '\n')) -cat("\nTrend model:\n") -if(inherits(object$trend_model, 'mvgam_trend')){ - print(object$trend_model$label) -} else { - cat(paste0(object$trend_model, '\n')) +if(!inherits(object, 'jsdgam')){ + cat("\nTrend model:\n") + if(inherits(object$trend_model, 'mvgam_trend')){ + print(object$trend_model$label) + cat('\n') + } else { + cat(paste0(object$trend_model, '\n')) + } } - if(object$use_lv){ if(!is.null(object$trend_call)){ cat("\nN process models:\n") @@ -99,16 +101,26 @@ if(object$use_lv){ } } -cat('\nN series:\n') -cat(NCOL(object$ytimes), '\n') +if(inherits(object, 'jsdgam')){ + cat('\nN species:\n') + cat(NCOL(object$ytimes), '\n') +} else { + cat('\nN series:\n') + cat(NCOL(object$ytimes), '\n') +} if(!is.null(object$upper_bounds)){ cat('\nUpper bounds:\n') cat(object$upper_bounds, '\n') } -cat('\nN timepoints:\n') -cat(NROW(object$ytimes), '\n') +if(inherits(object, 'jsdgam')){ + cat('\nN sites:\n') + cat(NROW(object$ytimes), '\n') +} else { + cat('\nN timepoints:\n') + cat(NROW(object$ytimes), '\n') +} if(object$fit_engine == 'jags'){ cat('\nStatus:\n') @@ -825,14 +837,16 @@ summary.mvgam_prefit = function(object, ...){ cat(paste0(family_links(object$family), '\n')) - cat("\nTrend model:\n") - if(inherits(object$trend_model, 'mvgam_trend')){ - cat(paste0(print(object$trend_model$label), '\n')) - } else { - cat(paste0(object$trend_model, '\n')) + if(!inherits(object, 'jsdgam')){ + cat("\nTrend model:\n") + if(inherits(object$trend_model, 'mvgam_trend')){ + print(object$trend_model$label) + cat('\n') + } else { + cat(paste0(object$trend_model, '\n')) + } } - if(object$use_lv){ if(!is.null(object$trend_call)){ cat("\nN process models:\n") @@ -846,12 +860,22 @@ summary.mvgam_prefit = function(object, ...){ } - cat('\n\nN series:') - cat(NCOL(object$ytimes), '\n') + if(inherits(object, 'jsdgam')){ + cat('\nN species:\n') + cat(NCOL(object$ytimes), '\n') + } else { + cat('\nN series:\n') + cat(NCOL(object$ytimes), '\n') + } - cat('\n\nN timepoints:') - cat(NROW(object$ytimes), '\n') + if(inherits(object, 'jsdgam')){ + cat('\nN sites:\n') + cat(NROW(object$ytimes), '\n') + } else { + cat('\nN timepoints:\n') + cat(NROW(object$ytimes), '\n') + } cat('\nStatus:') diff --git a/docs/reference/residual_cor.jsdgam.html b/docs/reference/residual_cor.jsdgam.html index fc7dbda1..78a40942 100644 --- a/docs/reference/residual_cor.jsdgam.html +++ b/docs/reference/residual_cor.jsdgam.html @@ -146,7 +146,7 @@
In addition to the residual correlation and precision matrices, the median or mean point estimator of trace of the residual covariance matrix is returned, diff --git a/man/residual_cor.jsdgam.Rd b/man/residual_cor.jsdgam.Rd index 4eae00bb..e01dbeb4 100644 --- a/man/residual_cor.jsdgam.Rd +++ b/man/residual_cor.jsdgam.Rd @@ -80,7 +80,7 @@ precision but still be correlated, which can be interpreted as saying that two s directly associated, but they are still correlated \emph{through} other species. In other words, they are conditionally independent given the other species. It is important that the precision matrix does not exhibit the exact same properties of the correlation e.g., the diagonal elements are -not equal to 1. Nevertheless, relatively larger values of precision imply a stronger +not equal to 1. Nevertheless, relatively larger values of precision may imply stronger direct relationships between two species. In addition to the residual correlation and precision matrices, the median or mean point estimator