Re: [ojAlgo-user] MarkowitzModel vs ExpressionsBasedModel
Mathematics, linear algebra and optimisation
Brought to you by:
apete
From: Anders P. <an...@op...> - 2014-03-01 19:47:46
|
On 26 Feb 2014, at 16:06, Anthony Edwards <ant...@al...> wrote: > Hi > > I am trying to explore the efficient frontier using an ExpressionsBasedModel, as the MarkowitzModel doesnt let me enter the constraints I would like to use. Ive been looking at the posts and test cases and it seems that to do this i should follow the steps below: > > My approach with the ExpressionBasedModel is: > 1) vars = [Create the variables and set upper and lower limits for them] > 2) ExpressionsBasedModel model = new ExpressionsBasedModel(vars) > 3) covarExpr = [Create the covariance Expression based on the covariance matrix]. > 4) covarExpr.setQuadraticFactors(model.getVariables(), covar_matrix); > 5) balanceExpr = [Create the balance so sum of weights = 1] > 6) riskAversion = BigMath.PI.multiply(BigMath.E) > 7) covarExpr.weight(riskAversion.multiply(BigMath.HALF)); > > I have a couple of questions. > > 1) Are steps 5 and 6 sensible. It seems to be what yoou do in some of the tests, but I’d like to understand if thats right It depends on what you want to your model to express, and I don’t know that. “5" is a very common portfolio constraint. > 2) On the MarkowitzModel I can get out of it .getRiskAversion(), ..getSharpeRatio() and getMeanReturn(). How do I calculate those on an ExpressionsBasedModel? ExpressionsBasedModel lets you model optimisation problems. It has absolutely nothing to do with modern portfolio theory or any other specific domain. If you want to learn some basics about portfolio theory or various key figures wikipedia is a good place to start. /Anders > Apologies if this sounds obvious, but this isnt really my sort of thing! > > Thanks > ------------------------------------------------------------------------------ > Flow-based real-time traffic analytics software. Cisco certified tool. > Monitor traffic, SLAs, QoS, Medianet, WAAS etc. with NetFlow Analyzer > Customize your own dashboards, set traffic alerts and generate reports. > Network behavioral analysis & security monitoring. All-in-one tool. > http://pubads.g.doubleclick.net/gampad/clk?id=126839071&iu=/4140/ostg.clktrk_______________________________________________ > ojAlgo-user mailing list > ojA...@li... > https://lists.sourceforge.net/lists/listinfo/ojalgo-user |