torsion: Computes the Minimum Torsion Matrix

Description Usage Arguments Value Examples

View source: R/torsion.R

Description

Computes the Principal Components Torsion and the Minimum Torsion for diversification analysis.

Usage

1
torsion(sigma, model = "minimum-torsion", method = "exact", max_niter = 10000L)

Arguments

sigma

A n x n covariance matrix.

model

One of: "pca" or "minimum-torsion".

method

One of: "approximate" or "exact". Only used when model = "minimum-torsion".

max_niter

An integer with the maximum number of iterations.

Value

A n x n torsion matrix.

Examples

1
2
3
4
5
6
7
8
9
# 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')

uncorbets documentation built on Sept. 24, 2021, 9:07 a.m.