Class PattonPolitisWhite2009
java.lang.Object
dev.nm.stat.random.sampler.resampler.bootstrap.block.PattonPolitisWhite2009
This class implements the stationary and circular block bootstrapping method
with optimized block length.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionPattonPolitisWhite2009
(double[] sample) Constructs a block bootstrap sample generator.PattonPolitisWhite2009
(double[] sample, long blockLength, PattonPolitisWhite2009ForObject.Type type, ConcurrentCachedRLG rlg, ConcurrentCachedRNG rng) Constructs a block bootstrap sample generator.PattonPolitisWhite2009
(double[] sample, long blockLength, PattonPolitisWhite2009ForObject.Type type, RandomLongGenerator uniform, RandomNumberGenerator rng) Constructs a block bootstrap sample generator.PattonPolitisWhite2009
(double[] sample, PattonPolitisWhite2009ForObject.Type type) Constructs a block bootstrap sample generator.PattonPolitisWhite2009
(double[] sample, PattonPolitisWhite2009ForObject.Type type, RandomLongGenerator uniform, RandomNumberGenerator rng) Constructs a block bootstrap sample generator. -
Method Summary
Modifier and TypeMethodDescriptionstatic long
getOptimalBlockLength
(double[] x, PattonPolitisWhite2009ForObject.Type type) Computes the optimal of block length.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.double[]
Gets a resample from the original sample.void
seed
(long... seeds) Seed the random number/vector/scenario generator to produce repeatable experiments.
-
Constructor Details
-
PattonPolitisWhite2009
public PattonPolitisWhite2009(double[] sample, long blockLength, PattonPolitisWhite2009ForObject.Type type, ConcurrentCachedRLG rlg, ConcurrentCachedRNG rng) Constructs a block bootstrap sample generator.- Parameters:
sample
- the original sampleblockLength
- the block lengthtype
- the type of block bootstrap, either PattonPolitisWhite2009ForObject.Type.STATIONARY or PattonPolitisWhite2009ForObject.Type.CIRCULARrlg
- a concurrent random long generatorrng
- a concurrent random exponential generator
-
PattonPolitisWhite2009
public PattonPolitisWhite2009(double[] sample, long blockLength, PattonPolitisWhite2009ForObject.Type type, RandomLongGenerator uniform, RandomNumberGenerator rng) Constructs a block bootstrap sample generator.- Parameters:
sample
- the original sampleblockLength
- the block lengthtype
- the type of block bootstrap, either PattonPolitisWhite2009ForObject.Type.STATIONARY or PattonPolitisWhite2009ForObject.Type.CIRCULARuniform
- a uniform random number generatorrng
- a random exponential generator
-
PattonPolitisWhite2009
public PattonPolitisWhite2009(double[] sample, PattonPolitisWhite2009ForObject.Type type, RandomLongGenerator uniform, RandomNumberGenerator rng) Constructs a block bootstrap sample generator. The block length is automatically selected.- Parameters:
sample
- the original sampletype
- the type of block bootstrap, either PattonPolitisWhite2009ForObject.Type.STATIONARY or PattonPolitisWhite2009ForObject.Type.CIRCULARuniform
- a concurrent random long generatorrng
- a concurrent random exponential generator
-
PattonPolitisWhite2009
Constructs a block bootstrap sample generator. The block length is automatically selected.- Parameters:
sample
- the original sampletype
- the type of block bootstrap, either PattonPolitisWhite2009ForObject.Type.STATIONARY or PattonPolitisWhite2009ForObject.Type.CIRCULAR
-
PattonPolitisWhite2009
public PattonPolitisWhite2009(double[] sample) Constructs a block bootstrap sample generator. The default method is PattonPolitisWhite2009ForObject.Type.STATIONARY block bootstrapping. The block length is automatically selected.- Parameters:
sample
- the original sample
-
-
Method Details
-
getOptimalBlockLength
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 datatype
- 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}\)
- See Also:
-
seed
public void seed(long... seeds) Description copied from interface:Seedable
Seed the random number/vector/scenario generator to produce repeatable experiments. -
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 interfaceResampler
- Returns:
- a resample, e.g., a bootstrap sample
-