# extract the invariants from the data
set.seed(123)
log_ret <- matrix(stats::rnorm(400), ncol = 4) / 10
# compute the covariance matrix
sigma <- stats::cov(log_ret)
# torsion
torsion_cov <- torsion(sigma = sigma, model = 'minimum-torsion', method = 'exact')
# 1/N reference
b <- rep(1 / ncol(log_ret), ncol(log_ret))
max_effective_bets(x0 = b, sigma = sigma, t = torsion_cov)
Run the code above in your browser using DataLab