cor {fSeries} | R Documentation |
A collection and description of functions
and methods dealing with correlations between
'timeSeries' objects.
cov | Computes Covariance from a 'timeSeries' object, |
cor | Computes Correlations from a 'timeSeries' object. |
## S3 method for class 'timeSeries': cov(x, y = NULL, use = "all.obs", method = c("pearson", "kendall", "spearman")) ## S3 method for class 'timeSeries': cor(x, y = NULL, use = "all.obs", method = c("pearson", "kendall", "spearman"))
method |
a character string indicating which correlation coefficient (or
covariance) is to be computed. One of "pearson" (default),
"kendall" , or "spearman" , can be abbreviated.
|
use |
an optional character string giving a method for computing
covariances in the presence of missing values. This must
be (an abbreviation of) one of the strings "all.obs" ,
"complete.obs" or "pairwise.complete.obs" .
|
x |
an univariate object of class timeSeries .
|
y |
NULL (default) or a timeSeries object with compatible
dimensions to x . The default is equivalent to y = x (but
more efficient).
|
returns the covariance or correlation matrix.
Diethelm Wuertz for the Rmetrics R-port.
## data - x = as.timeSeries(data(msft.dat))[, 1:4] x = 100*returnSeries(x) ## cov - cov(x[, "Open"], x[, "Close"]) cov(x)