You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by Phil Steitz <ph...@gmail.com> on 2011/07/21 19:48:40 UTC
[math] RegressionModelSpecificationException
I propose that we add this to replace the generic math IAE that we
throw in various places, e.g. in AbstractMLR#newSampleData,
throw MathRuntimeException.createIllegalArgumentException(
LocalizedFormats.INVALID_REGRESSION_ARRAY,
data.length, nobs, nvars);
This exception, mostly reusing existing messages, would suffice for
most of the top level exceptions in the regression package. If
others are OK with this, I will add and fix the raw exceptions in
the newly added updating classes and incorporate this change in
regression refactoring.
Phil
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org
Re: [math] RegressionModelSpecificationException
Posted by Phil Steitz <ph...@gmail.com>.
On 7/21/11 6:53 PM, Greg Sterijevski wrote:
>>
>> +1 from me as well (does that even count?).
Thanks! And yes, "that counts" - in fact it carries a lot of weight
because you have contributed more than anyone else to this area
recently. We operate a "do-ocracy" here :)
> As an aside, I believe we will be adding more exceptions.
Yes.
> The number of ways
> to screw up a regression is limited only by the user's imagination. As we
> finalize how we deal with obviously redundant regressors, that might be a
> new exception as well. Perhaps we should think of the exceptions cleaving in
> two planes. First would be input data problems. Second would be estimation
> failure.
That is a common pattern. The first kind will extend
MathIllegalArgumentException (like
RegressionModelSpecificationException). The second kind will depend
on what exactly is failing. In some cases, it will be appropriate
to propagate an exception from one of the other packages; in others
we may want to define new exceptions specific to regression model
estimation.
Regarding obviously redundant regressors, it's probably in most
cases better to include this information in results, rather than
throwing exceptions, since in some cases users may want the
(arguably bogus) parameter estimates when we can compute them.
Phil
>
> -Greg
>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org
Re: [math] RegressionModelSpecificationException
Posted by Greg Sterijevski <gs...@gmail.com>.
>
>
> +1 from me as well (does that even count?).
As an aside, I believe we will be adding more exceptions. The number of ways
to screw up a regression is limited only by the user's imagination. As we
finalize how we deal with obviously redundant regressors, that might be a
new exception as well. Perhaps we should think of the exceptions cleaving in
two planes. First would be input data problems. Second would be estimation
failure.
-Greg
Re: [math] RegressionModelSpecificationException
Posted by Gilles Sadowski <gi...@harfang.homelinux.org>.
On Thu, Jul 21, 2011 at 12:42:23PM -0700, Phil Steitz wrote:
> On 7/21/11 11:18 AM, Gilles Sadowski wrote:
> > On Thu, Jul 21, 2011 at 10:48:40AM -0700, Phil Steitz wrote:
> >> I propose that we add this to replace the generic math IAE that we
> >> throw in various places, e.g. in AbstractMLR#newSampleData,
> >>
> >> throw MathRuntimeException.createIllegalArgumentException(
> >> LocalizedFormats.INVALID_REGRESSION_ARRAY,
> >> data.length, nobs, nvars);
> > This way of generating exceptions is deprecated (as are classes
> > "o.a.c.math.MathException" and "o.a.c.math.MathRuntimeException").
> >
> > Please make it
> > ---CUT---
> > import org.apache.commons.math.exception.MathIllegalArgumentException;
> > // ...
> > throw new MathIllegalArgumentException(LocalizedFormats.INVALID_REGRESSION_ARRAY,
> > data.length, nobs, nvars);
> > ---CUT---
> >
> > However, if many of the new classes are going to contain similar statements,
> > maybe that a new "RegressionException" is warranted.
>
> That is what I was suggesting above - to get rid of the deprecated
> stuff and replace with a new exception that would extend
> MathIllegalArgumentException.
I hadn't realized that "this", in the original mail, referred to the title
message.
+1 for "RegressionModelSpecificationException" then. :-)
Sorry for the noise,
Gilles
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org
Re: [math] RegressionModelSpecificationException
Posted by Phil Steitz <ph...@gmail.com>.
On 7/21/11 11:18 AM, Gilles Sadowski wrote:
> On Thu, Jul 21, 2011 at 10:48:40AM -0700, Phil Steitz wrote:
>> I propose that we add this to replace the generic math IAE that we
>> throw in various places, e.g. in AbstractMLR#newSampleData,
>>
>> throw MathRuntimeException.createIllegalArgumentException(
>> LocalizedFormats.INVALID_REGRESSION_ARRAY,
>> data.length, nobs, nvars);
> This way of generating exceptions is deprecated (as are classes
> "o.a.c.math.MathException" and "o.a.c.math.MathRuntimeException").
>
> Please make it
> ---CUT---
> import org.apache.commons.math.exception.MathIllegalArgumentException;
> // ...
> throw new MathIllegalArgumentException(LocalizedFormats.INVALID_REGRESSION_ARRAY,
> data.length, nobs, nvars);
> ---CUT---
>
> However, if many of the new classes are going to contain similar statements,
> maybe that a new "RegressionException" is warranted.
That is what I was suggesting above - to get rid of the deprecated
stuff and replace with a new exception that would extend
MathIllegalArgumentException.
Phil
>
>> [...]
> Thanks,
> Gilles
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org
Re: [math] RegressionModelSpecificationException
Posted by Gilles Sadowski <gi...@harfang.homelinux.org>.
On Thu, Jul 21, 2011 at 10:48:40AM -0700, Phil Steitz wrote:
> I propose that we add this to replace the generic math IAE that we
> throw in various places, e.g. in AbstractMLR#newSampleData,
>
> throw MathRuntimeException.createIllegalArgumentException(
> LocalizedFormats.INVALID_REGRESSION_ARRAY,
> data.length, nobs, nvars);
This way of generating exceptions is deprecated (as are classes
"o.a.c.math.MathException" and "o.a.c.math.MathRuntimeException").
Please make it
---CUT---
import org.apache.commons.math.exception.MathIllegalArgumentException;
// ...
throw new MathIllegalArgumentException(LocalizedFormats.INVALID_REGRESSION_ARRAY,
data.length, nobs, nvars);
---CUT---
However, if many of the new classes are going to contain similar statements,
maybe that a new "RegressionException" is warranted.
> [...]
Thanks,
Gilles
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org
Re: [math] RegressionModelSpecificationException
Posted by Luc Maisonobe <Lu...@free.fr>.
Le 21/07/2011 19:48, Phil Steitz a écrit :
> I propose that we add this to replace the generic math IAE that we
> throw in various places, e.g. in AbstractMLR#newSampleData,
>
> throw MathRuntimeException.createIllegalArgumentException(
> LocalizedFormats.INVALID_REGRESSION_ARRAY,
> data.length, nobs, nvars);
>
> This exception, mostly reusing existing messages, would suffice for
> most of the top level exceptions in the regression package. If
> others are OK with this, I will add and fix the raw exceptions in
> the newly added updating classes and incorporate this change in
> regression refactoring.
Reducing the number IllegalArgumentException we use is a good thing, thanks.
Luc
>
> Phil
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org