spinar_boot {spINAR}R Documentation

(Semi)parametric INAR bootstrap procedure

Description

INAR bootstrap procedures for the semiparametric and the parametric INAR setting, where the latter allows for moment- and maximum likelihood-based estimation and Poisson, geometrically and negative binomially distributed innovations.

Usage

spinar_boot(
  x,
  p,
  B,
  setting,
  type = "mom",
  distr = "poi",
  M = 100,
  level = 0.05,
  progress = TRUE
)

Arguments

x

[integer]
vector with integer observations.

p

[integer(1)]
order of the INAR model, where \code{p} \in \{1,2\}.

B

[integer(1)]
number of bootstrap repetitions.

setting

[string(1)]
estimation setting \in \code{\{"sp", "p"\}}, where "sp" defines a semiparametric setting and "p" a parametric setting.

type

[string(1)]
type of estimation \in \code{\{"mom", "ml"\}}, where "mom" (default) performs moment-based estimation and "ml" maximum likelihood-based estimation.

distr

[string(1)]
parametric family of innovation distribution \in \code{\{"poi", "geo", "nb"\}}, where "poi" (default) denotes Poi(lambda), "geo" Geo(prob) and "nb" NB(r, prob) distributions.

M

[integer(1)]
upper limit for the innovations.

level

[numeric(1)]
level for the bootstrap confidence intervals (percentile interval and Hall's percentile interval (bootstrap-t-interval without studentization)).

progress

[logical(1)]
Should a nice progress bar be shown? Turning it off, could lead to significantly faster calculation. Default is TRUE.

Value

[named list] with entries

x_star

[matrix] of bootstrap observations with length(x) rows and B columns.

parameters_star

[matrix] of bootstrap estimated parameters with B rows. If setting = "sp", each row contains the estimated coefficients \code{alpha}_1,...,\code{alpha}_p and the estimated entries of the pmf \code{pmf}_0, \code{pmf}_1, ... where \code{pmf}_i represents the probability of an innovation being equal to i. If setting = "p", each row contains the estimated coefficients \code{alpha}_1,...,\code{alpha}_p and the estimated parameter(s) of the innovation distribution.

bs_ci_percentile

[named matrix] with the lower and upper bounds of the bootstrap percentile confidence intervals for each parameter in parameters_star.

bs_ci_hall

[named matrix] with the lower and upper bounds of Hall's bootstrap percentile confidence intervals for each parameter in parameters_star.

Examples

# generate data
dat1 <- spinar_sim(n = 200, p = 1, alpha = 0.5,
                   pmf = c(0.3, 0.3, 0.2, 0.1, 0.1))
dat2 <- spinar_sim(n = 200, p = 2, alpha = c(0.2, 0.3),
                   pmf = dgeom(0:60, 0.5))


# semiparametric INAR(1) bootstrap
spinar_boot(x = dat1, p = 1, B = 50, setting = "sp")
# parametric Geo-INAR(2) bootstrap using moment-based estimation
spinar_boot(x = dat2, p = 2, B = 50, setting = "p", type = "mom", distr = "geo")



[Package spINAR version 0.2.0 Index]