Description Usage Arguments Details Value Author(s) References See Also Examples
Generates B
number of parametric bootstrap
samples from estimated parameters of original univariate sample data
.
data
is referred to as the empirical distribution
\hat{ F }_{ \mathcal{ Distribution } }
. The default distribution is
\mathcal{ N } ≤ft( \hat{ μ }, \hat{ σ }^2 \right) %(\#eq:boot-pb-norm)
.
The univariate distribution and parameters used in the
data generating process can be specified using rFUN
and ...
.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
n |
Integer. Sample size. |
rFUN |
Function. Data generating function to generate univariate data. |
... |
Arguments to pass to |
B |
Integer. Number of bootstrap samples. |
par |
Logical.
If |
ncores |
Integer.
Number of cores to use if |
mc |
Logical.
If |
lb |
Logical.
If |
cl_eval |
Logical.
Execute |
cl_export |
Logical.
Execute |
cl_expr |
Expression.
Expression passed to |
cl_vars |
Character vector.
Names of objects to pass to |
rbind |
NULL or logical.
If |
For more details and examples see the following vignettes:
Returns a list of length B
of parametric bootstrap samples.
Ivan Jacob Agaloos Pesigan
Efron, B., & Tibshirani, R. J. (1993). An introduction to the bootstrap. New York, N.Y: Chapman & Hall.
Wikipedia: Bootstrapping (statistics)
Other bootstrap functions:
nb()
,
pbmvn()
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 | n <- 5
B <- 5
# normal distribution---------------------------------------------------------
mu <- 100
sigma2 <- 225
sigma <- sqrt(sigma2)
x <- rnorm(
n = n,
mean = mu,
sd = sigma
)
muhatthetahat <- mean(x)
Sigmahatthetahat <- sd(x)
xstar <- pbuniv(
n = n,
rFUN = rnorm,
B = B,
mean = muhatthetahat,
sd = Sigmahatthetahat
)
str(xstar)
# binomial distribution-------------------------------------------------------
n_trials <- 1
p <- 0.50
x <- rbinom(
n = n,
size = n_trials,
prob = p
)
phat <- mean(x) / n_trials
xstar <- pbuniv(
n = n,
rFUN = rbinom,
B = B,
size = n_trials,
prob = phat
)
str(xstar)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.