# SuanShu, a Java numerical and statistical library

com.numericalmethod.suanshu.stats.random.sampler.resampler.bootstrap.block

## Class PattonPolitisWhite2009

• java.lang.Object
• com.numericalmethod.suanshu.stats.random.sampler.resampler.bootstrap.block.PattonPolitisWhite2009
• All Implemented Interfaces:
Resampler, Seedable

public class PattonPolitisWhite2009
extends Object
implements Resampler
This class implements the stationary and circular block bootstrapping method with optimized block length.
• Politis, N. Dimitris, White Halbert, "Automatic Block-Length Selection for the Dependent Bootstrap", Econometric Reviews , 2004
• Politis, D., White, H., Patton Andrew,"CORRECTION TO 'Automatic Block-Length Selection for the Dependent Bootstrap'", Econometric Reviews, 28(4):372–375, 2009
• R-code
• ### Method Detail

• #### getOptimalBlockLength

public static long getOptimalBlockLength(double[] x,
PattonPolitisWhite2009ForObject.Type type)
Computes the optimal of block length. For stationary block bootstrap, the length of each block follows the geometric distribution with mean equal to the computed optimal length; for circular block bootstrap, the length of each block is fixed to the computed optimal length.
Parameters:
x - the data
type - the type of block bootstrap method
Returns:
the optimal block length $$b_{opt} = \sqrt[3]{\frac{2\hat{G}^2N}{\hat{D}}}$$
• #### getOptimalLag

public static long getOptimalLag(double[] x)
Finds the smallest lag $$\hat{m}$$ such that the autocorrelation for lags $$(\hat{m} + k),~k=1,\dots,K_N$$ are all insignificant regarding to the critical value.
Parameters:
x - the data
Returns:
$$M = 2\hat{m}$$
"footnote c, p. 59, Politis and etc. 2004"
• #### seed

public void seed(long... seeds)
Description copied from interface: Seedable
Seed the random number/vector/scenario generator to produce repeatable experiments.
Specified by:
seed in interface Seedable
Parameters:
seeds - the seeds
• #### newResample

public double[] newResample()
Description copied from interface: Resampler
Gets a resample from the original sample. It is very important this method is thread-safe so resampling can be run in parallel.
Specified by:
newResample in interface Resampler
Returns:
a resample, e.g., a bootstrap sample