% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/block_bootstrap.R
\name{htdv_boot}
\alias{htdv_boot}
\title{Block Bootstrap with Automatic Block Length}
\usage{
htdv_boot(
  x,
  statistic,
  R = 1999L,
  type = c("circular", "stationary"),
  block_length = "auto",
  level = 0.95
)
}
\arguments{
\item{x}{Numeric vector.}

\item{statistic}{Function \code{function(x)} returning a scalar or numeric
vector.}

\item{R}{Number of bootstrap replicates.}

\item{type}{\code{"circular"} or \code{"stationary"}.}

\item{block_length}{Either \code{"auto"} (Patton-Politis-White) or a
positive integer.}

\item{level}{Confidence level for intervals.}
}
\value{
A list with \code{t0} (statistic on original data), \code{t_star}
  (bootstrap distribution), \code{ci_percentile}, \code{ci_basic},
  \code{ci_studentized}, and \code{block_length}.
}
\description{
Implements circular and stationary block bootstraps (Politis-Romano 1992,
1994) with Patton-Politis-White (2009) automatic block length selection.
}
\examples{
set.seed(1)
x <- arima.sim(model = list(ar = 0.5), n = 200, rand.gen = rnorm)
out <- htdv_boot(as.numeric(x), mean, R = 500, type = "stationary")
out$ci_percentile

}
\references{
Politis, D.N., & Romano, J.P. (1994). The Stationary Bootstrap. JASA
89(428): 1303-1313.
Patton, A., Politis, D.N., & White, H. (2009). Correction to Automatic
Block-Length Selection for the Dependent Bootstrap. Econometric Reviews
28(4): 372-375.
}
