rmammen | R Documentation |
Generates random variates from one of three distributions suggested by Mammen (1993) for use in Wild Bootstrap.
rmammen(n, construct = c("normal-2", "normal-1", "two-point mass"))
n |
Number of observations. If |
construct |
Character string; indicates which of three constructs from which to generate. One of "two-point mass", "normal-1", normal-2" (default). |
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}
A vector of length n
.
Mammen E. "Bootstrap and Wild Bootstrap for High Dimensional Linear Models." The Annals of Statistics (1993) 21(1):255-285.
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"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.