Learn R Programming

varComp (version 0.2-0)

Chi-bar-square: Chi-bar-square distribution with nonnegativity cone constraints

Description

pchibarsq is the distribution function of chi-bar-square distribution with nonnegativity cone constraint.

wchibarsq computes the mixing proportions for the chi-bar-square distribution.

mchibarsq computes the moments of the chi-bar-square distribution.

Usage

pchibarsq(q, V, lower.tail = TRUE, log.p = FALSE)
mchibarsq(V, order = 1:2)
wchibarsq(V)

Arguments

q

A vector of quantiles, as in stats::pchisq.

V

A positive-definite matrix, defining the distance measure used when projecting onto the cone.

lower.tail

logical, the same as in stats::pchisq.

log.p

logical, the same as in stats::pchisq.

order

A positive integer vector of the order of moments to be computed.

Value

pchibarsq gives the distribution function, wchibarsq gives the mixing proportion, and mchibarsq gives the moments,

References

A. Shapiro (1988) Towards a Unified Theory of Inequality Constrained Testing in Multivariate Analysis. Int. Stat. Rev. 56, 49--62.

Akio Kudo (1963) A multivariate analogue of the one-sided test. Biometrika 50, 403--418.

See Also

stats::pchisq

Examples

Run this code
# NOT RUN {
set.seed(203490L)
  V=crossprod(matrix(rnorm(25),5))
  VI=solve(V)
  L=t(chol(V))
  chibarsq=replicate(1e3L, -2*quadprog::solve.QP(VI, VI%*%(L%*%rnorm(5)),
     diag(1,5), rep(0,5))[['value']] )
  chibarsq=sort(chibarsq)
  p=pchibarsq(chibarsq, V)
  
# }
# NOT RUN {
  plot(ecdf(chibarsq))
  lines(chibarsq, p, col=4, lwd=3, lty=3)
# }
# NOT RUN {
  mean(chibarsq); mean(chibarsq^2)
  mchibarsq(V)
# }

Run the code above in your browser using DataLab