Description Usage Arguments Author(s) Examples
Generates R
number of parameter estimates
from a vector of thetahat
≤ft( \boldsymbol{\hat{θ} }\right)
and
sampling variances and covariances of thetahat
\widehat{\mathrm{Cov}} ≤ft( \boldsymbol{\hat{θ}} \right).
If length of thetahat
is greater than 1,
a multivariate normal distribution is assumed.
If length of thetahat
is equal 1,
a univariate normal distribution is assumed.
1 | mc(thetahat, vcovhat, R = 20000L)
|
thetahat |
Numeric vector. Parameter estimates \boldsymbol{\hat{θ}}. |
vcovhat |
Symmetric matrix. Estimated sampling variances and covariances of parameter estimates \widehat{\mathrm{Cov}} ≤ft( \boldsymbol{\hat{θ}} \right). |
R |
Integer. Number of Monte Carlo replications. |
Ivan Jacob Agaloos Pesigan
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 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 | R <- 20000L
# length 1
thetahat <- 100
vcovhat <- 1.5
mc_star_length_1 <- mc(
thetahat = thetahat,
vcovhat = vcovhat,
R = R
)
str(mc_star_length_1)
hist(
mc_star_length_1,
main = expression(
paste(
"Histogram of ",
hat(theta),
"*"
)
),
xlab = expression(
paste(
hat(theta),
"*"
)
)
)
qqnorm(mc_star_length_1)
qqline(mc_star_length_1)
# length greater than 1
alphahat <- 0.3386
betahat <- 0.4510
alphahat_betahat <- alphahat * betahat
varhat_alphahat <- 0.1224^2
varhat_betahat <- 0.1460^2
thetahat <- c(
alphahat,
betahat
)
vcovhat <- matrix(
data = c(
varhat_alphahat,
0.00,
0.00,
varhat_betahat
),
ncol = 2
)
mc_star_length_2 <- mc(
thetahat = thetahat,
vcovhat = vcovhat,
R = R
)
str(mc_star_length_2)
alphahat_betahat_star <- mc_star_length_2[, 1] * mc_star_length_2[, 2]
hist(
alphahat_betahat_star,
main = expression(
paste(
"Histogram of ",
hat(alpha),
hat(beta),
"*"
)
),
xlab = expression(
paste(
hat(alpha),
hat(beta),
"*"
)
)
)
qqnorm(alphahat_betahat_star)
qqline(alphahat_betahat_star)
wald(
thetahat = alphahat_betahat,
sehat = sd(alphahat_betahat_star)
)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.