d2_ij {qfratio} | R Documentation |
Coefficients in polynomial expansion of generating function—for ratios with two matrices
Description
These are internal functions to calculate the coefficients
in polynomial expansion of joint generating functions for two
quadratic forms in potentially noncentral multivariate normal variables,
\mathbf{x} \sim N_n(\bm{\mu}, \mathbf{I}_n)
. They
are primarily used in calculations around moments of a ratio
involving two or three quadratic forms.
Usage
d2_ij_m(
A1,
A2,
m = 100L,
p = m,
q = m,
thr_margin = 100,
fill_all = !missing(p) || !missing(q)
)
d2_ij_v(
L1,
L2,
m = 100L,
p = m,
q = m,
thr_margin = 100,
fill_all = !missing(p) || !missing(q)
)
d2_pj_m(A1, A2, m = 100L, p = 1L, thr_margin = 100)
d2_1j_m(A1, A2, m = 100L, thr_margin = 100)
d2_pj_v(L1, L2, m = 100L, p = 1L, thr_margin = 100)
d2_1j_v(L1, L2, m = 100L, thr_margin = 100)
h2_ij_m(
A1,
A2,
mu = rep.int(0, n),
m = 100L,
p = m,
q = m,
thr_margin = 100,
fill_all = !missing(p) || !missing(q)
)
h2_ij_v(
L1,
L2,
mu = rep.int(0, n),
m = 100L,
p = m,
q = m,
thr_margin = 100,
fill_all = !missing(p) || !missing(q)
)
htil2_pj_m(A1, A2, mu = rep.int(0, n), m = 100L, p = 1L, thr_margin = 100)
htil2_1j_m(A1, A2, mu = rep.int(0, n), m = 100L, thr_margin = 100)
htil2_pj_v(L1, L2, mu = rep.int(0, n), m = 100L, p = 1L, thr_margin = 100)
htil2_1j_v(L1, L2, mu = rep.int(0, n), m = 100L, thr_margin = 100)
hhat2_pj_m(A1, A2, mu = rep.int(0, n), m = 100L, p = 1L, thr_margin = 100)
hhat2_1j_m(A1, A2, mu = rep.int(0, n), m = 100L, thr_margin = 100)
hhat2_pj_v(L1, L2, mu = rep.int(0, n), m = 100L, p = 1L, thr_margin = 100)
hhat2_1j_v(L1, L2, mu = rep.int(0, n), m = 100L, thr_margin = 100)
Arguments
A1 , A2 |
Argument matrices. Assumed to be symmetric and of the same order. |
m |
Integer-alike to specify the desired order along |
p , q |
Integer-alikes to specify the desired orders along
|
thr_margin |
Optional argument to adjust the threshold for scaling (see “Scaling”
in |
fill_all |
Logical to specify whether all the output matrix should be filled. See “Details”. |
L1 , L2 |
Eigenvalues of the argument matrices |
mu |
Mean vector |
Details
d2_**_*()
functions calculate
d_{i,j}(\mathbf{A}_1, \mathbf{A}_2)
in
Hillier et al. (2009, 2014) and Bao and Kan (2013). These are also related to
the top-order invariant polynomials
C_{[k_1],[k_2]}(\mathbf{A}_1, \mathbf{A}_2)
in the following way:
d_{i,j}(\mathbf{A}_1, \mathbf{A}_2) =
\frac{1}{k_1! k_2!} \left( \frac{1}{2} \right)_{k_1 + k_2}
C_{[k_1],[k_2]}(\mathbf{A}_1, \mathbf{A}_2)
,
where (x)_k = x (x + 1) \dots (x + k - 1)
(Chikuse 1987; Hillier et al. 2009).
h2_ij_*()
and htil2_pj_*()
functions calculate
h_{i,j}(\mathbf{A}_1, \mathbf{A}_2)
and
\tilde{h}_{i,j}(\mathbf{A}_1; \mathbf{A}_2)
,
respectively, in Bao and Kan (2013). Note that the latter is denoted by the
symbol h_{i,j}
in Hillier et al. (2014). hhat2_pj_*()
functions are for
\hat{h}_{i,j}(\mathbf{A}_1; \mathbf{A}_2)
in Hillier et al. (2014), used to calculate an error bound for
truncated sum for moments of a ratio of quadratic forms. The
mean vector \bm{\mu}
is a parameter in all these.
There are two different situations in which these coefficients are used
in calculation of moments of ratios of quadratic forms:
1) within an infinite series for one of the subscripts, with the
other subscript fixed (when the exponent p
of the numerator
is integer); 2) within a double infinite series for both subscripts
(when p
is non-integer) (see Bao and Kan 2013). In this package,
the situation 1 is handled by the *_pj_*
(and *_1j_*
)
functions, and 2 is by the *_ij_*
functions.
In particular, the *_pj_*
functions always return a
(p + 1) * (m + 1)
matrix where all elements are filled with
the relevant coefficients (e.g., d_{i,j}
, \tilde{h}_{i,j}
),
from which, typically, the [p + 1, ]
-th row is used for
subsequent calculations. (Those with *_1q_*
are simply fast versions
for the commonly used case where p = 1
.)
On the other hand, the *_ij_*
functions by default return a
(m + 1) * (m + 1)
matrix whose upper-left triangular part
(including the diagonals) is filled with the coefficients
(d_{i,j}
or h_{i,j}
), the rest being 0, and all the coefficients
are used in subsequent calculations.
(At present, the *_ij_*
functions also have the functionality to
fill all coefficients of a potentially non-square output matrix,
but this is less efficient than *_pj_*
functions so may
be omitted in the future development.)
Those ending with _m
take matrices as arguments, whereas
those with _v
take eigenvalues. The latter can be used only when
the argument matrices share the same eigenvectors, to which the eigenvalues
correspond in the orders given, but is substantially faster.
This package also involves C++ equivalents for most of these functions
(which are suffixed by E
for Eigen
),
but these are exclusively for internal use and not exposed to the user.
Value
(p + 1) * (m + 1)
matrix for the *_pj_*
functions.
(m + 1) * (m + 1)
matrix for the *_ij_*
functions.
The rows and columns correspond to increasing orders for
\mathbf{A}_1
and \mathbf{A}_2
, respectively. And
the 1st row/column of each dimension corresponds
to the 0th order (hence [p + 1, q + 1]
for the (p,q)
-th order).
Has the attribute "logscale"
as described in the
“Scaling” section in d1_i
. This is
a matrix of the same size as the return itself.
References
Bao, Y. and Kan, R. (2013) On the moments of ratios of quadratic forms in normal random variables. Journal of Multivariate Analysis, 117, 229–245. doi:10.1016/j.jmva.2013.03.002.
Chikuse, Y. (1987) Methods for constructing top order invariant polynomials. Econometric Theory, 3, 195–207. doi:10.1017/S026646660001029X.
Hillier, G., Kan, R. and Wang, X. (2009) Computationally efficient recursions for top-order invariant polynomials with applications. Econometric Theory, 25, 211–242. doi:10.1017/S0266466608090075.
Hillier, G., Kan, R. and Wang, X. (2014) Generating functions and short recursions, with applications to the moments of quadratic forms in noncentral normal vectors. Econometric Theory, 30, 436–473. doi:10.1017/S0266466613000364.
See Also
qfrm
and qfmrm
are
major front-end functions that utilize these functions
dtil2_pq
for \tilde{d}
used for moments of a product of quadratic forms
d3_ijk
for equivalents for three matrices