Skip to contents

Plot Kishor-Koenig Model Results

Usage

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

Arguments

x

An object of class 'kk_model'

state

String. The name of the state to visualize.

type

String. Type of estimate to plot: "filtered" or "smoothed".

...

Additional arguments passed to theme_reviser.

Value

A ggplot2 object visualizing the specified state estimates.

Examples

df <- get_nth_release(
  tsbox::ts_span(
    tsbox::ts_pc(
      dplyr::filter(reviser::gdp, id=="US")
      ),
      start = "1980-01-01"
     ),
     n = 0:1
   )
df <- dplyr::select(df, -c(id, pub_date))
df <- na.omit(df)

e <- 1  # Number of efficient release
h <- 2  # Forecast horizon
result <- kk_nowcast(df, e, h = h, model = "Kishor-Koenig")

plot(result)