R/utils.R

Defines functions check_stable

# Internal utility functions

#' Check if a dsge_fit or dsge_solution is stable
#' @noRd
check_stable <- function(x) {
  sol <- if (inherits(x, "dsge_fit")) x$solution else x
  if (!sol$stable) {
    stop("Model is not saddle-path stable.", call. = FALSE)
  }
  invisible(TRUE)
}

Try the dsge package in your browser

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

dsge documentation built on Sept. 25, 2026, 5:08 p.m.