Re: [ojAlgo-user] Potential bug in org.ojalgo.finance.FinanceUtils.makeCovarianceMatrix() method
Mathematics, linear algebra and optimisation
Brought to you by:
apete
From: Anders P. <an...@op...> - 2013-06-27 14:49:35
|
Yes, that's a bug - thank you for reporting it. I've changed the code in the FinanceUtils method to use "tmpTimeSeries.getName()" rather than "tmpTimeSeries" AND i've modified CoordinationSet to handle the case when the get(Object) method is called using a CalendarDateSeries instance. (Haven't actually tested it, but that should fix the problem.) The changes are in CVS. I'm in the process of refactoring parts of ojAlgo (the org.ojalgo.access package). That may cause some trouble. Let me know if it's too much. Because of the refactoring I'd like to wait a little before making a snapshot release. You'll have to get the source code directly from CVS if you want this bug fix. (...and then you'll get the other changes as well). /Anders On 27 jun 2013, at 15:37, Yang Huang <yan...@gm...> wrote: > I think I found a bug in org.ojalgo.finance.FinanceUtils..makeCovarianceMatrix() method: > > public static <V extends Number> BasicMatrix makeCovarianceMatrix(final Collection<CalendarDateSeries<V>> aTimeSeriesCollection) { > > final CoordinationSet<V> tmpCoordinator = new CoordinationSet<V>(aTimeSeriesCollection).prune(); > > final ArrayList<SampleSet> tmpSampleSets = new ArrayList<SampleSet>(); > for (final CalendarDateSeries<V> tmpTimeSeries : aTimeSeriesCollection) { > final double[] someValues = tmpCoordinator.get(tmpTimeSeries).getPrimitiveValues(); > ... > > According to the API, CoordinationSet.get() should have a String as the input parameter, but it is passing a CalendarDateSeries in makeCovarianceMatrix() method. It actually causes NullPointerException. when the following line is called. > > final double[] someValues = tmpCoordinator.get(tmpTimeSeries).getPrimitiveValues(); > > > -- > Yang > ------------------------------------------------------------------------------ > This SF.net email is sponsored by Windows: > > Build for Windows Store. > > http://p.sf.net/sfu/windows-dev2dev_______________________________________________ > ojAlgo-user mailing list > ojA...@li... > https://lists.sourceforge.net/lists/listinfo/ojalgo-user |