compute_MellinQF {QF} | R Documentation |
Mellin Transform of a Positive QF
Description
The function computes the Mellin transform of a positive definite quadratic form producing a MellinQF
object.
The output can be used to evaluate the density, cumulative and quantile functions of
the target quadratic form.
Usage
compute_MellinQF(
lambdas,
etas = rep(0, length(lambdas)),
eps = 1e-06,
rho = 1 - 1e-04,
maxit_comp = 1e+05,
eps_quant = 1e-06,
maxit_quant = 10000,
lambdas_tol = NULL
)
Arguments
lambdas |
vector of positive weights. |
etas |
vector of non-centrality parameters. Default all zeros (central chi square). |
eps |
required absolute error for density and cumulative functions. |
rho |
distribution total probability mass for which it is desired to keep the error |
maxit_comp |
maximum number of iterations. |
eps_quant |
required numerical error for quantile computation. |
maxit_quant |
maximum number of iterations before stopping the quantile computation. |
lambdas_tol |
maximum value admitted for the weight skewness. When it is not NULL (default), elements of lambdas such that the ratio max(lambdas)/lambdas is greater than the specified value are removed. |
Details
The quadratic form having positive weights lambdas
and non-centrality parameters etas
is considered:
Q=\sum_{i=1}^r \lambda_i\chi^2_{1,\eta_i}.
Its Mellin transform is computed by exploiting the density formulation by Ruben (1962).
The numerical error is controlled in order to provide the requested precision (eps
) for the
interval of quantiles that contains the specified total probability rho
.
The argument eps_quant
controls the relative precision requested for the
computation of quantiles that determine the range in which the error eps
is
guaranteed, whereas maxit_quant
sets the maximum number of Newton-Raphson iterations of the algorithm.
Value
The function returns an object of the class MellinQF
that contains information on the Mellin transform
of a linear combination of positively weighted chi-square random variables. This information can be used in order to
evaluate the density, cumulative distribution and quantile functions.
An object of the class MellinQF
has the following components:
-
range_q
: the range of quantiles that contains the specified mass of probabilityrho
in which it is possible to compute density and CDF preserving the error leveleps
. -
Mellin
: a list containing the values of the Mellin transform (Mellin
), the corresponding evaluation points (z
), the integration stepdelta
and the lowest weight (lambda_min
). the inputs
rho
,lambdas
,etas
,eps
needed for CDF, PDF and quantile function computation.
Source
Ruben, Harold. "Probability content of regions under spherical normal distributions, IV: The distribution of homogeneous and non-homogeneous quadratic functions of normal variables." The Annals of Mathematical Statistics 33.2 (1962): 542-570.
See Also
The function print.MellinQF
can be used to summarize the basic information on the Mellin transform.
The object can be used in the function dQF
to compute the density function of the QF,
pQF
for the CDF and qQF
for the quantile function.
Examples
library(QF)
# Definition of the QF
lambdas_QF <- c(rep(7, 6),rep(3, 2))
etas_QF <- c(rep(6, 6), rep(2, 2))
# Computation Mellin transform
eps <- 1e-7
rho <- 0.999
Mellin <- compute_MellinQF(lambdas_QF, etas_QF, eps = eps, rho = rho)
print(Mellin)