var
, cov
and cor
compute the distribution of the variance statistic of x and the distribution of the covariance statistic or the correlation statistic of x and y if these are vectors. If x and y are matrices then the covariances (or correlations) between the columns of x and the columns of y are computed.cov(x, ...)
cor(x, ...)
var(x, ...) ## S3 method for class 'rv':
cov(x, y=NULL, \dots)
## S3 method for class 'rv':
cor(x, y=NULL, \dots)
## S3 method for class 'rv':
var(x, \dots)
sd(x, na.rm=FALSE)
NULL
(default) or a vector, matrix or data frame with compatible dimensions to x. The default is equivalent to y = x (but more efficient).cov
, var
, cor
are now generic - whenever the rv
package is loaded. The original functions in the stats
package
are the default functions of these generic functions.
To access the original help page in the stats package,
go to cov2cor
or
detach the rv package and then access the help pages in the stat package.
sd
is not generic but it is rewritten to catch the possibility
that the argument is a random variable object.
cov
gives the distribution (that is, a random variable object)
of the covariance statistic, as computed by the
standard R function cov
.
This is implemented simply by applying the numerical
cov
function to the rows of the simulation matrices
of x
and y
and forming a new rv object
from the resulting vector of simulations.
Alternatively x
may be a random matrix (and y
NULL
).
Then the numerical function cov
is m
cor
works similarly, but returns the distribution of the
correlation statistic (i.e. function).
var
computes the distribution of the variance statistic.
See also vignette("rv")
.
cov
, cor
, var
, sd
for details.