Skip to contents

Plot filtered or smoothed estimates for a selected state from a fitted jvn_model.

Usage

# S3 method for class 'jvn_model'
plot(x, state = "true_lag_0", type = "filtered", ...)

Arguments

x

An object of class jvn_model.

state

Character scalar giving the state to visualize. Defaults to "true_lag_0".

type

Character scalar indicating whether "filtered" or "smoothed" estimates should be plotted.

...

Additional arguments passed to plot.revision_model().

Value

A ggplot2 object.

Details

This method requires x$states to be available. If the model was fitted with solver_options$return_states = FALSE, plotting is not possible.

Examples

# \donttest{
gdp_growth <- dplyr::filter(
  tsbox::ts_pc(reviser::gdp),
  id == "EA",
  time >= min(pub_date),
  time <= as.Date("2020-01-01")
)
gdp_growth <- tidyr::drop_na(gdp_growth)
df <- get_nth_release(gdp_growth, n = 0:3)

result <- jvn_nowcast(
  df = df,
  e = 4,
  ar_order = 2,
  h = 0,
  include_news = TRUE,
  include_noise = TRUE
)
plot(result)

# }