Introduction to the Global Optimization Toolbox
Overview of Features
Introduction
Returns Data and Minimum Acceptable Return
Maple has partnered with Noesis Solutions to develop a new version of the Maple Global Optimization Toolbox that is powered by Optimus® technology, first released with the Global Optimization Toolbox 17.
The new global solver offers two solver methods, a differential evolution algorithm and a hybrid algorithm that uses interpolating response surface models, as well as new options to guide the search. In addition, the updated toolbox is fully compatible with existing code.
Highlights of some of the new options available for the two new solver methods:
Differential Evolution Algorithm
Average step width — the variation in design variables used as stopping criterion
Population size — the number of designs evaluated during each iteration
Inverse crossover probability — the probability that variables might be the same as predecessors without adjustment
Target weighting factor — applies weighted differences of the variables of the randomly selected designs of the previous generation, allowing you to set the balance between computation speed and probability of success
Adaptive Stochastic Search Methods
Theta method — methods for maximizing the predictive quality of the model, maximizing the likelihood of the set of points with respect to the model, and minimizing the semi-norm of the correlation matrix
Number of sigma — how much attention is given to the estimated standard deviation when selecting the next points
Nugget — the smoothing factor for the kriging response surface model
Optimum search method — different methods for locating new promising points in the design space
The following sample application solves an investment optimization problem in two ways.
Traditional investment performance benchmarks, like the Sharpe Ratio, approximate the returns distribution with mean and standard deviation. This, however, assumes the distribution is normal. Many modern investments vehicles, like hedge funds, display fat tails, and skew and kurtosis in the returns distribution. Hence, they cannot be adequately benchmarked with traditional approaches.
One solution, proposed by Shadwick and Keating in 2002 is the Omega Ratio. This divides the returns distribution into two halves – the area below a target return, and the above a target return. The Omega Ratio is simply the former divided by the latter. A higher value is better.
For a set of discrete returns, the Omega Ratio is given by
ΩL=EmaxR−L,0EmaxL−R,0
where L is a target return and R is a vector of returns.
This application finds the asset weights that maximize the Omega Ratio of a portfolio of ten investments, given their simulated monthly returns and a target return.
This is a non-convex problem, and requires global optimizers for a rigorous solution. However, a transformation of the variables (only valid for Omega Ratios of over 1) converts the optimization into a linear program.
This application implements both approaches, the former using Maple's Global Optimization Toolbox, and the latter using Maple's linear programming features. For the data set provided in this application, both approaches give comparable results.
restart:
Monthly hedge fund returns
Number of funds
N≔LinearAlgebraColumnDimensiondata
N:=10
Number of returns for each fund
S≔LinearAlgebraRowDimensiondata
S:=36
Target Return
L≔0.1:
Omega Ratio
OmegaRatio≔procL,returns,weights local weightedReturns,above,below,N,S:N≔LinearAlgebraColumnDimensionreturns:S≔LinearAlgebraRowDimensionreturns: weightedReturns≔seq⁡add⁡returnsi,j⋅weightsj,j=1..N,i=1..S:below≔selectx→evalb⁡x<L,weightedReturns:above≔selectx→evalb⁡x>L,weightedReturns: return add⁡a − L,ainaboveadd⁡L − a,ainbelowend proc:
"Strawman" portfolio of equal weights at the target return
OmegaRatio⁡L,data,0.1,0.1,0.1,0.1,0.1,0.1,0.1,0.1,0.1,0.1
4.003192510
Global Optimization
The new Global Optimization Toolbox finds the optimum asset weights easily.
resultsGO:=GlobalOptimizationGlobalSolve⁡'OmegaRatio'L,data,seq⁡wi,i=1..10,add⁡wi,i=1..N=1,seqwi=0..1,i=1..N,maximize:
Optimized Omega Ratio
resultsGO1
6.97039644046392137
Optimized investment weights
weightsGO≔resultsGO2
weightsGO:=w1=0.00000276016608452556,w2=0.00000228470381952173,w3=3.94708622564188⁢10-7,w4=0.410741791062930,w5=8.41236359461206⁢10-7,w6=0.234868780012149,w7=0.353335563853041,w8=0.00000174272058245384,w9=0.000176546056103011,w10=0.000869375380069815
Linear Program
Finding the optimum asset weights using the linear programming method:
eq1≔seqadd⁡datai,j⁢wj,j=1..N−ui+di−L⁢t=0,i=1..S:
eq2≔addwj,j=1..N=t:
eq3≔adddiS,i=1..S=1:
obj≔adduiS,i=1..S:
cons≔sequi≥0,di≥0,i=1..S,seqwj≥0,j=1..N:
resultsLP≔OptimizationLPSolveobj,eq1,eq2,eq3,cons,maximize,assume=nonnegative:
resultsLP1
6.97971754550025
assign⁡select⁡has,resultsLP2,t
weightsLP:=map⁡i→lhs⁡i=rhs⁡it,selecthas,resultsLP2,w
weightsLP:=w1=0.,w2=0.,w3=0.,w4=0.409790222161672,w5=0.,w6=0.219617381328148,w7=0.333211183439266,w8=0.,w9=0.,w10=0.0373812133486924
Download Help Document