Learn R Programming

fda.usc (version 0.9.4)

rber.gold: Gold section bootstrap sampling

Description

Sampling from a binomial variable with values $\Big{\frac{1-\sqrt{5}}{2},\,\frac{1+\sqrt{5}}{2}\Big}$ and probabilities $\Big{\frac{5+\sqrt{5}}{10},\,\frac{5-\sqrt{5}}{10}\Big}$, respectively.

Usage

rber.gold (n)

Arguments

n
Number of observations.

Value

  • A sample of length n of the random variable $V$.

Details

For the construction of wild bootstrap residuals, sampling from a random variable $V$ such that $E[V^2]=0$ and $E[V]=0$ is needed. A simple and suitable $V$ is obtained with a binomial variable of the form: $$P\Bigg{ V=\frac{1-\sqrt{5}}{2} \Bigg} = \frac{5+\sqrt{5}}{10} \, and \, P\Bigg{ V=\frac{1+\sqrt{5}}{2} \Bigg} = \frac{5-\sqrt{5}}{10},$$ which leads to the golden section bootstrap. If e denotes a vector of n residuals, the wild bootstrap residuals would be computed as e*rber.gold(n).

See Also

rbinom, flm.test, flm.Ftest, dfv.test

Examples

Run this code
# Sampling
samp=rber.gold(100)
mean(samp)
sd(samp)
samp

# Construction of wild bootstrap residuals
e=rnorm(200)
e.boot=e*rber.gold(200)
summary(e)
summary(e.boot)

Run the code above in your browser using DataLab