Re: [ojAlgo-user] Financial Module - OjAlgo
Mathematics, linear algebra and optimisation
Brought to you by:
apete
From: Vincent de C. C. <dec...@ya...> - 2016-05-05 12:37:23
|
Hey Anders, I think I made some progress, but I still have a few questions: - Is there any methods anywhere in the codebase that can take a 1D BasicMatrix (or any other Access1D data structure) and return an Access2D covariance matrix? In all the examples in the test package that use a covariance matrix, they all start with hardcoded values... - Same thing for the correlation matrix (the one used as input for the constructor of the SimplePortfolio class)? - One of the MarkowitzModel constructor takes an expected excess returns argument as input. Conceptually, what is the excess relative to? I'm asking this because in my model, i have an asset price, and an asset intrinsic value. My expected return is the improvement potential I see between the current price and what I think the intrinsic value is. Is that in line with the definition of the expected excess return argument? - Also, in one of your responses in the mail archive, you said the RAF is a value between 0 and 100. But in the TestEquilibrium class, the example uses an RAF of 1000. Is it a typo? Best Regards,Vince PS: Thanks for making OjAlgo available to everyone. It's truly a useful tool!!!! To accomplish great things, we must not only act, but also dream; not only plan, but also believe Le Mercredi 13 avril 2016 10h06, Vincent de CHACUS C. <dec...@ya...> a écrit : Thanks for your prompt response Anders! I will go over it again with this new perspective and let you know if I hit a roadblock.If I get it to work, I will gladly contribute a small sample of my implementation as documentation for the finance package. Regards,Vince To accomplish great things, we must not only act, but also dream; not only plan, but also believe Le Mercredi 13 avril 2016 7h05, Anders Peterson <an...@op...> a écrit : There’s not yet any specific example documentation for the finanace.portfolio classes (MarkowitzModel). The test cases that you already found is probably the best alternative. https://github.com/optimatika/ojAlgo/tree/master/test/org/ojalgo/finance/portfolio There is no need or requirement to use a DataSource with the porfolio classes. The Yahoo and Google finance data sources are simply there to allow you to download and/or parse data. If you already have the data you need, in a database, the just fetch it and use it. If your database stores time series data then fetch that and put in CalendarDateSeries. Create a CoordinationSet with all your CalendarDateSeries instances. Call #complete(), #prune() or #resample() as needed. Then there are methods in FinanceUtils that can give you a covariance matrix and other things. Also note that CalendarDateSeries also has a method getPrimitiveTimeSeries() that can be useful, and can be wrapped in SampleSet. /Anders > On 13 apr. 2016, at 04:26, Vincent de CHACUS C. <dec...@ya...> wrote: > > Hey Guys, > > I am working on a financial application and I am trying to use the finance module of ojalgo. > For the past week, I've been scouring the source code trying to understand how to use it and I have a few questions. > > - Is there any example that shows how to make use of the Markowitz Optimization? (Other than the one on the ConvexSolver Performance page in the wiki?) > > - Is there any way to get the datasource to use my DB as source directly without having to load all the symbols manually in an array? > > - Could you please point me to an example (if possible) that uses stock symbols, their price, etc....and runs through the optimization and returns a set of recommendations? > All the examples I found in the test package all have hardcoded numbers in the arrays and not a lot of explanation about the context. > > I understand you may not have the answers to all the questions. I just thought I would throw them out there in case someone does. > > thanks, > Vince > > > > > > > To accomplish great things, we must not only act, but also dream; not only plan, but also believe > ------------------------------------------------------------------------------ > Find and fix application performance issues faster with Applications Manager > Applications Manager provides deep performance insights into multiple tiers of > your business applications. It resolves application problems quickly and > reduces your MTTR. Get your free trial! > https://ad.doubleclick.net/ddm/clk/302982198;130105516;z_______________________________________________ > ojAlgo-user mailing list > ojA...@li... > https://lists.sourceforge.net/lists/listinfo/ojalgo-user |