cov | R Documentation |
This function calculates the sample covariance between two realizations of
n nonempty compact real intervals drawn from two random intervals
saved as two different IntervalList
objects.
## S4 method for signature 'IntervalList,IntervalList' cov(x, y, theta = 1)
x |
A list of intervals, that is, an |
y |
A list of intervals, that is, an |
theta |
A single positive real number saved as a |
Let \mathcal{X} and \mathcal{Y} be two interval-valued random sets and let ≤ft((x_{1},y_{1}),(x_{2},y_{2}), …, (x_{n},y_{n})\right) be a sample of n independent observations drawn from ≤ft(\mathcal{X},\mathcal{Y}\right). Then, the sample covariance between \mathcal{X} and \mathcal{Y} is defined as the following real number given by
s_{\mathcal{X}~\mathcal{Y}} = s_{\mathrm{mid}~\mathcal{X}~\mathrm{mid}~\mathcal{Y}}+θ\cdot s_{\mathrm{spr}~\mathcal{X}~\mathrm{spr}~\mathcal{Y}},
where θ>0 and
s_{\mathrm{mid}~\mathcal{X}~\mathrm{mid}~\mathcal{Y}} = \frac{1}{n}∑_{i=1}^{n}(\mathrm{mid}~x_{i} - \mathrm{mid}~\overline{x})(\mathrm{mid}~y_{i}-\mathrm{mid}~\overline{y}),
s_{\mathrm{spr}~\mathcal{X}~\mathrm{spr}~\mathcal{Y}} = \frac{1}{n}∑_{i=1}^{n}(\mathrm{spr}~x_{i} - \mathrm{spr}~\overline{x})(\mathrm{spr}~y_{i}-\mathrm{spr}~\overline{y}),
with \overline{x} and \overline{y} being the sample Aumann means of the given one-dimensional random samples.
This function returns the calculated sample covariance of two samples
of n interval-valued data, which is defined as a real number.
Therefore, the output of this function is a single numeric
value.
José García-García garciagarjose@uniovi.es
Other sample central tendency and dispersion measures such as sample
Aumann mean and sample Fréchet variance can be calculated through
mean()
and var()
functions, respectively.
## Some cov() examples changing theta list1 <- IntervalList(c(0, 3, 2, 5, 6), c(4, 5, 4, 8, 7)) list2 <- IntervalList(c(3, 0, 3, 1, 4), c(7, 4, 6, 2, 6)) cov(list1, list2) cov(list1, list2, 1/3) ## Note that cov(X, X) = var(X) cov(list1, list1) var(list1) cov(list1, list1, 1/3) var(list1, 1/3)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.