pwsd  R Documentation 
Run the Automatic BlockLength selection method proposed by Politis and White
(2004) and corrected in Patton, Politis, and White (2009). The method is
based on spectral density estimation via flattop lag windows of Politis and
Romano (1995). This code was adapted from b.star
to add
functionality and include correlogram support including an S3 method,
see Hayfield and Racine (2008).
pwsd( data, K_N = NULL, M_max = NULL, m_hat = NULL, b_max = NULL, c = NULL, round = FALSE, correlogram = TRUE )
data 
an n x k data.frame, matrix, or vector (if k = 1) where the optimal blocklength will be computed for each of the k columns. 
K_N 
an integer value, the maximum lags for the autocorrelation,
rho_k, which to apply the implied hypothesis test. Defaults to

M_max 
an integer value, the upperbound for the optimal number of lags, M, to compute the autocovariance for. See Theorem 3.3 (ii) of Politis and White (2004). 
m_hat 
an integer value, if set to 
b_max 
a numeric value, the upperbound for the optimal blocklength.
Defaults to 
c 
a numeric value, the constant which acts as the significance level
for the implied hypothesis test. Defaults to 
round 
a logical value, if set to 
correlogram 
a logical value, if set to 
an object of class 'pwsd'
Andrew Patton, Dimitris N. Politis & Halbert White (2009) Correction to "Automatic BlockLength Selection for the Dependent Bootstrap" by D. Politis and H. White, Econometric Review, 28:4, 372375, DOI: doi: 10.1080/07474930802459016
Dimitris N. Politis & Halbert White (2004) Automatic BlockLength Selection for the Dependent Bootstrap, Econometric Reviews, 23:1, 5370, DOI: doi: 10.1081/ETC120028836
Politis, D.N. and Romano, J.P. (1995), BiasCorrected Nonparametric Spectral Estimation. Journal of Time Series Analysis, 16: 67103, DOI: doi: 10.1111/j.14679892.1995.tb00223.x
Tristen Hayfield and Jeffrey S. Racine (2008). Nonparametric Econometrics: The np Package. Journal of Statistical Software 27(5). DOI: doi: 10.18637/jss.v027.i05
# Generate AR(1) time series sim < stats::arima.sim(list(order = c(1, 0, 0), ar = 0.5), n = 500, innov = rnorm(500)) # Calculate optimal block length for series pwsd(sim, round = TRUE) # Use S3 Method b < pwsd(sim, round = TRUE, correlogram = FALSE) plot(b)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.