commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Greg Sterijevski <>
Subject [math] Updating Regression questions..
Date Sat, 10 Sep 2011 17:15:41 GMT
Hi All,

Another mostly exceptional question from me! In the
interface UpdatingMultipleLinearRegression, we have regress() and
regress(int[] variablesToInclude).

1. What is the appropriate exception to throw when there is a variable index
in the array which does not exist in the data? For example I have regressors
0 to 4. The user requests variables 0, 2 and 7. Is it still a
ModelSpecificationException? If so what is appropriate text? "Request for
index {0} cannot be fulfilled because the data has only {1} independent

2. Say that the request list ( the integer array variablesToInclude ) has a
request that looks like int[]{ 1, 4, 2  }. In the Miller regression, I
attempt to return things in the canonical order. Would it make better sense
to have an element in the RegressionResults object which records the
canonical position of the regressor and returns the result in arbitrary

3. In the call to regress() what is the proper manner in which to handle a
case where no result can be returned? Say that the user has supplied nothing
but NaNs in the data. There is nothing that can be done. What is the proper
exception? Is it fair to return just a null?

4. Should any of these regression techniques (whether they implement
UpdatingMultipleRegression or not) check the (input) data for things like
NaN or Inf? If so, what is the exception to throw? Is there any other
parallel with other classes in Math?

Thank you,


  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message