torsion | R Documentation |
Computes the Principal Components Torsion and the Minimum Torsion for diversification analysis.
torsion(sigma, model = "minimum-torsion", method = "exact", max_niter = 10000L)
sigma |
A |
model |
One of: "pca" or "minimum-torsion". |
method |
One of: "approximate" or "exact". Only used when |
max_niter |
An |
A n x n
torsion matrix.
# extract the invariants from the data
set.seed(123)
log_ret <- matrix(rnorm(400), ncol = 4) / 10
# calculate the covariance matrix
sigma <- stats::cov(log_ret)
# torsion
torsion(sigma = sigma, model = 'minimum-torsion', method ='exact')
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.