pmpp_predinterval: Random-Window Block Bootstrap for prediction intervals for...

Description Usage Arguments Value Author(s) References Examples

View source: R/pmpp_predInterval.R

Description

Produces prediction intervals for Posterior Mean Panel Predictor model by means of resampling with replacement from model's residuals. Block Bootstrap method takes into account heteroskedasticity of the error terms, both across units and over time. Block window is chosen randomly.

Usage

1
2
pmpp_predinterval(model, fframe, boot_reps = 1000, block_size = NULL,
  confidence = 0.95, iter = NULL)

Arguments

model

PMPP model, as returned by pmpp()

fframe

data.frame with the same columns as input data to model, but with empty rows added to each cross-sectional unit, as created by create_fframe()

boot_reps

integer; number of bootstrap replications

block_size

integer; width of the re-sampled block of residuals

confidence

numeric in (0,1); confidence level of the interval

iter

iterating constant, to be used in a loop when extraction from call is needed

Value

A data.frame with panel indices, lower and upper bounds and midpoint.

Author(s)

Michal Oleszak

References

Oleszak, M. (2018). "Forecasting sales with micro-panels: Empirical Bayes approach. Evidence from consumer goods sector.", Erasmus University Thesis Repository

Examples

1
2
3
4
5
6
7
## Not run: data(EmplUK, package = "plm")
EmplUK <- dplyr::filter(EmplUK, year %in% c(1978, 1979, 1980, 1981, 1982))
pmpp_model <- pmpp(dep_var = "emp", data = EmplUK)
my_fframe <- create_fframe(EmplUK, 1983:1985)
intervals <- pmpp_predinterval(pmpp_model, my_fframe, boot_reps = 10)

## End(Not run)

pmpp documentation built on Oct. 30, 2019, 11:35 a.m.