View source: R/model-methods.R
| states | R Documentation |
Accessor for the state paths of a fitted revision-nowcasting model.
Provides programmatic access to the estimated states instead of reaching
into the object with fit$states. The method is defined once for the
parent class revision_model and is inherited by kk_model and
jvn_model objects alike.
states(object, ...)
## S3 method for class 'revision_model'
states(object, filter = c("smoothed", "filtered", "all"), state = NULL, ...)
object |
A fitted model object inheriting from revision_model, such
as a |
... |
Additional arguments passed to methods. |
filter |
Which state estimates to return: |
state |
Optional character vector of state names to keep. Defaults to all states. |
A tibble with columns time, state, estimate, lower,
upper, filter and sample.
Other revision nowcasting:
coef.revision_model(),
fitted.revision_model(),
jvn_nowcast(),
kk_nowcast(),
logLik.revision_model(),
nobs.revision_model(),
plot.revision_model(),
predict.revision_model(),
print.revision_model(),
residuals.revision_model(),
revision_model,
summary.revision_model(),
vcov.revision_model()
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)
fit <- jvn_nowcast(df = df, e = 4, ar_order = 2, include_noise = FALSE)
head(states(fit))
head(states(fit, filter = "filtered", state = "true_lag_0"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.