# 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')
Run the code above in your browser using DataLab