Risk-Diversification powered by the Minimum Torsion Algorithm
Source:R/max_effective_bets.R
max_effective_bets.RdFinds the allocation that maximizes the effective_bets.
Arguments
- x0
A
numericvector for the search starting point. Usually the "one over n" allocation.- sigma
A
n x ncovariance matrix.- t
A
n x ntorsion matrix.- tol
An
intergerwith the convergence tolerance.- maxeval
An
integerwith the maximum number of evaluations of the objective function.- maxiter
An
integerwith the maximum number of iterations.
Value
A list with the following components:
weights: the optimal allocation policyenb: the optimal effective number of betscounts: the number of iterations of the objective and the gradientlambda_lb: the lower bound Lagrange multiplierslambda_ub: the upper bound Lagrange multiplierslambda_eq: the equality Lagrange multipliersgradient: the gradient of the objective function at the optimumhessian: hessian of the objective function at the optimum
Examples
# 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)
#> $weights
#> [1] 0.2799795 0.2333368 0.2605180 0.2261656
#>
#> $enb
#> [1] 4
#>
#> $counts
#> nfval ngval
#> [1,] 49 8
#>
#> $lambda_lb
#> [,1]
#> [1,] 0
#> [2,] 0
#> [3,] 0
#> [4,] 0
#>
#> $lambda_ub
#> [,1]
#> [1,] 0
#> [2,] 0
#> [3,] 0
#> [4,] 0
#>
#> $lambda_eq
#> [1] 1.065765e-05
#>
#> $gradient
#> [,1]
#> [1,] 0.0001289845
#> [2,] -0.0002635717
#> [3,] 0.0003029108
#> [4,] -0.0002350807
#>
#> $hessian
#> [,1] [,2] [,3] [,4]
#> [1,] 52.21386 -17.73535 -17.16737 -19.90595
#> [2,] -17.73535 50.87763 -14.12780 -15.66158
#> [3,] -17.16737 -14.12780 51.18113 -19.44538
#> [4,] -19.90595 -15.66158 -19.44538 58.13470
#>