Lcomoment.Lk12 {lmomco} | R Documentation |
Compute a Single Sample L-comoment
Description
Compute the L-comoment () for a given pair of sample of
random variates
from a joint distribution
with marginal distribution functions
and
. When the
are sorted to form the sample order statistics
, then the element of
of the unordered (at leasted expected to be) but shuffled set
that is paired with
the concomitant
of
. (The shuffling occurs by the sorting of
.) The
-order L-comoments are defined (Serfling and Xiao, 2007, eq. 26) as
where is defined under
Lcomoment.Wk
. (The author is aware that is
in Serfling and Xiao (2007) but
returns sample means. This matters only in that the lmomco package returns matrices for
by
Lcomoment.matrix
even though the off diagnonals are NAs
.)
Usage
Lcomoment.Lk12(X1,X2,k=1)
Arguments
X1 |
A vector of random variables (a sample of random variable 1). |
X2 |
Another vector of random variables (a sample of random variable 2). |
k |
The order of the L-comoment to compute. The default is 1. |
Details
Now directing explanation of L-comoments with some reference heading into R code. L-comoments of random variable X1
(a vector) are computed from the concomitants of X2
(another vector). That is, is sorted in ascending order to create the order statistics of
X2
. During the sorting process, X1
is reshuffled to the order of X2
to form the concomitants of X2
(denoted as X12
). So the trailing 2
is the sorted variable and the leading 1
is the variable that is shuffled. The X12
in turn are used in a weighted summation and expectation calculation to compute the L-comoment of X1
with respect to X2
such as by Lk3.12 <-
Lcomoment.Lk12(X1,X2,k=3)
. The notation of Lk12
is to read “Lambda for kth order L-comoment”, where the 12
portion of the notation reflects that of Serfling and Xiao (2007) and then Asquith (2011). The weights for the computation are derived from calls made by Lcomoment.Lk12
to the weight function Lcomoment.Wk
. The L-comoments of X2
are computed from the concomitants of X1
, and the X21
are formed by sorting X1
in ascending order and in turn shuffling X2
by the order of X1
. The often asymmetrical L-comoment of X2
with respect to X1
is readily done (Lk3.21 <-
Lcomoment.Lk12(X2,X1,k=3)
) and is not necessarily equal to (Lk3.12 <-
Lcomoment.Lk12(X1,X2,k=3)
).
Value
A single L-comoment.
Note
The function begins with a capital letter. This is intentionally done so that lower case namespace is preserved. By using a capital letter now, then lcomoment.Lk12
or similar remains an available name in future releases.
Author(s)
W.H. Asquith
References
Asquith, W.H., 2011, Distributional analysis with L-moment statistics using the R environment for statistical computing: Createspace Independent Publishing Platform, ISBN 978–146350841–8.
Serfling, R., and Xiao, P., 2007, A contribution to multivariate L-moments—L-comoment matrices: Journal of Multivariate Analysis, v. 98, pp. 1765–1781.
See Also
Lcomoment.matrix
, Lcomoment.Wk
Examples
X1 <- rnorm(101); X2 <- rnorm(101) + X1
Lcoskew12 <- Lcomoment.Lk12(X1,X2, k=3)
Lcorr12 <- Lcomoment.Lk12(X1,X2,k=2)/Lcomoment.Lk12(X1,X1,k=2)
rhop12 <- cor(X1, X2, method="pearson")
print(Lcorr12 - rhop12) # smallish number