Skip to contents

Returns the out-of-sample estimates of the latent true value produced by the forecast horizon h supplied to jvn_nowcast(). The horizon is fixed at estimation time, so refit with a different h to change it.

Usage

# S3 method for class 'jvn_model'
predict(object, ...)

Arguments

object

An object of class jvn_model.

...

Ignored.

Value

A tibble with columns time, estimate, lower and upper. Has zero rows when the model was fitted with h = 0.

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)

fit <- jvn_nowcast(
  df = df, e = 4, ar_order = 2, h = 2, include_noise = FALSE
)
predict(fit)
#> # A tibble: 2 × 4
#>   time       estimate lower   upper
#>   <date>        <dbl> <dbl>   <dbl>
#> 1 2020-04-01    -2.69 -3.85 -1.54  
#> 2 2020-07-01    -1.46 -2.88 -0.0474
# }