| plot.revision_model | R Documentation |
Plot filtered or smoothed estimates for a selected state from a fitted
revision model. Defined once for the parent class revision_model and
inherited by kk_model and jvn_model objects alike; the state shown when
state is not given is chosen by the concrete class.
## S3 method for class 'revision_model'
plot(x, state = NULL, type = "filtered", ...)
x |
A fitted model object inheriting from revision_model, such as a
|
state |
String. The name of the state to visualize. If |
type |
String. Type of estimate: "filtered" or "smoothed". |
... |
Additional arguments passed to theme_reviser. |
This method requires the state estimates to be available. A model
fitted with solver_options$return_states = FALSE did not retain them,
and plotting it fails with a message naming that option, in the same way
states(), fitted(), residuals() and predict() do.
A ggplot2 object.
Other revision nowcasting:
coef.revision_model(),
fitted.revision_model(),
jvn_nowcast(),
kk_nowcast(),
logLik.revision_model(),
nobs.revision_model(),
predict.revision_model(),
print.revision_model(),
residuals.revision_model(),
revision_model,
states(),
summary.revision_model(),
vcov.revision_model()
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.