Skip to content

Commit

Permalink
update uncertainty decomp docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Nicholas Clark committed Sep 11, 2024
1 parent 9532b78 commit 3ced10d
Show file tree
Hide file tree
Showing 34 changed files with 107 additions and 30 deletions.
14 changes: 14 additions & 0 deletions R/plot_mvgam_uncertainty.R
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,15 @@
#'This places the legend on the inside of the plot frame at the given location (if it is not "none").
#'@param hide_xlabels \code{logical}. If \code{TRUE}, no xlabels are printed to allow the user to add custom labels using
#'\code{axis} from base \code{R}
#'@details The basic idea of this function is to compute forecasts by ignoring one of the
#'two primary components in a correlated residual model (i.e. by either ignoring the
#'linear predictor effects or by ignoring the residual dynamics). Some caution is required
#'however, as this function was designed early in the \pkg{mvgam} development cycle and
#'there are now many types of models that it cannot handle very well. For example,
#'models with shared latent states, or any type of State-Space models that include terms
#'in the `trend_formula`, will either fail or give nonsensical results. Improvements are
#'in the works to provide a more general way to decompose forecast uncertainties, so
#'please check back at a later date.
#'@return A base \code{R} graphics plot
#'@export
plot_mvgam_uncertainty = function(object, series = 1, newdata,
Expand All @@ -23,6 +32,11 @@ plot_mvgam_uncertainty = function(object, series = 1, newdata,
stop('argument "object" must be of class "mvgam"')
}

if (!is.null(object$trend_call)){
stop('cannot yet plot uncertainty decompositions for models with trend_formulae',
call. = FALSE)
}

if(sign(series) != 1){
stop('argument "series" must be a positive integer',
call. = FALSE)
Expand Down
1 change: 1 addition & 0 deletions R/print.mvgam.R
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ 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'))
}
Expand Down
Binary file modified docs/reference/Rplot001.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/reference/Rplot002.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/reference/Rplot003.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/reference/Rplot004.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/reference/Rplot005.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/reference/Rplot006.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion docs/reference/index.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified docs/reference/irf.mvgam-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/reference/irf.mvgam-3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/reference/irf.mvgam-4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 13 additions & 0 deletions docs/reference/irf.mvgam.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions docs/reference/mvgam_marginaleffects.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions docs/reference/plot_mvgam_uncertainty.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 8 additions & 5 deletions docs/reference/pp_check.mvgam.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified docs/reference/ppc.mvgam-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/reference/ppc.mvgam-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/reference/ppc.mvgam-3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/reference/ppc.mvgam-4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/reference/ppc.mvgam-5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/reference/ppc.mvgam-6.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 3ced10d

Please sign in to comment.