pRQF | R Documentation |
This function computes cumulative probabilities (lower or upper tail) on a ratio of quadratic forms in a vector of normally distributed random variables.
pRQF(
r,
A,
B,
Sigma = diag(nrow(A)),
algorithm = c("imhof", "davies", "integrate"),
lower.tail = TRUE,
usenames = FALSE
)
r |
A double representing the value(s) for which |
A |
A numeric, symmetric matrix that is symmetric |
B |
A numeric, symmetric, non-negative definite matrix having the same
dimensions as |
Sigma |
A numeric, symmetric matrix with the same dimensions as
|
algorithm |
A character, either |
lower.tail |
A logical. If |
usenames |
A logical. If |
Most of the work is done by other functions, namely
imhof
, davies
,
or integrate
(depending on the algorithm
argument). It is assumed that the ratio of quadratic forms can be
expressed as
R = \displaystyle\frac{x' A x}{x' B x}
where x
is an
n
-dimensional normally distributed random variable with mean vector
\mu
and covariance matrix \Sigma
, and A
and
B
are real-valued, symmetric n\times n
matrices. Matrix
B
must be non-negative definite to ensure that the denominator of
the ratio of quadratic forms is nonzero.
The function makes use of the fact that a probability statement involving a
ratio of quadratic forms can be rewritten as a probability statement
involving a quadratic form. Hence, methods for computing probabilities
for a quadratic form in normal random variables, such as the Imhof
algorithm \insertCiteImhof61skedastic or the Davies algorithm
\insertCiteDavies80skedastic can be applied to the rearranged
expression to obtain the probability for the ratio of quadratic forms.
Note that the Ruben-Farebrother algorithm (as implemented in
farebrother
) cannot be used here because the
A
matrix within the quadratic form (after rearrangement of the
probability statement involving a ratio of quadratic forms) is not in
general positive semi-definite.
A double denoting the probability/ies corresponding to the value(s)
r
.
Duchesne10;textualskedastic, the article associated
with the imhof
and
davies
functions.
n <- 20
A <- matrix(data = 1, nrow = n, ncol = n)
B <- diag(n)
pRQF(r = 1, A = A, B = B)
pRQF(r = 1, A = A, B = B, algorithm = "integrate")
pRQF(r = 1:3, A = A, B = B, algorithm = "davies")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.