rmammen: Distributions suggested by Mammen for Wild Bootstrap.

View source: R/rmammen.R

rmammenR Documentation

Distributions suggested by Mammen for Wild Bootstrap.

Description

Generates random variates from one of three distributions suggested by Mammen (1993) for use in Wild Bootstrap.

Usage

rmammen(n, construct = c("normal-2", "normal-1", "two-point mass"))

Arguments

n

Number of observations. If length(n) > 1, the length is taken to be the number required.

construct

Character string; indicates which of three constructs from which to generate. One of "two-point mass", "normal-1", normal-2" (default).

Details

Generates a random variable U. If construct = "two-point mass", the random variable U is defined as

Pr(U = u) = \begin{cases} \frac{\sqrt{5} + 1}{2\sqrt{5}} & u = \frac{-(\sqrt{5}-1)}{2} \\ \frac{\sqrt{5} - 1}{2\sqrt{5}} & u = \frac{\sqrt{5}+1}{2} \end{cases}

If construct = "normal-1", the random variable U is defined as

U = \frac{V}{\sqrt{2}} + \frac{V^2 - 1}{2}

where V \sim N(0,1). If construct = "normal-2", the random variable U is defined as

U = \left(\delta_1 + V_1/\sqrt{2}\right) \left(\delta_2 + V_2/\sqrt{2}\right) - \delta_1\delta_2

where V_1,V_2 are independent N(0,1) random variables and

\delta_1 = \left(3/4 + \sqrt{17}/12\right)^{1/2}

\delta_2 = \left(3/4 - \sqrt{17}/12\right)^{1/2}

Value

A vector of length n.

References

Mammen E. "Bootstrap and Wild Bootstrap for High Dimensional Linear Models." The Annals of Statistics (1993) 21(1):255-285.

Examples

mammen_sample <- rmammen(10000, construct = "normal-2")
mean(mammen_sample)
mean(mammen_sample^2)
mean(mammen_sample^3)

plot(density(mammen_sample,
main = "Mammen's Suggested Distribution for the Wild Bootstrap"))


reyesem/IntroAnalysis documentation built on March 29, 2025, 3:29 p.m.