comp_boot_mul_wgt: Generate Different Types of multiplier bootstrap weights

Description Usage Arguments Value References Examples

View source: R/ols-boot-multiplier.R

Description

comp_boot_mul_wgt is a Helper function for comp_boot_mul to generate different types of multiplier bootstrap weights. This section is inspired by the weighttype option in the Stata boottest package.

Usage

1
comp_boot_mul_wgt(n, weights_type)

Arguments

n

The number of random multiplier bootstrap weights to generate.

weights_type

The type of multiplier bootstrap weights to generate. Based on the weighttype option in the Stata boottest package, this can only take the following five pre-specified values "rademacher", "mammen", "webb", "std_gaussian", "gamma". A brief description of each type is as follows. The "rademacher" weights are sampled from the two point Rademacher distribution which takes values \{1, 1\}, with equal probability. The "mammen" weights are sampled from the two point Mammen distribution which has takes values \{φ, 1 - φ\}, with probabilities \{\frac{φ}{√{5}}, 1 - \frac{φ}{√{5}}\}, respectively. The "webb" weights are sampled from the six point Webb distribution which has takes values \{\pm √{\frac{3}{2}}, \pm √{\frac{1}{2}}, \pm 1 \}, with equal probability. The "std_gaussian" weights are sampled from the standard Gaussian (normal) distribution with mean = 0, and variance = 1. Finally, the "gamma" weights are sampled from the Gamma distribution with shape parameter = 4, and scale parameter = 1. For more details on these weight types see \insertCite@see @roodman2019fastwildinferencestataboottest;textualmaars.

Value

A numeric vector of n (sampled with replacement) random multiplier bootstrap weights based on the specified multiplier weights type.

References

\insertAllCited

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
## Not run: 
set.seed(824908)
# Number of multiplier weights to generate
n <- 1000

# Generate the different type of multiplier weights
rademacher_w <- comp_boot_mul_wgt(
  n = n,
  weights_type = "rademacher"
)
mammen_w <- comp_boot_mul_wgt(n = n, weights_type = "mammen")
webb_w <- comp_boot_mul_wgt(n = n, weights_type = "webb")
std_gaussian_w <- comp_boot_mul_wgt(
  n = n,
  weights_type = "std_gaussian"
)
gamma_w <- comp_boot_mul_wgt(n = n, weights_type = "gamma")

## End(Not run)

shamindras/maars documentation built on Sept. 21, 2021, 2:50 a.m.