con_weights_boot {restriktor} | R Documentation |
function for computing the chi-bar-square weights based on Monte Carlo simulation.
Description
The null-distribution of the test statistics under inequality constraints takes the form of mixtures of F-distributions. This function computes these mixing weights (a.k.a chi-bar-square weights and level probabilities).
Usage
con_weights_boot(VCOV, Amat, meq, R = 1e5L,
chunk_size = 5000L, convergence_crit = 1e-03,
seed = NULL, verbose = FALSE, ...)
Arguments
VCOV |
variance-covariance matrix of the data for which the weights are to be calculated. |
Amat |
constraints matrix |
meq |
integer (default = 0) treating the number of
constraints rows as equality constraints instead of inequality
constraints. For example, if |
R |
integer; the maximum number of bootstrap draws for
|
chunk_size |
integer; the chi-bar-square weights are computed for samples of
size |
convergence_crit |
the convergence criterion for the iterative process. The default is 1e-03. See details for more information. |
seed |
seed value. |
verbose |
logical; if TRUE, information is shown at each bootstrap draw. |
... |
additional parameters for the |
Details
## Iterative Weight Updating and Convergence Checking ## The function adds in each run chunks of 5000 samples (default) to compute the chi-bar-square weights. After each iteration, the function checks if the weights have converged. This is determined by the convergence_crit parameter.
Convergence is assessed by comparing the absolute difference between the current and previous iteration's weights against the convergence_crit. If the change in weights is smaller than the convergence criterion, it indicates that the weights have stabilized, suggesting convergence.
If the weights have not converged and the mix_weights_bootstrap_limit
has
not been reached, the function proceeds with adding another set of 5000 samples
and updates the weights accordingly.If the maximum number of iterations is
reached without convergence, the function returns the (non-converged) weights.
In this situation, it is advisible to increase the number of
mix_weights_bootstrap_limit
.
Value
If convergence is reached, the function returns a vector with the mixing weights with the following attributes:
total_bootstrap_draws |
total number of bootstrap draws |
converged |
have the chi-bar-square weights converged |
convergence_crit |
convergence criterium |
wt_bar_chunk |
matrix with the chi-bar-square weights for each iteration |
chunk_size |
how many samples are added in each iteration |
total_chunks |
what is the maximum number of chunks based on
|
chunk_iter |
number of iterations run |
error.idx |
which bootstrap samples were not succesful |
mix_weights_bootstrap_limit |
the maximum number of bootstrap draws |
Author(s)
Leonard Vanbrabant and Yves Rosseel
References
Silvapulle, M.J. and Sen, P.K. (2005, p.79). Constrained Statistical Inference. Wiley, New York.
Examples
W <- matrix(c(1,0.5,0.5,1),2,2)
Amat <- rbind(c(0,1))
meq <- 0L
wt.bar <- con_weights_boot(W, Amat, meq, R = 99999)
wt.bar
# in practice you want to use are more conservative convergence criterion
wt.bar2 <- con_weights_boot(W, Amat, meq, R = 99999, convergence_crit = 1e-02)
wt.bar2