Solvers
The system of equations presented in the portfolio section can be solved with either cyclical coordinate descent as suggested by Griveau-Billion etal. or by Newton's method proposed by Florin Spinu. An comparision between the methods are made in the R language by Farah Bouzida which concludes that Newton's method is faster and more robust. Furthermore, Choi, J., & Chen applies modifications to both the cyclical coordinate descent and Newton's method with the aim of making them faster. In this package you can call the solver indepedently as shown in this example
julia> using RiskBudgeting
julia> cov = [0.1 0.3
0.3 0.8];
julia> b = [1/2 for i= 1:2];
julia> retval = ccd(cov, b).weights;
julia> print(round.(retval; digits=4))
[0.7388, 0.2612]
Cyclical coordinate descent
RiskBudgeting.ccd
— Functionccd(cov, b, [max_iter], [tol], [bounds])
cov::AbstractMatrix covariance matrix
b::AbstractVector{Float} risk budgeting vector
max_iter::Int=10000 number of iterations
tol::Float=10(-4) the minimum tolerance of the result
bounds::Bool=true whether to run bounds checks or not
Calculates the solution of the risk budgeting portfolio with cyclical coordinate descent given the covariance matrix and the risk partitions between the assets.
External links
- Griveau-Billion, Théophile and Richard, Jean-Charles and Roncalli, Thierry, A Fast Algorithm for Computing High-Dimensional Risk Parity Portfolios (September 1, 2013). doi: 10.2139/ssrn.2325255
RiskBudgeting.fastccd
— Functionfastccd(cov, b, [max_iter], [tol], [bounds])
cov::AbstractMatrix covariance matrix
b::AbstractVector{Float} risk budgeting vector
max_iter::Int=10000 number of iterations
tol::Float=10(-4) the minimum tolerance of the result
bounds::Bool=true whether to run bounds checks or not
A faster solution finder of the risk budgeting portfolio with cyclical coordinate descent given the covariance matrix and the risk partitions between the assets.
External links
- Choi, J., & Chen, R. (2022). Improved iterative methods for solving risk parity portfolio, Journal of Derivatives and Quantitative Studies, 30(2) doi: 10.48550/arXiv.2203.00148
Newton's method
RiskBudgeting.newton
— Functionnewton(cov, b, [max_iter], [tol], [bounds])
cov::AbstractMatrix covariance matrix
b::AbstractVector{Float} risk budgeting vector
max_iter::Int=10000 number of iterations
tol::Float=10(-4) the minimum tolerance of the result
bounds::Bool=true whether to run bounds checks or not
Solution finder of the risk budgeting portfolio with Newton's method given the covariance matrix and the risk partitions between the assets (also known as Spinu's algorithm).
External links
- Spinu, Florin, An Algorithm for Computing Risk Parity Weights (July 30, 2013). doi: 10.2139/ssrn.2297383
Note that the modified Spinu's algorithm (fastnewton) proposed by Choi, J., & Chen, R. can obtain negative weights, which according to the constraints of risk budgeting should not occur. In addition, the identical solver the authors use, the hybrj routine, does not have a stable version in Julia at this moment.
RiskBudgeting.fastnewton
— Functionfastnewton(cov, b, [tol], [bounds])
cov::AbstractMatrix covariance matrix
b::AbstractVector{Float} risk budgeting vector
tol::Float=10(-4) the minimum tolerance of the result
bounds::Bool=true whether to run bounds checks or not
A faster solution finder of the risk budgeting portfolio based on Newton's method given the covariance matrix and the risk partitions between the assets. The core concept is that the solution will converge faster if the initial guess of the weights is closer to the solution in comparision to Spinu's algorithm.
External links
- Choi, J., & Chen, R. (2022). Improved iterative methods for solving risk parity portfolio, Journal of Derivatives and Quantitative Studies, 30(2) doi: 10.48550/arXiv.2203.00148