avg_coverage_arima: Compute the average coverage of the prediction intervals...

View source: R/avg_coverage.R

avg_coverage_arimaR Documentation

Compute the average coverage of the prediction intervals computed by naive plug-in method and arima_pi

Description

Computes expected coverage probabilities of the prediction intervals of ARMA process by simulating time series from the known model.

Usage

avg_coverage_arima(
  phi = NULL,
  theta = NULL,
  d = 0,
  n,
  n_ahead = 1,
  nsim2,
  nsim = 100,
  level = 0.95,
  prior = "uniform",
  return_all_coverages = FALSE,
  ...
)

Arguments

phi

vector containing the AR parameters

theta

vector containing the MA parameters

d

degree of differencing

n

length of the time series

n_ahead

length of the forecast horizon

nsim2

number of simulations used in computing the expected coverage

nsim

number of simulations used in importance sampling

level

desired coverage probability of the prediction intervals

prior

prior to be used in importance sampling. Multiple choices are allowed.

return_all_coverages

return raw results i.e. coverages for each simulations. When FALSE (default), summary statistics are returned.

...

additional arguments to arima_pi.

Value

a list containing the coverage probabilities

See Also

arima_pi.

Examples



## Not run: 
set.seed(123)
# takes a while, notice se, increase nsim2 to get more accurate results
avg_coverage_arima(phi = 0.9, n = 50, n_ahead = 10, nsim2 = 100)

avg_coverage_arima(phi = 0.9, theta = -0.6, n = 50, n_ahead = 10, nsim2 = 100)

## End(Not run)

helske/tsPI documentation built on Sept. 9, 2023, 8:15 a.m.