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).
con_weights_boot(VCOV, Amat, meq, R = 1e5L,
chunk_size = 5000L, convergence_crit = 1e-03,
seed = NULL, verbose = FALSE, ...)
If convergence is reached, the function returns a vector with the mixing weights with the following attributes:
total number of bootstrap draws
have the chi-bar-square weights converged
convergence criterium
matrix with the chi-bar-square weights for each iteration
how many samples are added in each iteration
what is the maximum number of chunks based on
mix_weights_bootstrap_limit
and chunk_size
number of iterations run
which bootstrap samples were not succesful
the maximum number of bootstrap draws
variance-covariance matrix of the data for which the weights are to be calculated.
constraints matrix \(R\) (or a vector in
case of one constraint) and defines the left-hand side of the
constraint \(R\theta \ge rhs\), where each row represents one
constraint. The number of columns needs to correspond to the
number of parameters estimated (\(\theta\)). The rows should
be linear independent, otherwise the function gives an
error. For more information about constructing the matrix \(R\)
and \(rhs\) see restriktor
.
integer (default = 0) treating the number of
constraints rows as equality constraints instead of inequality
constraints. For example, if meq = 2
, this means that the
first two rows of the constraints matrix \(R\) are treated as
equality constraints.
integer; the maximum number of bootstrap draws for
mix_weights_bootstrap_limit
.
The default value is set to 1e5. See details for more information.
integer; the chi-bar-square weights are computed for samples of
size chunk_size = 5000L
. This process is repeated iteratively until the
weights converges (see convergenge_crit
) or the maximum is reached, i.e.,
mix_weights_bootstrap_limit.
the convergence criterion for the iterative process. The default is 1e-03. See details for more information.
seed value.
logical; if TRUE, information is shown at each bootstrap draw.
additional parameters for the rtmvnorm
function.
Leonard Vanbrabant and Yves Rosseel
## 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
.
Silvapulle, M.J. and Sen, P.K. (2005, p.79). Constrained Statistical Inference. Wiley, New York.
# \donttest{
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
# }
Run the code above in your browser using DataLab