Title

get_uncertainty(
  mean_forecast,
  resids,
  h,
  level,
  x,
  ci = c("E", "A", "T", "garch")
)

Arguments

mean_forecast

lorem ipsum

resids

lorem ipsum

h

lorem ipsum

level

lorem ipsum

x

lorem ipsum

ci

lorem ipsum

Examples


x <- AirPassengers
mean_forecast <- forecast::thetaf(x)$mean
resids <- forecast::thetaf(x)$resid
(res <- get_uncertainty(mean_forecast, resids, h=5, level=c(80, 95), x))
#>          Point Forecast    Lo 80    Hi 80    Lo 95    Hi 95
#> Jan 1961       443.1197 429.4682 456.7712 422.2415 463.9979
#> Feb 1961       431.4258 417.7743 445.0773 410.5476 452.3040
#> Mar 1961       492.7486 479.0971 506.4001 471.8705 513.6268
#> Apr 1961       478.7462 465.0947 492.3977 457.8680 499.6243
#> May 1961       482.7119 469.0604 496.3634 461.8337 503.5901
print(str(res))
#> List of 9
#>  $ residuals: Time-Series [1:144] from 1949 to 1961: -1.478 9.041 -0.852 0.988 -8.562 ...
#>  $ mean     : Time-Series [1:5] from 1961 to 1961: 443 431 493 479 483
#>  $ lower    : Time-Series [1:5, 1:2] from 1961 to 1961: 429 418 479 465 469 ...
#>   ..- attr(*, "dimnames")=List of 2
#>   .. ..$ : NULL
#>   .. ..$ : chr [1:2] "resid_fcast$lower.80%" "resid_fcast$lower.95%"
#>  $ upper    : Time-Series [1:5, 1:2] from 1961 to 1961: 457 445 506 492 496 ...
#>   ..- attr(*, "dimnames")=List of 2
#>   .. ..$ : NULL
#>   .. ..$ : chr [1:2] "resid_fcast$upper.80%" "resid_fcast$upper.95%"
#>  $ fitted   : num 0
#>  $ x        : Time-Series [1:144] from 1949 to 1961: 112 118 132 129 121 135 148 148 136 119 ...
#>  $ model    : chr "None"
#>  $ level    : num [1:2] 80 95
#>  $ method   : chr "None"
#>  - attr(*, "class")= chr "forecast"
#> NULL