[ojAlgo-user] Potential bug in org.ojalgo.finance.FinanceUtils.makeCovarianceMatrix() method
Mathematics, linear algebra and optimisation
Brought to you by:
apete
From: Yang H. <yan...@gm...> - 2013-06-27 13:37:17
|
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 |