View source: R/max_effective_bets.R
max_effective_bets | R Documentation |
Finds the allocation that maximizes the effective_bets
.
max_effective_bets(x0, sigma, t, tol = 1e-20, maxeval = 5000L, maxiter = 5000L)
x0 |
A |
sigma |
A |
t |
A |
tol |
An |
maxeval |
An |
maxiter |
An |
A list
with the following components:
weights
: the optimal allocation policy
enb
: the optimal effective number of bets
counts
: the number of iterations of the objective and the gradient
lambda_lb
: the lower bound Lagrange multipliers
lambda_ub
: the upper bound Lagrange multipliers
lambda_eq
: the equality Lagrange multipliers
gradient
: the gradient of the objective function at the optimum
hessian
: hessian of the objective function at the optimum
solnl
# 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.