Re: [ojAlgo-user] Markowitz Model Problem
Mathematics, linear algebra and optimisation
Brought to you by:
apete
From: Anders P. <an...@op...> - 2009-01-15 08:21:00
|
You have to send code (snippets) that I can execute. Are you using v25 or the latest from cvs? How do you instantiate the ActiveSetSolver? What's the correct solution? You say that if you change the sign of "C" you get an ok result. What does this mean? Did you make a mistake with the sign, or do you suspect there is a bug in ojAlgo? I need better info regarding what you do, and what the problem is! /Anders On 15 jan 2009, at 06.14, Ruan Weichao wrote: > > Thank you for your response. > > Here's my model's detail: > > [AE]={1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0} > > > [be]={1.0} > > > [Q]={3.048907897157133E-4, 1.6671472561019247E-4, > 4.4500080981934345E-4, -5.389129745055723E-4, > -2.6090705011393183E-4, -1.2633284900760366E-4, > -6.485428846447651E-7}, > {1.6671472561019247E-4, 2.341985572849691E-4, > 2.9113916450678265E-4, -4.5760873539850514E-4, > 1.3078636134987255E-5, -2.354289901013046E-5, -7.578030042426654E-7}, > {4.4500080981934345E-4, 2.9113916450678265E-4, 7.46023915996829E-4, > -0.0010247176498305568, -2.6745504327902895E-4, > -1.6563544154823496E-4, -8.293698990696063E-7}, > {-5.389129745055723E-4, -4.5760873539850514E-4, > -0.0010247176498305568, 0.001754169535149865, > 2.0293065310212377E-4, 2.1401092557826588E-4, 1.0252846778608953E-7}, > {-2.6090705011393183E-4, 1.3078636134987255E-5, > -2.6745504327902895E-4, 2.0293065310212377E-4, > 4.632320892679136E-4, 1.7969731066037214E-4, 2.4953495129362833E-8}, > {-1.2633284900760366E-4, -2.354289901013046E-5, > -1.6563544154823496E-4, 2.1401092557826588E-4, > 1.7969731066037214E-4, 8..346410612364995E-5, -7.02099350897589E-8}, > {-6.485428846447651E-7, -7.578030042426654E-7, > -8.293698990696063E-7, 1.0252846778608953E-7, > 2.4953495129362833E-8, -7.02099350897589E-8, 8.367244992498656E-9}} > > [c]={{0.010638291263564232}, > {0.013500370827906071}, > {0.011390037735101773}, > {0.010385042339767682}, > {3.812208389845893E-4}, > {0.002315505853720011}, > {0.0}} > > > [AI]={{1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0}, > {0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0}, > {0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0}, > {0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0}, > {0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0}, > {0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0}, > {0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0}, > {-1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0}, > {0.0, -1.0, 0.0, 0.0, 0.0, 0.0, 0.0}, > {0.0, 0.0, -1.0, 0.0, 0.0, 0.0, 0.0}, > {0.0, 0.0, 0.0, -1.0, 0.0, 0.0, 0.0}, > {0.0, 0.0, 0.0, 0.0, -1.0, 0.0, 0.0}, > {0.0, 0.0, 0.0, 0.0, 0.0, -1.0, 0.0}, > {0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -1.0}} > > [bi]={{1.0}, > {1.0}, > {1.0}, > {1.0}, > {1.0}, > {1.0}, > {1.0}, > {0.0}, > {0.0}, > {0.0}, > {0.0}, > {0.0}, > {0.0}, > {0.0}} > > And here's the result: > > -0.25 > -0.25 > -0.25 > -0.25 > 0.75 > 0.75 > 0.75 > > And i found that if i change the nagetive ExceptedReturn to > positive, the result will be fine. > > > On Wed, 14 Jan 2009 09:27:53 +0100, Anders Peterson wrote > > How small are the negative values? > > > > Give me a unit test (something that I can easily integrate with the > > existing junit tests) that shows what you do, and where/how you > > think it goes wrong. > > > > /Anders > > > > On 14 jan 2009, at 03.58, Ruan Weichao wrote: > > > > > > > > Hi, > > > > > > I use the Markowitz model to calculate the optimize some assets' > > > weights, > > > > > > and set all the assets' lowerlimit with Zero and set all the > > > upperlimits with > > > > > > One, but it turns out with some negative value which are little > > > than Zero, it > > > > > > seems that the lowerlimit does not work. > > > > > > So I want to ask what should I do it to confirm the lowerlimit? > > > > > > -- > > > Best regards > > > > > > weichao > > > > > > > ---------------------------------------------------------------------- > > > -------- > > > This SF.net email is sponsored by: > > > SourcForge Community > > > SourceForge wants to tell your story. > > > http://p.sf.net/sfu/sf-spreadtheword > > > _______________________________________________ > > > ojAlgo-user mailing list > > > ojA...@li... > > > https://lists.sourceforge.net/lists/listinfo/ojalgo-user > > > > > > > > > > > ---------------------------------------------------------------------- > ------ > -- > > This SF.net email is sponsored by: > > SourcForge Community > > SourceForge wants to tell your story. > > http://p.sf.net/sfu/sf-spreadtheword > > _______________________________________________ > > ojAlgo-user mailing list > > ojA...@li... > > https://lists.sourceforge.net/lists/listinfo/ojalgo-user > > > -- > Best regards > > ---------------------------------------------------------------------- > -------- > This SF.net email is sponsored by: > SourcForge Community > SourceForge wants to tell your story. > http://p.sf.net/sfu/sf- > spreadtheword_______________________________________________ > ojAlgo-user mailing list > ojA...@li... > https://lists.sourceforge.net/lists/listinfo/ojalgo-user |