cov {IntervalQuestionStat}R Documentation

Calculate the sample covariance between two random intervals

Description

This function calculates the sample covariance between two realizations of nn nonempty compact real intervals drawn from two random intervals saved as two different IntervalList objects.

Usage

## S4 method for signature 'IntervalList,IntervalList'
cov(x, y, theta = 1)

Arguments

x

A list of intervals, that is, an IntervalList object.

y

A list of intervals, that is, an IntervalList object with the same length as x.

theta

A single positive real number saved as a numeric object. By default, theta = 1.

Details

Let X\mathcal{X} and Y\mathcal{Y} be two interval-valued random sets and let ((x1,y1),(x2,y2),,(xn,yn))\left((x_{1},y_{1}),(x_{2},y_{2}), \ldots, (x_{n},y_{n})\right) be a sample of nn independent observations drawn from (X,Y)\left(\mathcal{X},\mathcal{Y}\right). Then, the sample covariance between X\mathcal{X} and Y\mathcal{Y} is defined as the following real number given by

sX Y=smid X mid Y+θsspr X spr Y,s_{\mathcal{X}~\mathcal{Y}} = s_{\mathrm{mid}~\mathcal{X}~\mathrm{mid}~\mathcal{Y}}+\theta\cdot s_{\mathrm{spr}~\mathcal{X}~\mathrm{spr}~\mathcal{Y}},

where θ>0\theta>0 and

smid X mid Y=1ni=1n(mid ximid x)(mid yimid y),s_{\mathrm{mid}~\mathcal{X}~\mathrm{mid}~\mathcal{Y}} = \frac{1}{n}\sum_{i=1}^{n}(\mathrm{mid}~x_{i} - \mathrm{mid}~\overline{x})(\mathrm{mid}~y_{i}-\mathrm{mid}~\overline{y}),

sspr X spr Y=1ni=1n(spr xispr x)(spr yispr y),s_{\mathrm{spr}~\mathcal{X}~\mathrm{spr}~\mathcal{Y}} = \frac{1}{n}\sum_{i=1}^{n}(\mathrm{spr}~x_{i} - \mathrm{spr}~\overline{x})(\mathrm{spr}~y_{i}-\mathrm{spr}~\overline{y}),

with x\overline{x} and y\overline{y} being the sample Aumann means of the given one-dimensional random samples.

Value

This function returns the calculated sample covariance of two samples of nn interval-valued data, which is defined as a real number. Therefore, the output of this function is a single numeric value.

Author(s)

José García-García garciagarjose@uniovi.es

See Also

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.

Examples

## 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)

[Package IntervalQuestionStat version 0.2.0 Index]