Skip to contents

Plot Time-varying Regression Coefficients of a Dynamite Model

Usage

plot_deltas(
  x,
  parameters = NULL,
  responses = NULL,
  level = 0.05,
  alpha = 0.5,
  scales = c("fixed", "free"),
  include_alpha = TRUE
)

Arguments

x

[dynamitefit]
The model fit object

parameters

[charecter()]\ Parameter name(s) for which the plots should be drawn. Possible options can be found with function get_parameter_names(types = "delta").

responses

[character()]
Response(s) for which the coefficients should be drawn. Possible options are elements of unique(x$priors$response), and the default is this whole vector.

level

[numeric(1)]
Level for posterior intervals. Default is 0.05, leading to 90% intervals.

alpha

[numeric(1)]
Opacity level for geom_ribbon. Default is 0.5.

scales

[character(1)] Should y-axis of the panels be "fixed" (the default) or "free"? See ggplot2::facet_wrap().

include_alpha

[logical(1)]
If TRUE (default), plots also the time-varying alphas if such parameters exists in the model.

Value

A ggplot object.

Examples

data.table::setDTthreads(1) # For CRAN
plot_deltas(gaussian_example_fit, level = 0.025, scales = "free") +
  ggplot2::theme_minimal()