Description Usage Arguments Value Author(s) See Also Examples
Determine the average correlation or average correlation by industry of a variance-covariance matrix.
1 |
V |
Variance-covariance matrix. |
industry |
A vector specifying the industry of the stocks in their order given in the columns (and rows) of |
If industry
is not provided, then the average correlation in V
in the matrix is returned but ignoring the diagonal. If industry
is provided, then the output is a matrix with dimension k
-by-k
, where k
is the number of unique values in industry
.
David Diez
1 2 3 4 5 6 7 8 | #===> the covariance matrix of stock94 <===#
data(stock94)
data(stock94Info)
V <- cov(stock94)
#===> the average correlation <===#
getCorr(V)
getCorr(V, industry=stock94Info$industry)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.