You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by Gilles <gi...@harfang.homelinux.org> on 2013/07/17 17:16:14 UTC
[Math] Cleaning up the curve fitters
Hello.
Constructors of classes in the "o.a.c.m.fitting" are instantiated using
an (abstract) "MultivariateVectorOptimizer". The only concrete
implementations of this class are
* LevenbergMarquardtOptimizer
* GaussNewtonOptimizer
[I.e. the API suggests that the Jacobian is not necessary for
some optimizers but no such (vector) optimizer exists currently.
Anyways the Jacobian is computed automatically (in inner class
"CurveFitter.TheoreticalValuesFunction") so that an optimizer
without derivatives is never necessary...]
Observing that
1. almost all the unit tests for the fitters use an instance of
"LevenbergMarquardtOptimizer",
2. some comments in the "GaussNewtonOptimizerTest" unit test class
makes
one wonder when "GaussNewtonOptimizer" should actually be preferred
over "LevenbergMarquardtOptimizer",
I would propose to deprecate the non-default constructors in all fitter
classes (and let the fitting be transparently performed with an
instance
of "LevenbergMarquardtOptimizer").
Any objection?
Regards,
Gilles
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org
Re: [Math] Cleaning up the curve fitters
Posted by Gilles <gi...@harfang.homelinux.org>.
On Sat, 20 Jul 2013 16:41:00 -0700, Ajo Fod wrote:
> Ok let's approach this one step at a time starting with improper
> integration because tests for AQ depend on it.
>
> What are the modifications to the class Infinite in Math-995 that
> are:
> 1: necessary
> 2: desirable
> for acceptance to commons?
>
> what bits of code can be reused from existing ones in commons? Mind
> you all
> the code does is map an arbitrary function in the range [-Inf, Inf]
> to
> [-1,1]
OK, let's reboot! :-)
First off, we should never hijack threads (see subject line of this
one); so,
please start a new thread for requesting everyone's opinion on how to
break
the functionality of your patch into its various constituents (so that
they
become independant, manageable, reusable components).
Each of these concepts should then have their own thread for discussing
the
details of implementation.
Regards,
Gilles
>
>
> On Sat, Jul 20, 2013 at 2:28 PM, Gilles
> <gi...@harfang.homelinux.org>wrote:
>
>> On Sat, 20 Jul 2013 06:45:10 -0700, Ajo Fod wrote:
>>
>>>
>>> [...]
>>>
>>>
>>> If you want to pose what I and the community see as a respectable
>>> objection
>>> to including a commit, it needs to be in the form of :
>>> 1. alternative code that demonstrates a superior way of doing
>>> improper
>>> integration. With unit tests that show how it is faster or more
>>> accurate.
>>> 2. OR failures of the the submitted patch in a JUnit test.
>>>
>>> Otherwise, I maintain that the hurdle of convincing you of the
>>> correctness/optimality of a solution is way too high for anyone's
>>> good ...
>>> including yours.
>>>
>>
>> I admire your insistance. :-)
>> So, I'll try once more to get "my" point through.
>>
>> A good library must avoid code duplication.
>> Although
>> * change of variables,
>> * improper integrals,
>> * adaptive algorithms
>> are all useful features for use in numerical estimation of
>> integrals, I
>> think that CM must not include a code like your patch, because it
>> provides
>> all of them bundled in a way that
>> 1. does not reuse the existing code, and
>> 2. does not allow to be reused (within CM or by CM users).
>>
>> I stated that much from the outset; and that we could work
>> _together_ to
>> fulfill this requirement (and others along the way).
>>
>>
>> Once the "ability to do improper integration" is in CM, you can
>> always
>>> mend/improve the patch. Its not like you've never integrated a
>>> class or
>>> moved it around c.f MATH-827.
>>>
>>
>> Who is "you"?
>> That's the problem.
>>
>> Had you taken the route which I suggested, most roadblocks would
>> have
>> disappeared "automagically".[1]
>>
>>
>> Regards,
>> Gilles
>>
>> [1] Phil's too, probably, because code reuse places a big part of
>> the
>> burden (e.g. of numerical analysis in this instance) on the
>> reused
>> building blocks!
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org
Re: [Math] Cleaning up the curve fitters
Posted by Ajo Fod <aj...@gmail.com>.
Ok let's approach this one step at a time starting with improper
integration because tests for AQ depend on it.
What are the modifications to the class Infinite in Math-995 that are:
1: necessary
2: desirable
for acceptance to commons?
what bits of code can be reused from existing ones in commons? Mind you all
the code does is map an arbitrary function in the range [-Inf, Inf] to
[-1,1]
Cheers,
Ajo
On Sat, Jul 20, 2013 at 2:28 PM, Gilles <gi...@harfang.homelinux.org>wrote:
> On Sat, 20 Jul 2013 06:45:10 -0700, Ajo Fod wrote:
>
>>
>> [...]
>>
>>
>> If you want to pose what I and the community see as a respectable
>> objection
>> to including a commit, it needs to be in the form of :
>> 1. alternative code that demonstrates a superior way of doing improper
>> integration. With unit tests that show how it is faster or more accurate.
>> 2. OR failures of the the submitted patch in a JUnit test.
>>
>> Otherwise, I maintain that the hurdle of convincing you of the
>> correctness/optimality of a solution is way too high for anyone's good ...
>> including yours.
>>
>
> I admire your insistance. :-)
> So, I'll try once more to get "my" point through.
>
> A good library must avoid code duplication.
> Although
> * change of variables,
> * improper integrals,
> * adaptive algorithms
> are all useful features for use in numerical estimation of integrals, I
> think that CM must not include a code like your patch, because it provides
> all of them bundled in a way that
> 1. does not reuse the existing code, and
> 2. does not allow to be reused (within CM or by CM users).
>
> I stated that much from the outset; and that we could work _together_ to
> fulfill this requirement (and others along the way).
>
>
> Once the "ability to do improper integration" is in CM, you can always
>> mend/improve the patch. Its not like you've never integrated a class or
>> moved it around c.f MATH-827.
>>
>
> Who is "you"?
> That's the problem.
>
> Had you taken the route which I suggested, most roadblocks would have
> disappeared "automagically".[1]
>
>
> Regards,
> Gilles
>
> [1] Phil's too, probably, because code reuse places a big part of the
> burden (e.g. of numerical analysis in this instance) on the reused
> building blocks!
>
>
>
> ------------------------------**------------------------------**---------
> To unsubscribe, e-mail: dev-unsubscribe@commons.**apache.org<de...@commons.apache.org>
> For additional commands, e-mail: dev-help@commons.apache.org
>
>
Re: [Math] Cleaning up the curve fitters
Posted by Gilles <gi...@harfang.homelinux.org>.
On Sat, 20 Jul 2013 06:45:10 -0700, Ajo Fod wrote:
>
> [...]
>
> If you want to pose what I and the community see as a respectable
> objection
> to including a commit, it needs to be in the form of :
> 1. alternative code that demonstrates a superior way of doing
> improper
> integration. With unit tests that show how it is faster or more
> accurate.
> 2. OR failures of the the submitted patch in a JUnit test.
>
> Otherwise, I maintain that the hurdle of convincing you of the
> correctness/optimality of a solution is way too high for anyone's
> good ...
> including yours.
I admire your insistance. :-)
So, I'll try once more to get "my" point through.
A good library must avoid code duplication.
Although
* change of variables,
* improper integrals,
* adaptive algorithms
are all useful features for use in numerical estimation of integrals, I
think that CM must not include a code like your patch, because it
provides
all of them bundled in a way that
1. does not reuse the existing code, and
2. does not allow to be reused (within CM or by CM users).
I stated that much from the outset; and that we could work _together_
to
fulfill this requirement (and others along the way).
> Once the "ability to do improper integration" is in CM, you can
> always
> mend/improve the patch. Its not like you've never integrated a class
> or
> moved it around c.f MATH-827.
Who is "you"?
That's the problem.
Had you taken the route which I suggested, most roadblocks would have
disappeared "automagically".[1]
Regards,
Gilles
[1] Phil's too, probably, because code reuse places a big part of the
burden (e.g. of numerical analysis in this instance) on the reused
building blocks!
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org
Re: [Math] Cleaning up the curve fitters
Posted by Ajo Fod <aj...@gmail.com>.
Without AQ, you have the achilles heel with high frequency functions that
Gilles acknowledged in his comments. So, how do you propose to do AQ with
Gauss-Hermite?
I guess I don't know what you mean by "numerical analysis".
Cheers,
Ajo.
On Sat, Jul 20, 2013 at 9:38 AM, Phil Steitz <ph...@gmail.com> wrote:
> On 7/20/13 8:54 AM, Ajo Fod wrote:
> > 1. Konstantin just showed with a link that other packages use the change
> of
> > variables method.
> >
> > 2 The theoretical argument for the change of variables method is
> documented
> > on Wikipedia. It is such a standard way that it is on wikipedia. I did
> > another search on google. Here is another wikipedia link:
> > http://en.wikipedia.org/wiki/Integration_by_substitution
> >
> > 3. I've shown that my method provides correct answers in many cases. If
> you
> > suspect it doesn't work for other cases ... show me those cases.
> Obviously,
> > there is a pole at infinity in this scheme. Unless you try to evaluate
> the
> > original function at infinity, you'll be fine.
> >
> > If you are saying that you can't advocate for it because you dont'
> > understand the method. I guess CM will have to wait for someone who does
> > understand the concept of change of variables to make the commit
>
> Sorry, this is going nowhere. There is zero real numerical analysis
> support in the arguments you have provided. Trust me, I know what
> change of variable is. I also know the basics of quadrature. The
> Wikipedia article mentions Gauss-Hermite first and I suspect that is
> for a reason. You need to either do some real research or let this
> drop. Konstantin started. You need to do the work or let this drop.
>
> Phil
> >
> > Cheers,
> > Ajo.
> >
> > On Sat, Jul 20, 2013 at 7:25 AM, Phil Steitz <ph...@gmail.com>
> wrote:
> >
> >> On 7/20/13 6:45 AM, Ajo Fod wrote:
> >>> Phil,
> >>>
> >>> I feel that you are blocking/delaying the use of improper integration
> to
> >>> commons users with your objection that you don't understand all the
> >>> alternatives.
> >>>
> >>> If you want to pose what I and the community see as a respectable
> >> objection
> >>> to including a commit, it needs to be in the form of :
> >>> 1. alternative code that demonstrates a superior way of doing improper
> >>> integration. With unit tests that show how it is faster or more
> accurate.
> >>> 2. OR failures of the the submitted patch in a JUnit test.
> >> Sorry, this is not how it works. It is up to *you* the contributor
> >> who wants us to commit something to convince the community that what
> >> you are proposing is a good, supportable, standard way to solve
> >> whatever problem you are trying to solve. As Gilles and others
> >> have pointed out, we can't just commit whatever apparently
> >> functional code comes our way. The reasons for this should be
> >> obvious when you think about the problems associated with
> >> maintaining it and what happens to users when we release functional
> >> but numerically unsound code. Lets just say we have been burned a
> >> few times in the past and leave it at that. Also, I am not
> >> "blocking" anything. I am just asserting that I personally am not
> >> going to advocate for or myself commit code that I "don't understand."
> >>
> >> Phil
> >>> Otherwise, I maintain that the hurdle of convincing you of the
> >>> correctness/optimality of a solution is way too high for anyone's good
> >> ...
> >>> including yours.
> >>>
> >>> Once the "ability to do improper integration" is in CM, you can always
> >>> mend/improve the patch. Its not like you've never integrated a class or
> >>> moved it around c.f MATH-827.
> >>>
> >>> Cheers,
> >>> -Ajo
> >>>
> >>>
> >>>
> >>> On Fri, Jul 19, 2013 at 2:55 PM, Phil Steitz <ph...@gmail.com>
> >> wrote:
> >>>> On 7/19/13 2:36 PM, Konstantin Berlin wrote:
> >>>>> The question is how correctly to do AQ and how to correctly handle
> >>>>>
> >>>>>> improper integrals. What I would appreciate is some real numerical
> >>>>>> analysis or pointers to where we can do the research to support what
> >>>>>> Ajo is asking us to commit. Just running tests on one problem
> >>>>>> instance demonstrates nothing. I asked politely several times and
> >>>>>> got no response.
> >>>>>>
> >>>>> Page 170 of numerical recipes third edition.
> >>>>>
> >>>>> "The basic trick for improper integrals is to make a change of
> >> variables
> >>>> to
> >>>>> eliminate the singularity or to map an infinite range of integration
> >> to a
> >>>>> finite one."
> >>>>>
> >>>>> See also
> >>>>>
> >>
> http://www.gnu.org/software/gsl/manual/html_node/QAGI-adaptive-integration-on-infinite-intervals.html#QAGI-adaptive-integration-on-infinite-intervals
> >>>>> I hope this can convince people..
> >>>> Thanks! This is not really numerical analysis, but it is a start
> >>>> and an indication that there are at least some standard
> >>>> implementations that work this way. What would be helpful is some
> >>>> general references that provide complexity and error analysis and
> >>>> ideally characterize the functions for which the change of variable
> >>>> approach is better than Gauss-Hermite, per the first recommendation
> >>>> in [1]
> >>>>
> >>>> [1] http://en.wikipedia.org/wiki/Numerical_integration
> >>>>
> >>>> ---------------------------------------------------------------------
> >>>> 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
> >>
> >>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org
>
>
Re: [Math] Cleaning up the curve fitters
Posted by Phil Steitz <ph...@gmail.com>.
On 7/20/13 8:54 AM, Ajo Fod wrote:
> 1. Konstantin just showed with a link that other packages use the change of
> variables method.
>
> 2 The theoretical argument for the change of variables method is documented
> on Wikipedia. It is such a standard way that it is on wikipedia. I did
> another search on google. Here is another wikipedia link:
> http://en.wikipedia.org/wiki/Integration_by_substitution
>
> 3. I've shown that my method provides correct answers in many cases. If you
> suspect it doesn't work for other cases ... show me those cases. Obviously,
> there is a pole at infinity in this scheme. Unless you try to evaluate the
> original function at infinity, you'll be fine.
>
> If you are saying that you can't advocate for it because you dont'
> understand the method. I guess CM will have to wait for someone who does
> understand the concept of change of variables to make the commit
Sorry, this is going nowhere. There is zero real numerical analysis
support in the arguments you have provided. Trust me, I know what
change of variable is. I also know the basics of quadrature. The
Wikipedia article mentions Gauss-Hermite first and I suspect that is
for a reason. You need to either do some real research or let this
drop. Konstantin started. You need to do the work or let this drop.
Phil
>
> Cheers,
> Ajo.
>
> On Sat, Jul 20, 2013 at 7:25 AM, Phil Steitz <ph...@gmail.com> wrote:
>
>> On 7/20/13 6:45 AM, Ajo Fod wrote:
>>> Phil,
>>>
>>> I feel that you are blocking/delaying the use of improper integration to
>>> commons users with your objection that you don't understand all the
>>> alternatives.
>>>
>>> If you want to pose what I and the community see as a respectable
>> objection
>>> to including a commit, it needs to be in the form of :
>>> 1. alternative code that demonstrates a superior way of doing improper
>>> integration. With unit tests that show how it is faster or more accurate.
>>> 2. OR failures of the the submitted patch in a JUnit test.
>> Sorry, this is not how it works. It is up to *you* the contributor
>> who wants us to commit something to convince the community that what
>> you are proposing is a good, supportable, standard way to solve
>> whatever problem you are trying to solve. As Gilles and others
>> have pointed out, we can't just commit whatever apparently
>> functional code comes our way. The reasons for this should be
>> obvious when you think about the problems associated with
>> maintaining it and what happens to users when we release functional
>> but numerically unsound code. Lets just say we have been burned a
>> few times in the past and leave it at that. Also, I am not
>> "blocking" anything. I am just asserting that I personally am not
>> going to advocate for or myself commit code that I "don't understand."
>>
>> Phil
>>> Otherwise, I maintain that the hurdle of convincing you of the
>>> correctness/optimality of a solution is way too high for anyone's good
>> ...
>>> including yours.
>>>
>>> Once the "ability to do improper integration" is in CM, you can always
>>> mend/improve the patch. Its not like you've never integrated a class or
>>> moved it around c.f MATH-827.
>>>
>>> Cheers,
>>> -Ajo
>>>
>>>
>>>
>>> On Fri, Jul 19, 2013 at 2:55 PM, Phil Steitz <ph...@gmail.com>
>> wrote:
>>>> On 7/19/13 2:36 PM, Konstantin Berlin wrote:
>>>>> The question is how correctly to do AQ and how to correctly handle
>>>>>
>>>>>> improper integrals. What I would appreciate is some real numerical
>>>>>> analysis or pointers to where we can do the research to support what
>>>>>> Ajo is asking us to commit. Just running tests on one problem
>>>>>> instance demonstrates nothing. I asked politely several times and
>>>>>> got no response.
>>>>>>
>>>>> Page 170 of numerical recipes third edition.
>>>>>
>>>>> "The basic trick for improper integrals is to make a change of
>> variables
>>>> to
>>>>> eliminate the singularity or to map an infinite range of integration
>> to a
>>>>> finite one."
>>>>>
>>>>> See also
>>>>>
>> http://www.gnu.org/software/gsl/manual/html_node/QAGI-adaptive-integration-on-infinite-intervals.html#QAGI-adaptive-integration-on-infinite-intervals
>>>>> I hope this can convince people..
>>>> Thanks! This is not really numerical analysis, but it is a start
>>>> and an indication that there are at least some standard
>>>> implementations that work this way. What would be helpful is some
>>>> general references that provide complexity and error analysis and
>>>> ideally characterize the functions for which the change of variable
>>>> approach is better than Gauss-Hermite, per the first recommendation
>>>> in [1]
>>>>
>>>> [1] http://en.wikipedia.org/wiki/Numerical_integration
>>>>
>>>> ---------------------------------------------------------------------
>>>> 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
>>
>>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org
Re: [Math] Cleaning up the curve fitters
Posted by Ajo Fod <aj...@gmail.com>.
1. Konstantin just showed with a link that other packages use the change of
variables method.
2 The theoretical argument for the change of variables method is documented
on Wikipedia. It is such a standard way that it is on wikipedia. I did
another search on google. Here is another wikipedia link:
http://en.wikipedia.org/wiki/Integration_by_substitution
3. I've shown that my method provides correct answers in many cases. If you
suspect it doesn't work for other cases ... show me those cases. Obviously,
there is a pole at infinity in this scheme. Unless you try to evaluate the
original function at infinity, you'll be fine.
If you are saying that you can't advocate for it because you dont'
understand the method. I guess CM will have to wait for someone who does
understand the concept of change of variables to make the commit
Cheers,
Ajo.
On Sat, Jul 20, 2013 at 7:25 AM, Phil Steitz <ph...@gmail.com> wrote:
> On 7/20/13 6:45 AM, Ajo Fod wrote:
> > Phil,
> >
> > I feel that you are blocking/delaying the use of improper integration to
> > commons users with your objection that you don't understand all the
> > alternatives.
> >
> > If you want to pose what I and the community see as a respectable
> objection
> > to including a commit, it needs to be in the form of :
> > 1. alternative code that demonstrates a superior way of doing improper
> > integration. With unit tests that show how it is faster or more accurate.
> > 2. OR failures of the the submitted patch in a JUnit test.
>
> Sorry, this is not how it works. It is up to *you* the contributor
> who wants us to commit something to convince the community that what
> you are proposing is a good, supportable, standard way to solve
> whatever problem you are trying to solve. As Gilles and others
> have pointed out, we can't just commit whatever apparently
> functional code comes our way. The reasons for this should be
> obvious when you think about the problems associated with
> maintaining it and what happens to users when we release functional
> but numerically unsound code. Lets just say we have been burned a
> few times in the past and leave it at that. Also, I am not
> "blocking" anything. I am just asserting that I personally am not
> going to advocate for or myself commit code that I "don't understand."
>
> Phil
> >
> > Otherwise, I maintain that the hurdle of convincing you of the
> > correctness/optimality of a solution is way too high for anyone's good
> ...
> > including yours.
> >
> > Once the "ability to do improper integration" is in CM, you can always
> > mend/improve the patch. Its not like you've never integrated a class or
> > moved it around c.f MATH-827.
> >
> > Cheers,
> > -Ajo
> >
> >
> >
> > On Fri, Jul 19, 2013 at 2:55 PM, Phil Steitz <ph...@gmail.com>
> wrote:
> >
> >> On 7/19/13 2:36 PM, Konstantin Berlin wrote:
> >>> The question is how correctly to do AQ and how to correctly handle
> >>>
> >>>> improper integrals. What I would appreciate is some real numerical
> >>>> analysis or pointers to where we can do the research to support what
> >>>> Ajo is asking us to commit. Just running tests on one problem
> >>>> instance demonstrates nothing. I asked politely several times and
> >>>> got no response.
> >>>>
> >>> Page 170 of numerical recipes third edition.
> >>>
> >>> "The basic trick for improper integrals is to make a change of
> variables
> >> to
> >>> eliminate the singularity or to map an infinite range of integration
> to a
> >>> finite one."
> >>>
> >>> See also
> >>>
> >>
> http://www.gnu.org/software/gsl/manual/html_node/QAGI-adaptive-integration-on-infinite-intervals.html#QAGI-adaptive-integration-on-infinite-intervals
> >>> I hope this can convince people..
> >> Thanks! This is not really numerical analysis, but it is a start
> >> and an indication that there are at least some standard
> >> implementations that work this way. What would be helpful is some
> >> general references that provide complexity and error analysis and
> >> ideally characterize the functions for which the change of variable
> >> approach is better than Gauss-Hermite, per the first recommendation
> >> in [1]
> >>
> >> [1] http://en.wikipedia.org/wiki/Numerical_integration
> >>
> >> ---------------------------------------------------------------------
> >> 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] Cleaning up the curve fitters
Posted by Phil Steitz <ph...@gmail.com>.
On 7/20/13 6:45 AM, Ajo Fod wrote:
> Phil,
>
> I feel that you are blocking/delaying the use of improper integration to
> commons users with your objection that you don't understand all the
> alternatives.
>
> If you want to pose what I and the community see as a respectable objection
> to including a commit, it needs to be in the form of :
> 1. alternative code that demonstrates a superior way of doing improper
> integration. With unit tests that show how it is faster or more accurate.
> 2. OR failures of the the submitted patch in a JUnit test.
Sorry, this is not how it works. It is up to *you* the contributor
who wants us to commit something to convince the community that what
you are proposing is a good, supportable, standard way to solve
whatever problem you are trying to solve. As Gilles and others
have pointed out, we can't just commit whatever apparently
functional code comes our way. The reasons for this should be
obvious when you think about the problems associated with
maintaining it and what happens to users when we release functional
but numerically unsound code. Lets just say we have been burned a
few times in the past and leave it at that. Also, I am not
"blocking" anything. I am just asserting that I personally am not
going to advocate for or myself commit code that I "don't understand."
Phil
>
> Otherwise, I maintain that the hurdle of convincing you of the
> correctness/optimality of a solution is way too high for anyone's good ...
> including yours.
>
> Once the "ability to do improper integration" is in CM, you can always
> mend/improve the patch. Its not like you've never integrated a class or
> moved it around c.f MATH-827.
>
> Cheers,
> -Ajo
>
>
>
> On Fri, Jul 19, 2013 at 2:55 PM, Phil Steitz <ph...@gmail.com> wrote:
>
>> On 7/19/13 2:36 PM, Konstantin Berlin wrote:
>>> The question is how correctly to do AQ and how to correctly handle
>>>
>>>> improper integrals. What I would appreciate is some real numerical
>>>> analysis or pointers to where we can do the research to support what
>>>> Ajo is asking us to commit. Just running tests on one problem
>>>> instance demonstrates nothing. I asked politely several times and
>>>> got no response.
>>>>
>>> Page 170 of numerical recipes third edition.
>>>
>>> "The basic trick for improper integrals is to make a change of variables
>> to
>>> eliminate the singularity or to map an infinite range of integration to a
>>> finite one."
>>>
>>> See also
>>>
>> http://www.gnu.org/software/gsl/manual/html_node/QAGI-adaptive-integration-on-infinite-intervals.html#QAGI-adaptive-integration-on-infinite-intervals
>>> I hope this can convince people..
>> Thanks! This is not really numerical analysis, but it is a start
>> and an indication that there are at least some standard
>> implementations that work this way. What would be helpful is some
>> general references that provide complexity and error analysis and
>> ideally characterize the functions for which the change of variable
>> approach is better than Gauss-Hermite, per the first recommendation
>> in [1]
>>
>> [1] http://en.wikipedia.org/wiki/Numerical_integration
>>
>> ---------------------------------------------------------------------
>> 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] Cleaning up the curve fitters
Posted by Ajo Fod <aj...@gmail.com>.
Phil,
I feel that you are blocking/delaying the use of improper integration to
commons users with your objection that you don't understand all the
alternatives.
If you want to pose what I and the community see as a respectable objection
to including a commit, it needs to be in the form of :
1. alternative code that demonstrates a superior way of doing improper
integration. With unit tests that show how it is faster or more accurate.
2. OR failures of the the submitted patch in a JUnit test.
Otherwise, I maintain that the hurdle of convincing you of the
correctness/optimality of a solution is way too high for anyone's good ...
including yours.
Once the "ability to do improper integration" is in CM, you can always
mend/improve the patch. Its not like you've never integrated a class or
moved it around c.f MATH-827.
Cheers,
-Ajo
On Fri, Jul 19, 2013 at 2:55 PM, Phil Steitz <ph...@gmail.com> wrote:
> On 7/19/13 2:36 PM, Konstantin Berlin wrote:
> > The question is how correctly to do AQ and how to correctly handle
> >
> >> improper integrals. What I would appreciate is some real numerical
> >> analysis or pointers to where we can do the research to support what
> >> Ajo is asking us to commit. Just running tests on one problem
> >> instance demonstrates nothing. I asked politely several times and
> >> got no response.
> >>
> >
> > Page 170 of numerical recipes third edition.
> >
> > "The basic trick for improper integrals is to make a change of variables
> to
> > eliminate the singularity or to map an infinite range of integration to a
> > finite one."
> >
> > See also
> >
> http://www.gnu.org/software/gsl/manual/html_node/QAGI-adaptive-integration-on-infinite-intervals.html#QAGI-adaptive-integration-on-infinite-intervals
> >
> > I hope this can convince people..
>
> Thanks! This is not really numerical analysis, but it is a start
> and an indication that there are at least some standard
> implementations that work this way. What would be helpful is some
> general references that provide complexity and error analysis and
> ideally characterize the functions for which the change of variable
> approach is better than Gauss-Hermite, per the first recommendation
> in [1]
>
> [1] http://en.wikipedia.org/wiki/Numerical_integration
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org
>
>
Re: [Math] Cleaning up the curve fitters
Posted by Phil Steitz <ph...@gmail.com>.
On 7/19/13 2:36 PM, Konstantin Berlin wrote:
> The question is how correctly to do AQ and how to correctly handle
>
>> improper integrals. What I would appreciate is some real numerical
>> analysis or pointers to where we can do the research to support what
>> Ajo is asking us to commit. Just running tests on one problem
>> instance demonstrates nothing. I asked politely several times and
>> got no response.
>>
>
> Page 170 of numerical recipes third edition.
>
> "The basic trick for improper integrals is to make a change of variables to
> eliminate the singularity or to map an infinite range of integration to a
> finite one."
>
> See also
> http://www.gnu.org/software/gsl/manual/html_node/QAGI-adaptive-integration-on-infinite-intervals.html#QAGI-adaptive-integration-on-infinite-intervals
>
> I hope this can convince people..
Thanks! This is not really numerical analysis, but it is a start
and an indication that there are at least some standard
implementations that work this way. What would be helpful is some
general references that provide complexity and error analysis and
ideally characterize the functions for which the change of variable
approach is better than Gauss-Hermite, per the first recommendation
in [1]
[1] http://en.wikipedia.org/wiki/Numerical_integration
>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org
Re: [Math] Cleaning up the curve fitters
Posted by Konstantin Berlin <kb...@gmail.com>.
The question is how correctly to do AQ and how to correctly handle
> improper integrals. What I would appreciate is some real numerical
> analysis or pointers to where we can do the research to support what
> Ajo is asking us to commit. Just running tests on one problem
> instance demonstrates nothing. I asked politely several times and
> got no response.
>
Page 170 of numerical recipes third edition.
"The basic trick for improper integrals is to make a change of variables to
eliminate the singularity or to map an infinite range of integration to a
finite one."
See also
http://www.gnu.org/software/gsl/manual/html_node/QAGI-adaptive-integration-on-infinite-intervals.html#QAGI-adaptive-integration-on-infinite-intervals
I hope this can convince people...
Re: [Math] Cleaning up the curve fitters
Posted by Phil Steitz <ph...@gmail.com>.
On 7/19/13 12:38 PM, Ted Dunning wrote:
> On Fri, Jul 19, 2013 at 12:27 PM, Phil Steitz <ph...@gmail.com> wrote:
>
>>> It still seems to me that it would serve CM well to pay more attention to
>>> Ajo's comments and suggestions. Simply saying that we should focus on
>>> technical discussion when CM's list is filled with esthetic arguments
>>> really just sounds like a way of pushing people away.
>> Please read the threads. This is not "esthetics." Maybe you can
>> help.
>>
> I read the threads. I stand by my assertions that there are *lots* of
> non-technical discussions on CM.
>
> Rejecting this particular argument since it is procedural+technical rather
> than just technical seems less supportable than continuing those other
> threads.
>
> Help? The way that I help with the esthetic threads is by staying out of
> the way. Contributing to the noise level is not helpful and the endurance
> and spare time of the typical CM poster is apparently boundless.
>
> With this thread, the input I have is that Ajo's comments make a lot of
> sense (to me) and the "technical" arguments against including AQ as an
> option do not make a lot of sense (to me).
The question is how correctly to do AQ and how to correctly handle
improper integrals. What I would appreciate is some real numerical
analysis or pointers to where we can do the research to support what
Ajo is asking us to commit. Just running tests on one problem
instance demonstrates nothing. I asked politely several times and
got no response.
I know you don't like a lot of the design decisions we have made,
Ted, and several years back when you actually submitted some code,
we did not decide to change the structure of our then API to include
it. Could be we were right, could be we were wrong. It is what it
is. Complaining again and again over the years accomplishes nothing
and is frankly bad for the community. We have a healthy group of
active committers here and a healthy "long tail" of volunteers
submitting patches that *do* get committed. Just look at the
changelog or pom.xml. We are not perfect; but we are meritocracy
and a do-ocracy - just like any other serious OSS project. Your
contributions are always welcome and while it may not always seem
like it, your technical opinions are always taken very seriously.
In this case, regarding AQ, change of variable and handling improper
integrals, I at least would very much like to hear what you have to
say. But please, lets first talk about the algorithms and
numerics. Then we agree *what* we want to implement. Then we agree
how to integrate it.
Phil
>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org
Re: [Math] Cleaning up the curve fitters
Posted by Ted Dunning <te...@gmail.com>.
On Fri, Jul 19, 2013 at 12:27 PM, Phil Steitz <ph...@gmail.com> wrote:
> > It still seems to me that it would serve CM well to pay more attention to
> > Ajo's comments and suggestions. Simply saying that we should focus on
> > technical discussion when CM's list is filled with esthetic arguments
> > really just sounds like a way of pushing people away.
>
> Please read the threads. This is not "esthetics." Maybe you can
> help.
>
I read the threads. I stand by my assertions that there are *lots* of
non-technical discussions on CM.
Rejecting this particular argument since it is procedural+technical rather
than just technical seems less supportable than continuing those other
threads.
Help? The way that I help with the esthetic threads is by staying out of
the way. Contributing to the noise level is not helpful and the endurance
and spare time of the typical CM poster is apparently boundless.
With this thread, the input I have is that Ajo's comments make a lot of
sense (to me) and the "technical" arguments against including AQ as an
option do not make a lot of sense (to me).
Re: [Math] Cleaning up the curve fitters
Posted by Phil Steitz <ph...@gmail.com>.
On 7/19/13 12:21 PM, Ted Dunning wrote:
> The discussion about how to get something into commons when it is (a) well
> documented and (b) demonstrated better on at least some domains is
> partially procedural, but it hinges on technical factors.
>
> I think that Ajo is being very reserved here. When I faced similar
> discouragement in the past with commons math contributions, I simply went
> elsewhere.
>
> It still seems to me that it would serve CM well to pay more attention to
> Ajo's comments and suggestions. Simply saying that we should focus on
> technical discussion when CM's list is filled with esthetic arguments
> really just sounds like a way of pushing people away.
Please read the threads. This is not "esthetics." Maybe you can
help.
Phil
>
>
> On Fri, Jul 19, 2013 at 10:21 AM, Phil Steitz <ph...@gmail.com> wrote:
>
>> As I said above, let's focus on actual technical discussion here.
>> We implement standard, well-documented algorithms. We need to
>> provide references and convince ourselves that what we release is
>> numerically sound, well-documented and well-tested. We do our best
>> with the volunteer resources we have. Your help and contributions
>> are appreciated.
>>
>> Phil
>>
>> On 7/19/13 9:44 AM, Ajo Fod wrote:
>>> Hi,
>>>
>>> I very much appreciate the work that has been done in CM and this is
>>> precisely why I'd like more people to contribute. Even when you didnt'
>>> accept my MATH-995 patch, I got useful input from Konstantin and it has
>>> already made my application more efficient.
>>>
>>> What you required of me in the Improper integral example was a comparison
>>> of different methods. This sort of research takes time. I hear that
>> Gilles
>>> is working on it. I appreciate that you guys spent so much effort on
>> this.
>>> However, my contention is that your efforts at researching alternate
>>> solutions to a patch is not justified till you come up with a test that
>> the
>>> patch fails OR if you know an alternate performs better for an
>> application
>>> you have. In the first case, you're losing the efficiency of open source
>> by
>>> reinventing a possibly different wheel without sufficient marginal
>> reward.
>>> In the second case, beware of the fact that numerical algorithms are
>> hairy
>>> beasts, and it takes a while to encode something new. The efficiency of
>>> commons comes from putting the burden of development on the developers
>> who
>>> need the code.
>>>
>>> So, I propose an alternate approach to testing if a submitted patch needs
>>> to be accepted:
>>> 1. Check if the patch fills a gap in existing CM code
>>> 2. if so, check if it passes known tests
>>> 3. if so, write up alternate tests to see if the code breaks.
>>> 4. if so, wrap the code up in a suitable API and accept the patch
>>>
>>> This has two advantages. First CM will have more capabilities per unit of
>>> your precious time. Second you give people the feeling that they are
>> making
>>> a difference.
>>>
>>> As far as the debate on AQ(AdaptiveQuadrature) vs
>>> LGQ(IterativeLegendreGaussIntegrator) goes:
>>> The FACTS that support AQ over LGQ are:
>>> 1. An example where LGQ failed and AQ succeeded. I also explained why LGQ
>>> fails and AQ will probably converge more correctly. Generally adaptive
>>> quadrature are known to be so succesful at integration that Konstantin
>> even
>>> wondered why we don't have something yet.
>>> 2. Efficiency improvement: I also showed that LGQ is more efficient at at
>>> least one example in terms of accuracy in digits per function evaluation.
>>> So, conversely, its now your turn to provide concrete examples where LGQ
>>> does better than AQ. You could pose credible objections by providing
>>> examples where:
>>> 1. AQ fails but LGQ passes.
>>> 2. LGQ is more efficient in accuracy per evaluation.
>>>
>>> All that to illustrate with example where the perception that it is hard
>> to
>>> convince the gatekeepers of commons of the merits of a patch arises
>> from. I
>>> have a package in my codebase with assorted patches that I just dont'
>> think
>>> is worth the time to try to post to commons. I think it is very
>> inefficient
>>> if others have such private patches.
>>>
>>> Cheers,
>>> Ajo
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>> On Thu, Jul 18, 2013 at 2:15 PM, Phil Steitz <ph...@gmail.com>
>> wrote:
>>>> On 7/18/13 1:48 PM, Ajo Fod wrote:
>>>>> Hello folks,
>>>>>
>>>>> There is a lot of work in API design. However, Konstantin's point is
>> that
>>>>> it takes a lot of effort to convince Gilles of any alternatives. API
>>>> design
>>>>> issues should really be second to functionality. This idea seems to be
>>>> lost
>>>>> in conversations.
>>>> With patience and collaboration you can have both and we *need* to
>>>> have both. You can't get to a stable API and approachable and
>>>> maintainable code base without thinking carefully about API design.
>>>>> I agree with Gilles that providing tests and benchmarks that exhibit
>> the
>>>>> advantages of a particular method are probably the best way to show
>> other
>>>>> contributors the value of an alternative approach.
>>>> There is some value to this, but honestly much more value in
>>>> carefully researching and presenting the numerical analysis to
>>>> support improvement / performance claims.
>>>>> It is quite depressing to the contributor to see one's contribution be
>>>>> rejected when efficiency/accuracy improvements are demonstrated.
>>>> What you "demonstrated" in one case was better performance in one
>>>> problem instance. The change of variable approach you implemented
>>>> was, in my admittedly possibly naive numerics view, questionable. I
>>>> asked to see numerical analysis support and no one provided that.
>>>> Had you provided that, I would have argued to include some version
>>>> of the patch.
>>>>
>>>>> In a
>>>>> better world, rejecting a patch that passes the hurdle of demonstrating
>>>> an
>>>>> efficiency improvement over existing code should come with a
>>>> responsibility
>>>>> of showing alternate tests that the patch fails and the original code
>>>>> passes. Otherwise, the patch should be accepted by default. The person
>>>> who
>>>>> commits or designed the API is free to make changes to fit API design.
>>>> This is essentially what Gilles ended up doing. You may not agree
>>>> with the approach, but he did in fact address the core issue.
>>>>> Just like API designers are not experts at the underlying math,
>>>>> contributors are not necessarily experts at the underlying API design.
>> To
>>>>> unlock the efficiency of open source, contributor morale needs to be
>>>>> considered and classes that pass tests should really be accepted.
>>>> I agree that we should try to be friendly and encouraging and I
>>>> apologize if we have not been so. That said, the process of
>>>> contributing here is not just tossing patches over the wall. First
>>>> you need to get community support for the ideas. Then work
>>>> collaboratively to get patches that work for the code and community.
>>>>> For example, Performance AND accuracy improvements to existing
>> algorithm
>>>>> were demonstrated for AdaptiveQuadrature in my patches to MATH-995
>>>> Sorry, I was not convinced by the accuracy and performance claims
>>>> and, as I said above, I suspect that the change of variable approach
>>>> may not be the best way to handle improper integrals. I am not
>>>> claiming authority here - just - again - asking for real numerical
>>>> analysis arguments to support the claims you are making.
>>>>
>>>> It would be a lot better if we focused discussion on the actual
>>>> technical issues and mathematical principles rather than
>>>> generalities about how hard / easy it is to get stuff in.
>>>>
>>>> Phil
>>>>> The only joy I got out of that was Gilles putting a comment in the docs
>>>> for
>>>>> the existing class:
>>>>> "The Javadoc now draws attention that the [existing] algorithm is not
>>>> 100%
>>>>> fool-proof."!
>>>>> Also, I was asked to open a new issue about Adaptive Quadratures to
>>>> figure
>>>>> out what is the best quadratue method ... all while a patch that is a
>>>> clear
>>>>> improvement over existing code wastes away. Why not accept the patch
>> and
>>>>> make improvements as necessary?
>>>>>
>>>>> My impression since that patch was rejected, is that it just seems
>> like a
>>>>> huge hurdle to get any patch past the API design requirements that are
>>>>> frankly not as clear to me as it is to the designer. I can see how
>> others
>>>>> feel the same way.
>>>>>
>>>>> Cheers,
>>>>> Ajo.
>>>>>
>>>>> Gilles: if you don't want to end up spending time developing
>>>> Gauss-Hermite
>>>>> quadrature or something else you don't really need, perhaps you should
>>>>> consider accepting/modifying code that was shown to work by someone who
>>>>> needed that functionality. It is reasonable to develop alternatives to
>>>> fix
>>>>> flaws/gaps, but otherwise its your effort wasted. If someone's
>>>>> contribution doesn't fit your view of the API, then by all means edit
>> the
>>>>> patch, but if you go about rejecting things that work, there won't be
>> as
>>>>> many contributors to CM.
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> On Thu, Jul 18, 2013 at 10:08 AM, Roger L. Whitcomb <
>>>>> Roger.Whitcomb@actian.com> wrote:
>>>>>
>>>>>> As an outsider listening to these discussions, it seems like:
>>>>>> a) *IF* there are problems with the current arrangement of packages,
>>>> APIs,
>>>>>> or whatever, then a constructive approach would be for the one who
>> sees
>>>>>> such problems to take the time to not just criticize and point out
>>>> "flaws",
>>>>>> but to dig in and rearrange the packages, redo the APIs, provide unit
>>>>>> tests, and submit a patch with these changes, along with quantitative
>>>>>> justification, benchmarks, test cases, etc. It is quite easy to
>>>> criticize,
>>>>>> from the sidelines, the one who is actually doing the work, but quite
>>>>>> another matter to roll up your sleeves and join in the work....
>>>>>> b) Since Math is a "library", it seems like there needs to be
>>>>>> implementations of many different algorithms, since (quite clearly)
>> not
>>>>>> every algorithm is suited to every problem. To say that X method
>>>> doesn't
>>>>>> work well for problem Y, is not necessarily a reason to rewrite X
>>>> method,
>>>>>> if that method is correctly implementing the algorithm. Maybe the
>>>>>> algorithm is simply not the right one to use for the problem.
>>>>>> c) Comments that imply (or state outright) that someone who has
>>>> (clearly)
>>>>>> done a lot of work has done it "...without much thinking..." are
>> clearly
>>>>>> out of line. In my experience, the only reason to resort to name
>>>> calling
>>>>>> and character assassination is because one has no worthy arguments to
>>>> put
>>>>>> forward.
>>>>>> d) Kudos to the Commons committers who have been doing the work ...
>>>>>>
>>>>>> My 2 cents...
>>>>>>
>>>>>> ~Roger Whitcomb
>>>>>> Apache Pivot PMC Chair
>>>>>>
>>>>>> -----Original Message-----
>>>>>> From: Gilles [mailto:gilles@harfang.homelinux.org]
>>>>>> Sent: Thursday, July 18, 2013 9:35 AM
>>>>>> To: dev@commons.apache.org
>>>>>> Subject: Re: [Math] Cleaning up the curve fitters
>>>>>>
>>>>>> On Thu, 18 Jul 2013 11:47:03 -0400, Konstantin Berlin wrote:
>>>>>>> I appreciate the comment. I would like to help, but currently my
>>>>>>> schedule is full. Maybe towards the end of the year.
>>>>>>>
>>>>>>> I think the first approach should be do no harm. The optimization
>>>>>>> package keeps getting refactored every few months without much
>>>>>>> thinking involved. We had the discuss previously, with Gilles
>>>>>>> unilaterally deciding on the current tree, which he now wants to
>>>>>>> change again.
>>>>>> As I said,
>>>>>> as Luc said,
>>>>>> as Phil said,
>>>>>> again and again and again,
>>>>>> we are not optimization (as a scientific field) experts here, but we
>> do
>>>>>> use Commons Math in scientific code that is pretty compute intensive
>>>> (and
>>>>>> yes, maybe not in the same sense as you'd like it to be for your
>>>> comfort).
>>>>>> Current code has, and may still have problems, but we see them only
>>>>>> through running unit tests, running our applications, running code
>>>> examples
>>>>>> submitted by issue reporters.
>>>>>> We improve what we can, given time and motivation constraints.
>>>>>> Other than that, there is nothing.
>>>>>>
>>>>>> Yes, we already had that asymmetrical conversation where _you_ declare
>>>>>> what _we_ should do.
>>>>>>
>>>>>>> As someone who uses optimization regular I would say the current API
>>>>>>> state (not just package naming) leaves a lot to be desired, and is
>> not
>>>>>>> amenable to the various modification that people might need for
>> larger
>>>>>>> problems. So if you are going to modify it, you should at least open
>>>>>>> up the API to the possibility that different optimization steps can
>> be
>>>>>>> done using various techniques, depending on the problem.
>>>>>>>
>>>>>>> We should also accept that not everything can fit neatly into a
>>>>>>> package tree and a single set of APIs. A good example is least
>>>>>>> squares. Linear least squares does not require an initial guess at a
>>>>>>> solution, and by performing decomposition ahead of time you can
>>>>>>> quickly recompute the solution given different input values. However,
>>>>>>> an iterative least squares method might not have these properties.
>>>>>>> There are probably countless of other examples.
>>>>>>>
>>>>>>> Because optimization problems are really computationally hard all the
>>>>>>> little specific differences matter, that is why Gilles approach of
>>>>>>> sweeping everything under the rug and into some rigid not thought out
>>>>>>> hierarchical API forces these methods to adapt (or drop) numerical
>>>>>>> aspects that should not be there (e.x. polynomial fits). This has
>>>>>>> *huge* performance implications, but the issue is treated as some OO
>>>>>>> design 101 class, with the focus on how to force everything into a
>>>>>>> simple inheritance structure, numerics be damned.
>>>>>>>
>>>>>>> I would gladly help with the feedback when I can. Ajo and I provided
>>>>>>> code for adaptive integration, yet the whole issue was completely
>>>>>>> ignored. So I am not sure how much effort is required for the
>>>>>>> developers to take an idea or mostly completed code and make a
>> change,
>>>>>>> rather than reject even the most basic numerical approaches that are
>>>>>>> taught in introduction classes as something that needs to be
>>>>>>> benchmarked.
>>>>>> As usual, you are mixing everything, from algorithms to
>> implementations,
>>>>>> from proposing new features to denigrating existing ones (with
>>>> non-existent
>>>>>> or inappropriate use-cases), from numerical to efficiency
>>>> considerations...
>>>>>> [On top of it, you blatantly affirm that this issue has been ignored,
>>>> even
>>>>>> as I provided[1] an analysis[2] of what was actually happening.
>>>>>> People like you seem to ignore that we work benevolently on this
>>>> project!]
>>>>>> Not even speaking of derogatory remarks like "sweeping [...] under the
>>>> rug"
>>>>>> and "not thought out" and insinuating that everything was better and
>>>> more
>>>>>> efficient before. Which is simply not true.
>>>>>>
>>>>>> It's an asymmetrical discussion because you declare that half-baked
>> code
>>>>>> is good enough and _we_ have to work even more than if we'd have to
>>>>>> implement the feature from scratch.
>>>>>>
>>>>>>
>>>>>> Gilles
>>>>>>
>>>>>> [1] In the spare time I do _not_ have either.
>>>>>> [2] Which dragged me to the implementation of the Gauss-Hermite
>>>> quadrature
>>>>>> scheme (although I had no personal use of it), which seems to be
>>>> the
>>>>>> appropriate way to deal with the improper integral reported in
>> the
>>>>>> issue which you refer to.
>>>>>>
>>>>>>
>>>>>> ---------------------------------------------------------------------
>>>>>> 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
>>>>>>
>>>> ---------------------------------------------------------------------
>>>> 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
>>
>>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org
Re: [Math] Cleaning up the curve fitters
Posted by Ajo Fod <aj...@gmail.com>.
> his code, so I can't comment about it specifically.
>>
>
> There was no outright rejection.
>
... only painful fillibustering with objections that were tangential to the
CM user experience.
>
> My strong impression is that the source of the problem is the
> misconception that Commons Math is repository of all sorts of
> mathematical routines, and that the only requirement is that a
> patch submitted by a would-be contributor should be outright
> accepted as soon as it solves something for someone.
>
Improving performance on the specific issue of a UnivariateFunction
integrated in the unit interval [-1,1] doesn't fall under "all sorts of
mathematical routines". If it did what is
The following well known (even to you) words describe the shortfall of
"IterativeGaussLegendreIntegrator" that AQ fixes. Any guess who this deep
thought was from?
"the _limitation_ of "IterativeGaussLegendreIntegrator" is that it does not
analyze where the error comes from; it just keeps on dividing the whole
range, piling up numerical errors in the region where few points are needed
(and where the contribution to the integral is ever more insignificant the
larger sigma becomes)."
>
> Indeed:
> 1. The proposal for implementing improper integrals was welcome.
> 2. The proposal for implementing additional adaptive algorithms
> was welcome.
>
Only superficially welcome ... when you add up the effort that goes into
convincing you guys of the merits of the patch ... after it has passed a
test suite.
>
> If he wanted to contribute to Commons Math (and not just "throw
> a patch over the wall", as Phil put it), Ajo could have started
> from there, and actually work out the details of how to best
> integrate the new features into the existing code. Just as you
> did.
>
Conversely, if you don't want to "just throw a patch back at me", I expect
test cases that fail or concrete steps towards accepting the patch. Not
something like lets go see if something else works.
Cheers,
Ajo.
RE: [Math] Cleaning up the curve fitters
Posted by Gilles <gi...@harfang.homelinux.org>.
Hello Jared.
> I have only contributed a few patches, and I see that there is
> argument about whether this thread should even be about anything
> other
> than technical issues, but I figured I would at least chime in.
>
> I found the submission process to be more difficult than I expected,
> but I also think the code turned out better because of it. I was
> actually pretty impressed and surprised at the level of scrutiny and
> quickness of responses, and it gives me a better feeling about using
> the library as a user. If my patches were outright rejected, though,
> I might feel differently. I don't know the history of Ajo's issue or
> his code, so I can't comment about it specifically.
There was no outright rejection. Along the discussion about the issue,
the features, and the code, I tried to explain several ways that can
speed up the adoption of a contribution; among many other suggestions,
I mentioned my interaction with you.[1]
I really hoped that this example would get us back on track by having
Ajo see how this process can be iterative and lead to a successful
contribution even if the code does not initially meet some quality
requirements.[2]
My strong impression is that the source of the problem is the
misconception that Commons Math is repository of all sorts of
mathematical routines, and that the only requirement is that a
patch submitted by a would-be contributor should be outright
accepted as soon as it solves something for someone.
Indeed:
1. The proposal for implementing improper integrals was welcome.
2. The proposal for implementing additional adaptive algorithms
was welcome.
If he wanted to contribute to Commons Math (and not just "throw
a patch over the wall", as Phil put it), Ajo could have started
from there, and actually work out the details of how to best
integrate the new features into the existing code. Just as you
did.
Regards,
Gilles
[1] http://markmail.org/message/erqohcragbxmm4xa
[2] I explained the reasons for not accepting the patch as it was.
It's all on the ML and yet another installment will not provide
more light.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org
RE: [Math] Cleaning up the curve fitters
Posted by "Becksfort, Jared" <Ja...@STJUDE.ORG>.
>From: Ted Dunning [mailto:ted.dunning@gmail.com]
>Sent: Friday, July 19, 2013 2:21 PM
>To: Commons Developers List
>Subject: Re: [Math] Cleaning up the curve fitters. .
>The discussion about how to get something into commons when it is (a) well documented and (b) demonstrated better on at least some domains is partially >procedural, but it hinges on technical factors.
>I think that Ajo is being very reserved here. When I faced similar discouragement in the past with commons math contributions, I simply went elsewhere.
>It still seems to me that it would serve CM well to pay more attention to Ajo's comments and suggestions. Simply saying that we should focus on technical >discussion when CM's list is filled with esthetic arguments really just sounds like a way of pushing people away.
Hello,
I have only contributed a few patches, and I see that there is argument about whether this thread should even be about anything other than technical issues, but I figured I would at least chime in.
I found the submission process to be more difficult than I expected, but I also think the code turned out better because of it. I was actually pretty impressed and surprised at the level of scrutiny and quickness of responses, and it gives me a better feeling about using the library as a user. If my patches were outright rejected, though, I might feel differently. I don't know the history of Ajo's issue or his code, so I can't comment about it specifically.
Jared
Email Disclaimer: www.stjude.org/emaildisclaimer
Consultation Disclaimer: www.stjude.org/consultationdisclaimer
Re: [Math] Cleaning up the curve fitters
Posted by Ted Dunning <te...@gmail.com>.
The discussion about how to get something into commons when it is (a) well
documented and (b) demonstrated better on at least some domains is
partially procedural, but it hinges on technical factors.
I think that Ajo is being very reserved here. When I faced similar
discouragement in the past with commons math contributions, I simply went
elsewhere.
It still seems to me that it would serve CM well to pay more attention to
Ajo's comments and suggestions. Simply saying that we should focus on
technical discussion when CM's list is filled with esthetic arguments
really just sounds like a way of pushing people away.
On Fri, Jul 19, 2013 at 10:21 AM, Phil Steitz <ph...@gmail.com> wrote:
> As I said above, let's focus on actual technical discussion here.
> We implement standard, well-documented algorithms. We need to
> provide references and convince ourselves that what we release is
> numerically sound, well-documented and well-tested. We do our best
> with the volunteer resources we have. Your help and contributions
> are appreciated.
>
> Phil
>
> On 7/19/13 9:44 AM, Ajo Fod wrote:
> > Hi,
> >
> > I very much appreciate the work that has been done in CM and this is
> > precisely why I'd like more people to contribute. Even when you didnt'
> > accept my MATH-995 patch, I got useful input from Konstantin and it has
> > already made my application more efficient.
> >
> > What you required of me in the Improper integral example was a comparison
> > of different methods. This sort of research takes time. I hear that
> Gilles
> > is working on it. I appreciate that you guys spent so much effort on
> this.
> >
> > However, my contention is that your efforts at researching alternate
> > solutions to a patch is not justified till you come up with a test that
> the
> > patch fails OR if you know an alternate performs better for an
> application
> > you have. In the first case, you're losing the efficiency of open source
> by
> > reinventing a possibly different wheel without sufficient marginal
> reward.
> > In the second case, beware of the fact that numerical algorithms are
> hairy
> > beasts, and it takes a while to encode something new. The efficiency of
> > commons comes from putting the burden of development on the developers
> who
> > need the code.
> >
> > So, I propose an alternate approach to testing if a submitted patch needs
> > to be accepted:
> > 1. Check if the patch fills a gap in existing CM code
> > 2. if so, check if it passes known tests
> > 3. if so, write up alternate tests to see if the code breaks.
> > 4. if so, wrap the code up in a suitable API and accept the patch
> >
> > This has two advantages. First CM will have more capabilities per unit of
> > your precious time. Second you give people the feeling that they are
> making
> > a difference.
> >
> > As far as the debate on AQ(AdaptiveQuadrature) vs
> > LGQ(IterativeLegendreGaussIntegrator) goes:
> > The FACTS that support AQ over LGQ are:
> > 1. An example where LGQ failed and AQ succeeded. I also explained why LGQ
> > fails and AQ will probably converge more correctly. Generally adaptive
> > quadrature are known to be so succesful at integration that Konstantin
> even
> > wondered why we don't have something yet.
> > 2. Efficiency improvement: I also showed that LGQ is more efficient at at
> > least one example in terms of accuracy in digits per function evaluation.
> > So, conversely, its now your turn to provide concrete examples where LGQ
> > does better than AQ. You could pose credible objections by providing
> > examples where:
> > 1. AQ fails but LGQ passes.
> > 2. LGQ is more efficient in accuracy per evaluation.
> >
> > All that to illustrate with example where the perception that it is hard
> to
> > convince the gatekeepers of commons of the merits of a patch arises
> from. I
> > have a package in my codebase with assorted patches that I just dont'
> think
> > is worth the time to try to post to commons. I think it is very
> inefficient
> > if others have such private patches.
> >
> > Cheers,
> > Ajo
> >
> >
> >
> >
> >
> >
> >
> > On Thu, Jul 18, 2013 at 2:15 PM, Phil Steitz <ph...@gmail.com>
> wrote:
> >
> >> On 7/18/13 1:48 PM, Ajo Fod wrote:
> >>> Hello folks,
> >>>
> >>> There is a lot of work in API design. However, Konstantin's point is
> that
> >>> it takes a lot of effort to convince Gilles of any alternatives. API
> >> design
> >>> issues should really be second to functionality. This idea seems to be
> >> lost
> >>> in conversations.
> >> With patience and collaboration you can have both and we *need* to
> >> have both. You can't get to a stable API and approachable and
> >> maintainable code base without thinking carefully about API design.
> >>> I agree with Gilles that providing tests and benchmarks that exhibit
> the
> >>> advantages of a particular method are probably the best way to show
> other
> >>> contributors the value of an alternative approach.
> >> There is some value to this, but honestly much more value in
> >> carefully researching and presenting the numerical analysis to
> >> support improvement / performance claims.
> >>> It is quite depressing to the contributor to see one's contribution be
> >>> rejected when efficiency/accuracy improvements are demonstrated.
> >> What you "demonstrated" in one case was better performance in one
> >> problem instance. The change of variable approach you implemented
> >> was, in my admittedly possibly naive numerics view, questionable. I
> >> asked to see numerical analysis support and no one provided that.
> >> Had you provided that, I would have argued to include some version
> >> of the patch.
> >>
> >>> In a
> >>> better world, rejecting a patch that passes the hurdle of demonstrating
> >> an
> >>> efficiency improvement over existing code should come with a
> >> responsibility
> >>> of showing alternate tests that the patch fails and the original code
> >>> passes. Otherwise, the patch should be accepted by default. The person
> >> who
> >>> commits or designed the API is free to make changes to fit API design.
> >> This is essentially what Gilles ended up doing. You may not agree
> >> with the approach, but he did in fact address the core issue.
> >>> Just like API designers are not experts at the underlying math,
> >>> contributors are not necessarily experts at the underlying API design.
> To
> >>> unlock the efficiency of open source, contributor morale needs to be
> >>> considered and classes that pass tests should really be accepted.
> >> I agree that we should try to be friendly and encouraging and I
> >> apologize if we have not been so. That said, the process of
> >> contributing here is not just tossing patches over the wall. First
> >> you need to get community support for the ideas. Then work
> >> collaboratively to get patches that work for the code and community.
> >>> For example, Performance AND accuracy improvements to existing
> algorithm
> >>> were demonstrated for AdaptiveQuadrature in my patches to MATH-995
> >> Sorry, I was not convinced by the accuracy and performance claims
> >> and, as I said above, I suspect that the change of variable approach
> >> may not be the best way to handle improper integrals. I am not
> >> claiming authority here - just - again - asking for real numerical
> >> analysis arguments to support the claims you are making.
> >>
> >> It would be a lot better if we focused discussion on the actual
> >> technical issues and mathematical principles rather than
> >> generalities about how hard / easy it is to get stuff in.
> >>
> >> Phil
> >>> The only joy I got out of that was Gilles putting a comment in the docs
> >> for
> >>> the existing class:
> >>> "The Javadoc now draws attention that the [existing] algorithm is not
> >> 100%
> >>> fool-proof."!
> >>> Also, I was asked to open a new issue about Adaptive Quadratures to
> >> figure
> >>> out what is the best quadratue method ... all while a patch that is a
> >> clear
> >>> improvement over existing code wastes away. Why not accept the patch
> and
> >>> make improvements as necessary?
> >>>
> >>> My impression since that patch was rejected, is that it just seems
> like a
> >>> huge hurdle to get any patch past the API design requirements that are
> >>> frankly not as clear to me as it is to the designer. I can see how
> others
> >>> feel the same way.
> >>>
> >>> Cheers,
> >>> Ajo.
> >>>
> >>> Gilles: if you don't want to end up spending time developing
> >> Gauss-Hermite
> >>> quadrature or something else you don't really need, perhaps you should
> >>> consider accepting/modifying code that was shown to work by someone who
> >>> needed that functionality. It is reasonable to develop alternatives to
> >> fix
> >>> flaws/gaps, but otherwise its your effort wasted. If someone's
> >>> contribution doesn't fit your view of the API, then by all means edit
> the
> >>> patch, but if you go about rejecting things that work, there won't be
> as
> >>> many contributors to CM.
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>
> >>> On Thu, Jul 18, 2013 at 10:08 AM, Roger L. Whitcomb <
> >>> Roger.Whitcomb@actian.com> wrote:
> >>>
> >>>> As an outsider listening to these discussions, it seems like:
> >>>> a) *IF* there are problems with the current arrangement of packages,
> >> APIs,
> >>>> or whatever, then a constructive approach would be for the one who
> sees
> >>>> such problems to take the time to not just criticize and point out
> >> "flaws",
> >>>> but to dig in and rearrange the packages, redo the APIs, provide unit
> >>>> tests, and submit a patch with these changes, along with quantitative
> >>>> justification, benchmarks, test cases, etc. It is quite easy to
> >> criticize,
> >>>> from the sidelines, the one who is actually doing the work, but quite
> >>>> another matter to roll up your sleeves and join in the work....
> >>>> b) Since Math is a "library", it seems like there needs to be
> >>>> implementations of many different algorithms, since (quite clearly)
> not
> >>>> every algorithm is suited to every problem. To say that X method
> >> doesn't
> >>>> work well for problem Y, is not necessarily a reason to rewrite X
> >> method,
> >>>> if that method is correctly implementing the algorithm. Maybe the
> >>>> algorithm is simply not the right one to use for the problem.
> >>>> c) Comments that imply (or state outright) that someone who has
> >> (clearly)
> >>>> done a lot of work has done it "...without much thinking..." are
> clearly
> >>>> out of line. In my experience, the only reason to resort to name
> >> calling
> >>>> and character assassination is because one has no worthy arguments to
> >> put
> >>>> forward.
> >>>> d) Kudos to the Commons committers who have been doing the work ...
> >>>>
> >>>> My 2 cents...
> >>>>
> >>>> ~Roger Whitcomb
> >>>> Apache Pivot PMC Chair
> >>>>
> >>>> -----Original Message-----
> >>>> From: Gilles [mailto:gilles@harfang.homelinux.org]
> >>>> Sent: Thursday, July 18, 2013 9:35 AM
> >>>> To: dev@commons.apache.org
> >>>> Subject: Re: [Math] Cleaning up the curve fitters
> >>>>
> >>>> On Thu, 18 Jul 2013 11:47:03 -0400, Konstantin Berlin wrote:
> >>>>> I appreciate the comment. I would like to help, but currently my
> >>>>> schedule is full. Maybe towards the end of the year.
> >>>>>
> >>>>> I think the first approach should be do no harm. The optimization
> >>>>> package keeps getting refactored every few months without much
> >>>>> thinking involved. We had the discuss previously, with Gilles
> >>>>> unilaterally deciding on the current tree, which he now wants to
> >>>>> change again.
> >>>> As I said,
> >>>> as Luc said,
> >>>> as Phil said,
> >>>> again and again and again,
> >>>> we are not optimization (as a scientific field) experts here, but we
> do
> >>>> use Commons Math in scientific code that is pretty compute intensive
> >> (and
> >>>> yes, maybe not in the same sense as you'd like it to be for your
> >> comfort).
> >>>> Current code has, and may still have problems, but we see them only
> >>>> through running unit tests, running our applications, running code
> >> examples
> >>>> submitted by issue reporters.
> >>>> We improve what we can, given time and motivation constraints.
> >>>> Other than that, there is nothing.
> >>>>
> >>>> Yes, we already had that asymmetrical conversation where _you_ declare
> >>>> what _we_ should do.
> >>>>
> >>>>> As someone who uses optimization regular I would say the current API
> >>>>> state (not just package naming) leaves a lot to be desired, and is
> not
> >>>>> amenable to the various modification that people might need for
> larger
> >>>>> problems. So if you are going to modify it, you should at least open
> >>>>> up the API to the possibility that different optimization steps can
> be
> >>>>> done using various techniques, depending on the problem.
> >>>>>
> >>>>> We should also accept that not everything can fit neatly into a
> >>>>> package tree and a single set of APIs. A good example is least
> >>>>> squares. Linear least squares does not require an initial guess at a
> >>>>> solution, and by performing decomposition ahead of time you can
> >>>>> quickly recompute the solution given different input values. However,
> >>>>> an iterative least squares method might not have these properties.
> >>>>> There are probably countless of other examples.
> >>>>>
> >>>>> Because optimization problems are really computationally hard all the
> >>>>> little specific differences matter, that is why Gilles approach of
> >>>>> sweeping everything under the rug and into some rigid not thought out
> >>>>> hierarchical API forces these methods to adapt (or drop) numerical
> >>>>> aspects that should not be there (e.x. polynomial fits). This has
> >>>>> *huge* performance implications, but the issue is treated as some OO
> >>>>> design 101 class, with the focus on how to force everything into a
> >>>>> simple inheritance structure, numerics be damned.
> >>>>>
> >>>>> I would gladly help with the feedback when I can. Ajo and I provided
> >>>>> code for adaptive integration, yet the whole issue was completely
> >>>>> ignored. So I am not sure how much effort is required for the
> >>>>> developers to take an idea or mostly completed code and make a
> change,
> >>>>> rather than reject even the most basic numerical approaches that are
> >>>>> taught in introduction classes as something that needs to be
> >>>>> benchmarked.
> >>>> As usual, you are mixing everything, from algorithms to
> implementations,
> >>>> from proposing new features to denigrating existing ones (with
> >> non-existent
> >>>> or inappropriate use-cases), from numerical to efficiency
> >> considerations...
> >>>> [On top of it, you blatantly affirm that this issue has been ignored,
> >> even
> >>>> as I provided[1] an analysis[2] of what was actually happening.
> >>>> People like you seem to ignore that we work benevolently on this
> >> project!]
> >>>> Not even speaking of derogatory remarks like "sweeping [...] under the
> >> rug"
> >>>> and "not thought out" and insinuating that everything was better and
> >> more
> >>>> efficient before. Which is simply not true.
> >>>>
> >>>> It's an asymmetrical discussion because you declare that half-baked
> code
> >>>> is good enough and _we_ have to work even more than if we'd have to
> >>>> implement the feature from scratch.
> >>>>
> >>>>
> >>>> Gilles
> >>>>
> >>>> [1] In the spare time I do _not_ have either.
> >>>> [2] Which dragged me to the implementation of the Gauss-Hermite
> >> quadrature
> >>>> scheme (although I had no personal use of it), which seems to be
> >> the
> >>>> appropriate way to deal with the improper integral reported in
> the
> >>>> issue which you refer to.
> >>>>
> >>>>
> >>>> ---------------------------------------------------------------------
> >>>> 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
> >>>>
> >>
> >> ---------------------------------------------------------------------
> >> 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] Cleaning up the curve fitters
Posted by Phil Steitz <ph...@gmail.com>.
As I said above, let's focus on actual technical discussion here.
We implement standard, well-documented algorithms. We need to
provide references and convince ourselves that what we release is
numerically sound, well-documented and well-tested. We do our best
with the volunteer resources we have. Your help and contributions
are appreciated.
Phil
On 7/19/13 9:44 AM, Ajo Fod wrote:
> Hi,
>
> I very much appreciate the work that has been done in CM and this is
> precisely why I'd like more people to contribute. Even when you didnt'
> accept my MATH-995 patch, I got useful input from Konstantin and it has
> already made my application more efficient.
>
> What you required of me in the Improper integral example was a comparison
> of different methods. This sort of research takes time. I hear that Gilles
> is working on it. I appreciate that you guys spent so much effort on this.
>
> However, my contention is that your efforts at researching alternate
> solutions to a patch is not justified till you come up with a test that the
> patch fails OR if you know an alternate performs better for an application
> you have. In the first case, you're losing the efficiency of open source by
> reinventing a possibly different wheel without sufficient marginal reward.
> In the second case, beware of the fact that numerical algorithms are hairy
> beasts, and it takes a while to encode something new. The efficiency of
> commons comes from putting the burden of development on the developers who
> need the code.
>
> So, I propose an alternate approach to testing if a submitted patch needs
> to be accepted:
> 1. Check if the patch fills a gap in existing CM code
> 2. if so, check if it passes known tests
> 3. if so, write up alternate tests to see if the code breaks.
> 4. if so, wrap the code up in a suitable API and accept the patch
>
> This has two advantages. First CM will have more capabilities per unit of
> your precious time. Second you give people the feeling that they are making
> a difference.
>
> As far as the debate on AQ(AdaptiveQuadrature) vs
> LGQ(IterativeLegendreGaussIntegrator) goes:
> The FACTS that support AQ over LGQ are:
> 1. An example where LGQ failed and AQ succeeded. I also explained why LGQ
> fails and AQ will probably converge more correctly. Generally adaptive
> quadrature are known to be so succesful at integration that Konstantin even
> wondered why we don't have something yet.
> 2. Efficiency improvement: I also showed that LGQ is more efficient at at
> least one example in terms of accuracy in digits per function evaluation.
> So, conversely, its now your turn to provide concrete examples where LGQ
> does better than AQ. You could pose credible objections by providing
> examples where:
> 1. AQ fails but LGQ passes.
> 2. LGQ is more efficient in accuracy per evaluation.
>
> All that to illustrate with example where the perception that it is hard to
> convince the gatekeepers of commons of the merits of a patch arises from. I
> have a package in my codebase with assorted patches that I just dont' think
> is worth the time to try to post to commons. I think it is very inefficient
> if others have such private patches.
>
> Cheers,
> Ajo
>
>
>
>
>
>
>
> On Thu, Jul 18, 2013 at 2:15 PM, Phil Steitz <ph...@gmail.com> wrote:
>
>> On 7/18/13 1:48 PM, Ajo Fod wrote:
>>> Hello folks,
>>>
>>> There is a lot of work in API design. However, Konstantin's point is that
>>> it takes a lot of effort to convince Gilles of any alternatives. API
>> design
>>> issues should really be second to functionality. This idea seems to be
>> lost
>>> in conversations.
>> With patience and collaboration you can have both and we *need* to
>> have both. You can't get to a stable API and approachable and
>> maintainable code base without thinking carefully about API design.
>>> I agree with Gilles that providing tests and benchmarks that exhibit the
>>> advantages of a particular method are probably the best way to show other
>>> contributors the value of an alternative approach.
>> There is some value to this, but honestly much more value in
>> carefully researching and presenting the numerical analysis to
>> support improvement / performance claims.
>>> It is quite depressing to the contributor to see one's contribution be
>>> rejected when efficiency/accuracy improvements are demonstrated.
>> What you "demonstrated" in one case was better performance in one
>> problem instance. The change of variable approach you implemented
>> was, in my admittedly possibly naive numerics view, questionable. I
>> asked to see numerical analysis support and no one provided that.
>> Had you provided that, I would have argued to include some version
>> of the patch.
>>
>>> In a
>>> better world, rejecting a patch that passes the hurdle of demonstrating
>> an
>>> efficiency improvement over existing code should come with a
>> responsibility
>>> of showing alternate tests that the patch fails and the original code
>>> passes. Otherwise, the patch should be accepted by default. The person
>> who
>>> commits or designed the API is free to make changes to fit API design.
>> This is essentially what Gilles ended up doing. You may not agree
>> with the approach, but he did in fact address the core issue.
>>> Just like API designers are not experts at the underlying math,
>>> contributors are not necessarily experts at the underlying API design. To
>>> unlock the efficiency of open source, contributor morale needs to be
>>> considered and classes that pass tests should really be accepted.
>> I agree that we should try to be friendly and encouraging and I
>> apologize if we have not been so. That said, the process of
>> contributing here is not just tossing patches over the wall. First
>> you need to get community support for the ideas. Then work
>> collaboratively to get patches that work for the code and community.
>>> For example, Performance AND accuracy improvements to existing algorithm
>>> were demonstrated for AdaptiveQuadrature in my patches to MATH-995
>> Sorry, I was not convinced by the accuracy and performance claims
>> and, as I said above, I suspect that the change of variable approach
>> may not be the best way to handle improper integrals. I am not
>> claiming authority here - just - again - asking for real numerical
>> analysis arguments to support the claims you are making.
>>
>> It would be a lot better if we focused discussion on the actual
>> technical issues and mathematical principles rather than
>> generalities about how hard / easy it is to get stuff in.
>>
>> Phil
>>> The only joy I got out of that was Gilles putting a comment in the docs
>> for
>>> the existing class:
>>> "The Javadoc now draws attention that the [existing] algorithm is not
>> 100%
>>> fool-proof."!
>>> Also, I was asked to open a new issue about Adaptive Quadratures to
>> figure
>>> out what is the best quadratue method ... all while a patch that is a
>> clear
>>> improvement over existing code wastes away. Why not accept the patch and
>>> make improvements as necessary?
>>>
>>> My impression since that patch was rejected, is that it just seems like a
>>> huge hurdle to get any patch past the API design requirements that are
>>> frankly not as clear to me as it is to the designer. I can see how others
>>> feel the same way.
>>>
>>> Cheers,
>>> Ajo.
>>>
>>> Gilles: if you don't want to end up spending time developing
>> Gauss-Hermite
>>> quadrature or something else you don't really need, perhaps you should
>>> consider accepting/modifying code that was shown to work by someone who
>>> needed that functionality. It is reasonable to develop alternatives to
>> fix
>>> flaws/gaps, but otherwise its your effort wasted. If someone's
>>> contribution doesn't fit your view of the API, then by all means edit the
>>> patch, but if you go about rejecting things that work, there won't be as
>>> many contributors to CM.
>>>
>>>
>>>
>>>
>>>
>>>
>>> On Thu, Jul 18, 2013 at 10:08 AM, Roger L. Whitcomb <
>>> Roger.Whitcomb@actian.com> wrote:
>>>
>>>> As an outsider listening to these discussions, it seems like:
>>>> a) *IF* there are problems with the current arrangement of packages,
>> APIs,
>>>> or whatever, then a constructive approach would be for the one who sees
>>>> such problems to take the time to not just criticize and point out
>> "flaws",
>>>> but to dig in and rearrange the packages, redo the APIs, provide unit
>>>> tests, and submit a patch with these changes, along with quantitative
>>>> justification, benchmarks, test cases, etc. It is quite easy to
>> criticize,
>>>> from the sidelines, the one who is actually doing the work, but quite
>>>> another matter to roll up your sleeves and join in the work....
>>>> b) Since Math is a "library", it seems like there needs to be
>>>> implementations of many different algorithms, since (quite clearly) not
>>>> every algorithm is suited to every problem. To say that X method
>> doesn't
>>>> work well for problem Y, is not necessarily a reason to rewrite X
>> method,
>>>> if that method is correctly implementing the algorithm. Maybe the
>>>> algorithm is simply not the right one to use for the problem.
>>>> c) Comments that imply (or state outright) that someone who has
>> (clearly)
>>>> done a lot of work has done it "...without much thinking..." are clearly
>>>> out of line. In my experience, the only reason to resort to name
>> calling
>>>> and character assassination is because one has no worthy arguments to
>> put
>>>> forward.
>>>> d) Kudos to the Commons committers who have been doing the work ...
>>>>
>>>> My 2 cents...
>>>>
>>>> ~Roger Whitcomb
>>>> Apache Pivot PMC Chair
>>>>
>>>> -----Original Message-----
>>>> From: Gilles [mailto:gilles@harfang.homelinux.org]
>>>> Sent: Thursday, July 18, 2013 9:35 AM
>>>> To: dev@commons.apache.org
>>>> Subject: Re: [Math] Cleaning up the curve fitters
>>>>
>>>> On Thu, 18 Jul 2013 11:47:03 -0400, Konstantin Berlin wrote:
>>>>> I appreciate the comment. I would like to help, but currently my
>>>>> schedule is full. Maybe towards the end of the year.
>>>>>
>>>>> I think the first approach should be do no harm. The optimization
>>>>> package keeps getting refactored every few months without much
>>>>> thinking involved. We had the discuss previously, with Gilles
>>>>> unilaterally deciding on the current tree, which he now wants to
>>>>> change again.
>>>> As I said,
>>>> as Luc said,
>>>> as Phil said,
>>>> again and again and again,
>>>> we are not optimization (as a scientific field) experts here, but we do
>>>> use Commons Math in scientific code that is pretty compute intensive
>> (and
>>>> yes, maybe not in the same sense as you'd like it to be for your
>> comfort).
>>>> Current code has, and may still have problems, but we see them only
>>>> through running unit tests, running our applications, running code
>> examples
>>>> submitted by issue reporters.
>>>> We improve what we can, given time and motivation constraints.
>>>> Other than that, there is nothing.
>>>>
>>>> Yes, we already had that asymmetrical conversation where _you_ declare
>>>> what _we_ should do.
>>>>
>>>>> As someone who uses optimization regular I would say the current API
>>>>> state (not just package naming) leaves a lot to be desired, and is not
>>>>> amenable to the various modification that people might need for larger
>>>>> problems. So if you are going to modify it, you should at least open
>>>>> up the API to the possibility that different optimization steps can be
>>>>> done using various techniques, depending on the problem.
>>>>>
>>>>> We should also accept that not everything can fit neatly into a
>>>>> package tree and a single set of APIs. A good example is least
>>>>> squares. Linear least squares does not require an initial guess at a
>>>>> solution, and by performing decomposition ahead of time you can
>>>>> quickly recompute the solution given different input values. However,
>>>>> an iterative least squares method might not have these properties.
>>>>> There are probably countless of other examples.
>>>>>
>>>>> Because optimization problems are really computationally hard all the
>>>>> little specific differences matter, that is why Gilles approach of
>>>>> sweeping everything under the rug and into some rigid not thought out
>>>>> hierarchical API forces these methods to adapt (or drop) numerical
>>>>> aspects that should not be there (e.x. polynomial fits). This has
>>>>> *huge* performance implications, but the issue is treated as some OO
>>>>> design 101 class, with the focus on how to force everything into a
>>>>> simple inheritance structure, numerics be damned.
>>>>>
>>>>> I would gladly help with the feedback when I can. Ajo and I provided
>>>>> code for adaptive integration, yet the whole issue was completely
>>>>> ignored. So I am not sure how much effort is required for the
>>>>> developers to take an idea or mostly completed code and make a change,
>>>>> rather than reject even the most basic numerical approaches that are
>>>>> taught in introduction classes as something that needs to be
>>>>> benchmarked.
>>>> As usual, you are mixing everything, from algorithms to implementations,
>>>> from proposing new features to denigrating existing ones (with
>> non-existent
>>>> or inappropriate use-cases), from numerical to efficiency
>> considerations...
>>>> [On top of it, you blatantly affirm that this issue has been ignored,
>> even
>>>> as I provided[1] an analysis[2] of what was actually happening.
>>>> People like you seem to ignore that we work benevolently on this
>> project!]
>>>> Not even speaking of derogatory remarks like "sweeping [...] under the
>> rug"
>>>> and "not thought out" and insinuating that everything was better and
>> more
>>>> efficient before. Which is simply not true.
>>>>
>>>> It's an asymmetrical discussion because you declare that half-baked code
>>>> is good enough and _we_ have to work even more than if we'd have to
>>>> implement the feature from scratch.
>>>>
>>>>
>>>> Gilles
>>>>
>>>> [1] In the spare time I do _not_ have either.
>>>> [2] Which dragged me to the implementation of the Gauss-Hermite
>> quadrature
>>>> scheme (although I had no personal use of it), which seems to be
>> the
>>>> appropriate way to deal with the improper integral reported in the
>>>> issue which you refer to.
>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> 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
>>>>
>>
>> ---------------------------------------------------------------------
>> 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] Cleaning up the curve fitters
Posted by Ajo Fod <aj...@gmail.com>.
Hi,
I very much appreciate the work that has been done in CM and this is
precisely why I'd like more people to contribute. Even when you didnt'
accept my MATH-995 patch, I got useful input from Konstantin and it has
already made my application more efficient.
What you required of me in the Improper integral example was a comparison
of different methods. This sort of research takes time. I hear that Gilles
is working on it. I appreciate that you guys spent so much effort on this.
However, my contention is that your efforts at researching alternate
solutions to a patch is not justified till you come up with a test that the
patch fails OR if you know an alternate performs better for an application
you have. In the first case, you're losing the efficiency of open source by
reinventing a possibly different wheel without sufficient marginal reward.
In the second case, beware of the fact that numerical algorithms are hairy
beasts, and it takes a while to encode something new. The efficiency of
commons comes from putting the burden of development on the developers who
need the code.
So, I propose an alternate approach to testing if a submitted patch needs
to be accepted:
1. Check if the patch fills a gap in existing CM code
2. if so, check if it passes known tests
3. if so, write up alternate tests to see if the code breaks.
4. if so, wrap the code up in a suitable API and accept the patch
This has two advantages. First CM will have more capabilities per unit of
your precious time. Second you give people the feeling that they are making
a difference.
As far as the debate on AQ(AdaptiveQuadrature) vs
LGQ(IterativeLegendreGaussIntegrator) goes:
The FACTS that support AQ over LGQ are:
1. An example where LGQ failed and AQ succeeded. I also explained why LGQ
fails and AQ will probably converge more correctly. Generally adaptive
quadrature are known to be so succesful at integration that Konstantin even
wondered why we don't have something yet.
2. Efficiency improvement: I also showed that LGQ is more efficient at at
least one example in terms of accuracy in digits per function evaluation.
So, conversely, its now your turn to provide concrete examples where LGQ
does better than AQ. You could pose credible objections by providing
examples where:
1. AQ fails but LGQ passes.
2. LGQ is more efficient in accuracy per evaluation.
All that to illustrate with example where the perception that it is hard to
convince the gatekeepers of commons of the merits of a patch arises from. I
have a package in my codebase with assorted patches that I just dont' think
is worth the time to try to post to commons. I think it is very inefficient
if others have such private patches.
Cheers,
Ajo
On Thu, Jul 18, 2013 at 2:15 PM, Phil Steitz <ph...@gmail.com> wrote:
> On 7/18/13 1:48 PM, Ajo Fod wrote:
> > Hello folks,
> >
> > There is a lot of work in API design. However, Konstantin's point is that
> > it takes a lot of effort to convince Gilles of any alternatives. API
> design
> > issues should really be second to functionality. This idea seems to be
> lost
> > in conversations.
>
> With patience and collaboration you can have both and we *need* to
> have both. You can't get to a stable API and approachable and
> maintainable code base without thinking carefully about API design.
> >
> > I agree with Gilles that providing tests and benchmarks that exhibit the
> > advantages of a particular method are probably the best way to show other
> > contributors the value of an alternative approach.
>
> There is some value to this, but honestly much more value in
> carefully researching and presenting the numerical analysis to
> support improvement / performance claims.
> >
> > It is quite depressing to the contributor to see one's contribution be
> > rejected when efficiency/accuracy improvements are demonstrated.
>
> What you "demonstrated" in one case was better performance in one
> problem instance. The change of variable approach you implemented
> was, in my admittedly possibly naive numerics view, questionable. I
> asked to see numerical analysis support and no one provided that.
> Had you provided that, I would have argued to include some version
> of the patch.
>
> > In a
> > better world, rejecting a patch that passes the hurdle of demonstrating
> an
> > efficiency improvement over existing code should come with a
> responsibility
> > of showing alternate tests that the patch fails and the original code
> > passes. Otherwise, the patch should be accepted by default. The person
> who
> > commits or designed the API is free to make changes to fit API design.
>
> This is essentially what Gilles ended up doing. You may not agree
> with the approach, but he did in fact address the core issue.
> >
> > Just like API designers are not experts at the underlying math,
> > contributors are not necessarily experts at the underlying API design. To
> > unlock the efficiency of open source, contributor morale needs to be
> > considered and classes that pass tests should really be accepted.
>
> I agree that we should try to be friendly and encouraging and I
> apologize if we have not been so. That said, the process of
> contributing here is not just tossing patches over the wall. First
> you need to get community support for the ideas. Then work
> collaboratively to get patches that work for the code and community.
> >
> > For example, Performance AND accuracy improvements to existing algorithm
> > were demonstrated for AdaptiveQuadrature in my patches to MATH-995
>
> Sorry, I was not convinced by the accuracy and performance claims
> and, as I said above, I suspect that the change of variable approach
> may not be the best way to handle improper integrals. I am not
> claiming authority here - just - again - asking for real numerical
> analysis arguments to support the claims you are making.
>
> It would be a lot better if we focused discussion on the actual
> technical issues and mathematical principles rather than
> generalities about how hard / easy it is to get stuff in.
>
> Phil
> > The only joy I got out of that was Gilles putting a comment in the docs
> for
> > the existing class:
> > "The Javadoc now draws attention that the [existing] algorithm is not
> 100%
> > fool-proof."!
> > Also, I was asked to open a new issue about Adaptive Quadratures to
> figure
> > out what is the best quadratue method ... all while a patch that is a
> clear
> > improvement over existing code wastes away. Why not accept the patch and
> > make improvements as necessary?
> >
> > My impression since that patch was rejected, is that it just seems like a
> > huge hurdle to get any patch past the API design requirements that are
> > frankly not as clear to me as it is to the designer. I can see how others
> > feel the same way.
> >
> > Cheers,
> > Ajo.
> >
> > Gilles: if you don't want to end up spending time developing
> Gauss-Hermite
> > quadrature or something else you don't really need, perhaps you should
> > consider accepting/modifying code that was shown to work by someone who
> > needed that functionality. It is reasonable to develop alternatives to
> fix
> > flaws/gaps, but otherwise its your effort wasted. If someone's
> > contribution doesn't fit your view of the API, then by all means edit the
> > patch, but if you go about rejecting things that work, there won't be as
> > many contributors to CM.
> >
> >
> >
> >
> >
> >
> > On Thu, Jul 18, 2013 at 10:08 AM, Roger L. Whitcomb <
> > Roger.Whitcomb@actian.com> wrote:
> >
> >> As an outsider listening to these discussions, it seems like:
> >> a) *IF* there are problems with the current arrangement of packages,
> APIs,
> >> or whatever, then a constructive approach would be for the one who sees
> >> such problems to take the time to not just criticize and point out
> "flaws",
> >> but to dig in and rearrange the packages, redo the APIs, provide unit
> >> tests, and submit a patch with these changes, along with quantitative
> >> justification, benchmarks, test cases, etc. It is quite easy to
> criticize,
> >> from the sidelines, the one who is actually doing the work, but quite
> >> another matter to roll up your sleeves and join in the work....
> >> b) Since Math is a "library", it seems like there needs to be
> >> implementations of many different algorithms, since (quite clearly) not
> >> every algorithm is suited to every problem. To say that X method
> doesn't
> >> work well for problem Y, is not necessarily a reason to rewrite X
> method,
> >> if that method is correctly implementing the algorithm. Maybe the
> >> algorithm is simply not the right one to use for the problem.
> >> c) Comments that imply (or state outright) that someone who has
> (clearly)
> >> done a lot of work has done it "...without much thinking..." are clearly
> >> out of line. In my experience, the only reason to resort to name
> calling
> >> and character assassination is because one has no worthy arguments to
> put
> >> forward.
> >> d) Kudos to the Commons committers who have been doing the work ...
> >>
> >> My 2 cents...
> >>
> >> ~Roger Whitcomb
> >> Apache Pivot PMC Chair
> >>
> >> -----Original Message-----
> >> From: Gilles [mailto:gilles@harfang.homelinux.org]
> >> Sent: Thursday, July 18, 2013 9:35 AM
> >> To: dev@commons.apache.org
> >> Subject: Re: [Math] Cleaning up the curve fitters
> >>
> >> On Thu, 18 Jul 2013 11:47:03 -0400, Konstantin Berlin wrote:
> >>> I appreciate the comment. I would like to help, but currently my
> >>> schedule is full. Maybe towards the end of the year.
> >>>
> >>> I think the first approach should be do no harm. The optimization
> >>> package keeps getting refactored every few months without much
> >>> thinking involved. We had the discuss previously, with Gilles
> >>> unilaterally deciding on the current tree, which he now wants to
> >>> change again.
> >> As I said,
> >> as Luc said,
> >> as Phil said,
> >> again and again and again,
> >> we are not optimization (as a scientific field) experts here, but we do
> >> use Commons Math in scientific code that is pretty compute intensive
> (and
> >> yes, maybe not in the same sense as you'd like it to be for your
> comfort).
> >> Current code has, and may still have problems, but we see them only
> >> through running unit tests, running our applications, running code
> examples
> >> submitted by issue reporters.
> >> We improve what we can, given time and motivation constraints.
> >> Other than that, there is nothing.
> >>
> >> Yes, we already had that asymmetrical conversation where _you_ declare
> >> what _we_ should do.
> >>
> >>> As someone who uses optimization regular I would say the current API
> >>> state (not just package naming) leaves a lot to be desired, and is not
> >>> amenable to the various modification that people might need for larger
> >>> problems. So if you are going to modify it, you should at least open
> >>> up the API to the possibility that different optimization steps can be
> >>> done using various techniques, depending on the problem.
> >>>
> >>> We should also accept that not everything can fit neatly into a
> >>> package tree and a single set of APIs. A good example is least
> >>> squares. Linear least squares does not require an initial guess at a
> >>> solution, and by performing decomposition ahead of time you can
> >>> quickly recompute the solution given different input values. However,
> >>> an iterative least squares method might not have these properties.
> >>> There are probably countless of other examples.
> >>>
> >>> Because optimization problems are really computationally hard all the
> >>> little specific differences matter, that is why Gilles approach of
> >>> sweeping everything under the rug and into some rigid not thought out
> >>> hierarchical API forces these methods to adapt (or drop) numerical
> >>> aspects that should not be there (e.x. polynomial fits). This has
> >>> *huge* performance implications, but the issue is treated as some OO
> >>> design 101 class, with the focus on how to force everything into a
> >>> simple inheritance structure, numerics be damned.
> >>>
> >>> I would gladly help with the feedback when I can. Ajo and I provided
> >>> code for adaptive integration, yet the whole issue was completely
> >>> ignored. So I am not sure how much effort is required for the
> >>> developers to take an idea or mostly completed code and make a change,
> >>> rather than reject even the most basic numerical approaches that are
> >>> taught in introduction classes as something that needs to be
> >>> benchmarked.
> >> As usual, you are mixing everything, from algorithms to implementations,
> >> from proposing new features to denigrating existing ones (with
> non-existent
> >> or inappropriate use-cases), from numerical to efficiency
> considerations...
> >> [On top of it, you blatantly affirm that this issue has been ignored,
> even
> >> as I provided[1] an analysis[2] of what was actually happening.
> >> People like you seem to ignore that we work benevolently on this
> project!]
> >> Not even speaking of derogatory remarks like "sweeping [...] under the
> rug"
> >> and "not thought out" and insinuating that everything was better and
> more
> >> efficient before. Which is simply not true.
> >>
> >> It's an asymmetrical discussion because you declare that half-baked code
> >> is good enough and _we_ have to work even more than if we'd have to
> >> implement the feature from scratch.
> >>
> >>
> >> Gilles
> >>
> >> [1] In the spare time I do _not_ have either.
> >> [2] Which dragged me to the implementation of the Gauss-Hermite
> quadrature
> >> scheme (although I had no personal use of it), which seems to be
> the
> >> appropriate way to deal with the improper integral reported in the
> >> issue which you refer to.
> >>
> >>
> >> ---------------------------------------------------------------------
> >> 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
> >>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org
>
>
Re: [Math] Cleaning up the curve fitters
Posted by Thomas Neidhart <th...@gmail.com>.
On 07/18/2013 10:48 PM, Ajo Fod wrote:
> Hello folks,
>
> There is a lot of work in API design. However, Konstantin's point is that
> it takes a lot of effort to convince Gilles of any alternatives. API design
> issues should really be second to functionality. This idea seems to be lost
> in conversations.
>
> I agree with Gilles that providing tests and benchmarks that exhibit the
> advantages of a particular method are probably the best way to show other
> contributors the value of an alternative approach.
>
> It is quite depressing to the contributor to see one's contribution be
> rejected when efficiency/accuracy improvements are demonstrated. In a
> better world, rejecting a patch that passes the hurdle of demonstrating an
> efficiency improvement over existing code should come with a responsibility
> of showing alternate tests that the patch fails and the original code
> passes. Otherwise, the patch should be accepted by default. The person who
> commits or designed the API is free to make changes to fit API design.
>
> Just like API designers are not experts at the underlying math,
> contributors are not necessarily experts at the underlying API design. To
> unlock the efficiency of open source, contributor morale needs to be
> considered and classes that pass tests should really be accepted.
>
> For example, Performance AND accuracy improvements to existing algorithm
> were demonstrated for AdaptiveQuadrature in my patches to MATH-995
> The only joy I got out of that was Gilles putting a comment in the docs for
> the existing class:
> "The Javadoc now draws attention that the [existing] algorithm is not 100%
> fool-proof."!
> Also, I was asked to open a new issue about Adaptive Quadratures to figure
> out what is the best quadratue method ... all while a patch that is a clear
> improvement over existing code wastes away. Why not accept the patch and
> make improvements as necessary?
>
> My impression since that patch was rejected, is that it just seems like a
> huge hurdle to get any patch past the API design requirements that are
> frankly not as clear to me as it is to the designer. I can see how others
> feel the same way.
>
> Cheers,
> Ajo.
>
> Gilles: if you don't want to end up spending time developing Gauss-Hermite
> quadrature or something else you don't really need, perhaps you should
> consider accepting/modifying code that was shown to work by someone who
> needed that functionality. It is reasonable to develop alternatives to fix
> flaws/gaps, but otherwise its your effort wasted. If someone's
> contribution doesn't fit your view of the API, then by all means edit the
> patch, but if you go about rejecting things that work, there won't be as
> many contributors to CM.
Hi,
I am certainly not happy with the current API of the optimization
package but am looking forward to the suggested improvements from Luc
and how they can be applied to this package.
Otoh, I do not think it is fair to blame Gilles for doing a good job on
analyzing the root cause of reported problems and suggesting /
implementing changes that are generally applicable instead of doing
problem-specific fixes, which would just lead to an unmaintainable mess
(and I have some experience with that ...).
Following the discussions on this topic for a while, the bottom line is
mainly: you (= Commons Math) are doing it wrong. I have not seen a
proposal or draft on doing it better in a clean, maintainable way, and
this is the goal of this library afaik.
Thomas
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org
Re: [Math] Cleaning up the curve fitters
Posted by Phil Steitz <ph...@gmail.com>.
On 7/18/13 1:48 PM, Ajo Fod wrote:
> Hello folks,
>
> There is a lot of work in API design. However, Konstantin's point is that
> it takes a lot of effort to convince Gilles of any alternatives. API design
> issues should really be second to functionality. This idea seems to be lost
> in conversations.
With patience and collaboration you can have both and we *need* to
have both. You can't get to a stable API and approachable and
maintainable code base without thinking carefully about API design.
>
> I agree with Gilles that providing tests and benchmarks that exhibit the
> advantages of a particular method are probably the best way to show other
> contributors the value of an alternative approach.
There is some value to this, but honestly much more value in
carefully researching and presenting the numerical analysis to
support improvement / performance claims.
>
> It is quite depressing to the contributor to see one's contribution be
> rejected when efficiency/accuracy improvements are demonstrated.
What you "demonstrated" in one case was better performance in one
problem instance. The change of variable approach you implemented
was, in my admittedly possibly naive numerics view, questionable. I
asked to see numerical analysis support and no one provided that.
Had you provided that, I would have argued to include some version
of the patch.
> In a
> better world, rejecting a patch that passes the hurdle of demonstrating an
> efficiency improvement over existing code should come with a responsibility
> of showing alternate tests that the patch fails and the original code
> passes. Otherwise, the patch should be accepted by default. The person who
> commits or designed the API is free to make changes to fit API design.
This is essentially what Gilles ended up doing. You may not agree
with the approach, but he did in fact address the core issue.
>
> Just like API designers are not experts at the underlying math,
> contributors are not necessarily experts at the underlying API design. To
> unlock the efficiency of open source, contributor morale needs to be
> considered and classes that pass tests should really be accepted.
I agree that we should try to be friendly and encouraging and I
apologize if we have not been so. That said, the process of
contributing here is not just tossing patches over the wall. First
you need to get community support for the ideas. Then work
collaboratively to get patches that work for the code and community.
>
> For example, Performance AND accuracy improvements to existing algorithm
> were demonstrated for AdaptiveQuadrature in my patches to MATH-995
Sorry, I was not convinced by the accuracy and performance claims
and, as I said above, I suspect that the change of variable approach
may not be the best way to handle improper integrals. I am not
claiming authority here - just - again - asking for real numerical
analysis arguments to support the claims you are making.
It would be a lot better if we focused discussion on the actual
technical issues and mathematical principles rather than
generalities about how hard / easy it is to get stuff in.
Phil
> The only joy I got out of that was Gilles putting a comment in the docs for
> the existing class:
> "The Javadoc now draws attention that the [existing] algorithm is not 100%
> fool-proof."!
> Also, I was asked to open a new issue about Adaptive Quadratures to figure
> out what is the best quadratue method ... all while a patch that is a clear
> improvement over existing code wastes away. Why not accept the patch and
> make improvements as necessary?
>
> My impression since that patch was rejected, is that it just seems like a
> huge hurdle to get any patch past the API design requirements that are
> frankly not as clear to me as it is to the designer. I can see how others
> feel the same way.
>
> Cheers,
> Ajo.
>
> Gilles: if you don't want to end up spending time developing Gauss-Hermite
> quadrature or something else you don't really need, perhaps you should
> consider accepting/modifying code that was shown to work by someone who
> needed that functionality. It is reasonable to develop alternatives to fix
> flaws/gaps, but otherwise its your effort wasted. If someone's
> contribution doesn't fit your view of the API, then by all means edit the
> patch, but if you go about rejecting things that work, there won't be as
> many contributors to CM.
>
>
>
>
>
>
> On Thu, Jul 18, 2013 at 10:08 AM, Roger L. Whitcomb <
> Roger.Whitcomb@actian.com> wrote:
>
>> As an outsider listening to these discussions, it seems like:
>> a) *IF* there are problems with the current arrangement of packages, APIs,
>> or whatever, then a constructive approach would be for the one who sees
>> such problems to take the time to not just criticize and point out "flaws",
>> but to dig in and rearrange the packages, redo the APIs, provide unit
>> tests, and submit a patch with these changes, along with quantitative
>> justification, benchmarks, test cases, etc. It is quite easy to criticize,
>> from the sidelines, the one who is actually doing the work, but quite
>> another matter to roll up your sleeves and join in the work....
>> b) Since Math is a "library", it seems like there needs to be
>> implementations of many different algorithms, since (quite clearly) not
>> every algorithm is suited to every problem. To say that X method doesn't
>> work well for problem Y, is not necessarily a reason to rewrite X method,
>> if that method is correctly implementing the algorithm. Maybe the
>> algorithm is simply not the right one to use for the problem.
>> c) Comments that imply (or state outright) that someone who has (clearly)
>> done a lot of work has done it "...without much thinking..." are clearly
>> out of line. In my experience, the only reason to resort to name calling
>> and character assassination is because one has no worthy arguments to put
>> forward.
>> d) Kudos to the Commons committers who have been doing the work ...
>>
>> My 2 cents...
>>
>> ~Roger Whitcomb
>> Apache Pivot PMC Chair
>>
>> -----Original Message-----
>> From: Gilles [mailto:gilles@harfang.homelinux.org]
>> Sent: Thursday, July 18, 2013 9:35 AM
>> To: dev@commons.apache.org
>> Subject: Re: [Math] Cleaning up the curve fitters
>>
>> On Thu, 18 Jul 2013 11:47:03 -0400, Konstantin Berlin wrote:
>>> I appreciate the comment. I would like to help, but currently my
>>> schedule is full. Maybe towards the end of the year.
>>>
>>> I think the first approach should be do no harm. The optimization
>>> package keeps getting refactored every few months without much
>>> thinking involved. We had the discuss previously, with Gilles
>>> unilaterally deciding on the current tree, which he now wants to
>>> change again.
>> As I said,
>> as Luc said,
>> as Phil said,
>> again and again and again,
>> we are not optimization (as a scientific field) experts here, but we do
>> use Commons Math in scientific code that is pretty compute intensive (and
>> yes, maybe not in the same sense as you'd like it to be for your comfort).
>> Current code has, and may still have problems, but we see them only
>> through running unit tests, running our applications, running code examples
>> submitted by issue reporters.
>> We improve what we can, given time and motivation constraints.
>> Other than that, there is nothing.
>>
>> Yes, we already had that asymmetrical conversation where _you_ declare
>> what _we_ should do.
>>
>>> As someone who uses optimization regular I would say the current API
>>> state (not just package naming) leaves a lot to be desired, and is not
>>> amenable to the various modification that people might need for larger
>>> problems. So if you are going to modify it, you should at least open
>>> up the API to the possibility that different optimization steps can be
>>> done using various techniques, depending on the problem.
>>>
>>> We should also accept that not everything can fit neatly into a
>>> package tree and a single set of APIs. A good example is least
>>> squares. Linear least squares does not require an initial guess at a
>>> solution, and by performing decomposition ahead of time you can
>>> quickly recompute the solution given different input values. However,
>>> an iterative least squares method might not have these properties.
>>> There are probably countless of other examples.
>>>
>>> Because optimization problems are really computationally hard all the
>>> little specific differences matter, that is why Gilles approach of
>>> sweeping everything under the rug and into some rigid not thought out
>>> hierarchical API forces these methods to adapt (or drop) numerical
>>> aspects that should not be there (e.x. polynomial fits). This has
>>> *huge* performance implications, but the issue is treated as some OO
>>> design 101 class, with the focus on how to force everything into a
>>> simple inheritance structure, numerics be damned.
>>>
>>> I would gladly help with the feedback when I can. Ajo and I provided
>>> code for adaptive integration, yet the whole issue was completely
>>> ignored. So I am not sure how much effort is required for the
>>> developers to take an idea or mostly completed code and make a change,
>>> rather than reject even the most basic numerical approaches that are
>>> taught in introduction classes as something that needs to be
>>> benchmarked.
>> As usual, you are mixing everything, from algorithms to implementations,
>> from proposing new features to denigrating existing ones (with non-existent
>> or inappropriate use-cases), from numerical to efficiency considerations...
>> [On top of it, you blatantly affirm that this issue has been ignored, even
>> as I provided[1] an analysis[2] of what was actually happening.
>> People like you seem to ignore that we work benevolently on this project!]
>> Not even speaking of derogatory remarks like "sweeping [...] under the rug"
>> and "not thought out" and insinuating that everything was better and more
>> efficient before. Which is simply not true.
>>
>> It's an asymmetrical discussion because you declare that half-baked code
>> is good enough and _we_ have to work even more than if we'd have to
>> implement the feature from scratch.
>>
>>
>> Gilles
>>
>> [1] In the spare time I do _not_ have either.
>> [2] Which dragged me to the implementation of the Gauss-Hermite quadrature
>> scheme (although I had no personal use of it), which seems to be the
>> appropriate way to deal with the improper integral reported in the
>> issue which you refer to.
>>
>>
>> ---------------------------------------------------------------------
>> 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
>>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org
Re: [Math] Cleaning up the curve fitters
Posted by Ajo Fod <aj...@gmail.com>.
Hello folks,
There is a lot of work in API design. However, Konstantin's point is that
it takes a lot of effort to convince Gilles of any alternatives. API design
issues should really be second to functionality. This idea seems to be lost
in conversations.
I agree with Gilles that providing tests and benchmarks that exhibit the
advantages of a particular method are probably the best way to show other
contributors the value of an alternative approach.
It is quite depressing to the contributor to see one's contribution be
rejected when efficiency/accuracy improvements are demonstrated. In a
better world, rejecting a patch that passes the hurdle of demonstrating an
efficiency improvement over existing code should come with a responsibility
of showing alternate tests that the patch fails and the original code
passes. Otherwise, the patch should be accepted by default. The person who
commits or designed the API is free to make changes to fit API design.
Just like API designers are not experts at the underlying math,
contributors are not necessarily experts at the underlying API design. To
unlock the efficiency of open source, contributor morale needs to be
considered and classes that pass tests should really be accepted.
For example, Performance AND accuracy improvements to existing algorithm
were demonstrated for AdaptiveQuadrature in my patches to MATH-995
The only joy I got out of that was Gilles putting a comment in the docs for
the existing class:
"The Javadoc now draws attention that the [existing] algorithm is not 100%
fool-proof."!
Also, I was asked to open a new issue about Adaptive Quadratures to figure
out what is the best quadratue method ... all while a patch that is a clear
improvement over existing code wastes away. Why not accept the patch and
make improvements as necessary?
My impression since that patch was rejected, is that it just seems like a
huge hurdle to get any patch past the API design requirements that are
frankly not as clear to me as it is to the designer. I can see how others
feel the same way.
Cheers,
Ajo.
Gilles: if you don't want to end up spending time developing Gauss-Hermite
quadrature or something else you don't really need, perhaps you should
consider accepting/modifying code that was shown to work by someone who
needed that functionality. It is reasonable to develop alternatives to fix
flaws/gaps, but otherwise its your effort wasted. If someone's
contribution doesn't fit your view of the API, then by all means edit the
patch, but if you go about rejecting things that work, there won't be as
many contributors to CM.
On Thu, Jul 18, 2013 at 10:08 AM, Roger L. Whitcomb <
Roger.Whitcomb@actian.com> wrote:
> As an outsider listening to these discussions, it seems like:
> a) *IF* there are problems with the current arrangement of packages, APIs,
> or whatever, then a constructive approach would be for the one who sees
> such problems to take the time to not just criticize and point out "flaws",
> but to dig in and rearrange the packages, redo the APIs, provide unit
> tests, and submit a patch with these changes, along with quantitative
> justification, benchmarks, test cases, etc. It is quite easy to criticize,
> from the sidelines, the one who is actually doing the work, but quite
> another matter to roll up your sleeves and join in the work....
> b) Since Math is a "library", it seems like there needs to be
> implementations of many different algorithms, since (quite clearly) not
> every algorithm is suited to every problem. To say that X method doesn't
> work well for problem Y, is not necessarily a reason to rewrite X method,
> if that method is correctly implementing the algorithm. Maybe the
> algorithm is simply not the right one to use for the problem.
> c) Comments that imply (or state outright) that someone who has (clearly)
> done a lot of work has done it "...without much thinking..." are clearly
> out of line. In my experience, the only reason to resort to name calling
> and character assassination is because one has no worthy arguments to put
> forward.
> d) Kudos to the Commons committers who have been doing the work ...
>
> My 2 cents...
>
> ~Roger Whitcomb
> Apache Pivot PMC Chair
>
> -----Original Message-----
> From: Gilles [mailto:gilles@harfang.homelinux.org]
> Sent: Thursday, July 18, 2013 9:35 AM
> To: dev@commons.apache.org
> Subject: Re: [Math] Cleaning up the curve fitters
>
> On Thu, 18 Jul 2013 11:47:03 -0400, Konstantin Berlin wrote:
> > I appreciate the comment. I would like to help, but currently my
> > schedule is full. Maybe towards the end of the year.
> >
> > I think the first approach should be do no harm. The optimization
> > package keeps getting refactored every few months without much
> > thinking involved. We had the discuss previously, with Gilles
> > unilaterally deciding on the current tree, which he now wants to
> > change again.
>
> As I said,
> as Luc said,
> as Phil said,
> again and again and again,
> we are not optimization (as a scientific field) experts here, but we do
> use Commons Math in scientific code that is pretty compute intensive (and
> yes, maybe not in the same sense as you'd like it to be for your comfort).
> Current code has, and may still have problems, but we see them only
> through running unit tests, running our applications, running code examples
> submitted by issue reporters.
> We improve what we can, given time and motivation constraints.
> Other than that, there is nothing.
>
> Yes, we already had that asymmetrical conversation where _you_ declare
> what _we_ should do.
>
> > As someone who uses optimization regular I would say the current API
> > state (not just package naming) leaves a lot to be desired, and is not
> > amenable to the various modification that people might need for larger
> > problems. So if you are going to modify it, you should at least open
> > up the API to the possibility that different optimization steps can be
> > done using various techniques, depending on the problem.
> >
> > We should also accept that not everything can fit neatly into a
> > package tree and a single set of APIs. A good example is least
> > squares. Linear least squares does not require an initial guess at a
> > solution, and by performing decomposition ahead of time you can
> > quickly recompute the solution given different input values. However,
> > an iterative least squares method might not have these properties.
> > There are probably countless of other examples.
> >
> > Because optimization problems are really computationally hard all the
> > little specific differences matter, that is why Gilles approach of
> > sweeping everything under the rug and into some rigid not thought out
> > hierarchical API forces these methods to adapt (or drop) numerical
> > aspects that should not be there (e.x. polynomial fits). This has
> > *huge* performance implications, but the issue is treated as some OO
> > design 101 class, with the focus on how to force everything into a
> > simple inheritance structure, numerics be damned.
> >
> > I would gladly help with the feedback when I can. Ajo and I provided
> > code for adaptive integration, yet the whole issue was completely
> > ignored. So I am not sure how much effort is required for the
> > developers to take an idea or mostly completed code and make a change,
> > rather than reject even the most basic numerical approaches that are
> > taught in introduction classes as something that needs to be
> > benchmarked.
>
> As usual, you are mixing everything, from algorithms to implementations,
> from proposing new features to denigrating existing ones (with non-existent
> or inappropriate use-cases), from numerical to efficiency considerations...
> [On top of it, you blatantly affirm that this issue has been ignored, even
> as I provided[1] an analysis[2] of what was actually happening.
> People like you seem to ignore that we work benevolently on this project!]
> Not even speaking of derogatory remarks like "sweeping [...] under the rug"
> and "not thought out" and insinuating that everything was better and more
> efficient before. Which is simply not true.
>
> It's an asymmetrical discussion because you declare that half-baked code
> is good enough and _we_ have to work even more than if we'd have to
> implement the feature from scratch.
>
>
> Gilles
>
> [1] In the spare time I do _not_ have either.
> [2] Which dragged me to the implementation of the Gauss-Hermite quadrature
> scheme (although I had no personal use of it), which seems to be the
> appropriate way to deal with the improper integral reported in the
> issue which you refer to.
>
>
> ---------------------------------------------------------------------
> 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] Cleaning up the curve fitters
Posted by "Roger L. Whitcomb" <Ro...@actian.com>.
As an outsider listening to these discussions, it seems like:
a) *IF* there are problems with the current arrangement of packages, APIs, or whatever, then a constructive approach would be for the one who sees such problems to take the time to not just criticize and point out "flaws", but to dig in and rearrange the packages, redo the APIs, provide unit tests, and submit a patch with these changes, along with quantitative justification, benchmarks, test cases, etc. It is quite easy to criticize, from the sidelines, the one who is actually doing the work, but quite another matter to roll up your sleeves and join in the work....
b) Since Math is a "library", it seems like there needs to be implementations of many different algorithms, since (quite clearly) not every algorithm is suited to every problem. To say that X method doesn't work well for problem Y, is not necessarily a reason to rewrite X method, if that method is correctly implementing the algorithm. Maybe the algorithm is simply not the right one to use for the problem.
c) Comments that imply (or state outright) that someone who has (clearly) done a lot of work has done it "...without much thinking..." are clearly out of line. In my experience, the only reason to resort to name calling and character assassination is because one has no worthy arguments to put forward.
d) Kudos to the Commons committers who have been doing the work ...
My 2 cents...
~Roger Whitcomb
Apache Pivot PMC Chair
-----Original Message-----
From: Gilles [mailto:gilles@harfang.homelinux.org]
Sent: Thursday, July 18, 2013 9:35 AM
To: dev@commons.apache.org
Subject: Re: [Math] Cleaning up the curve fitters
On Thu, 18 Jul 2013 11:47:03 -0400, Konstantin Berlin wrote:
> I appreciate the comment. I would like to help, but currently my
> schedule is full. Maybe towards the end of the year.
>
> I think the first approach should be do no harm. The optimization
> package keeps getting refactored every few months without much
> thinking involved. We had the discuss previously, with Gilles
> unilaterally deciding on the current tree, which he now wants to
> change again.
As I said,
as Luc said,
as Phil said,
again and again and again,
we are not optimization (as a scientific field) experts here, but we do use Commons Math in scientific code that is pretty compute intensive (and yes, maybe not in the same sense as you'd like it to be for your comfort).
Current code has, and may still have problems, but we see them only through running unit tests, running our applications, running code examples submitted by issue reporters.
We improve what we can, given time and motivation constraints.
Other than that, there is nothing.
Yes, we already had that asymmetrical conversation where _you_ declare what _we_ should do.
> As someone who uses optimization regular I would say the current API
> state (not just package naming) leaves a lot to be desired, and is not
> amenable to the various modification that people might need for larger
> problems. So if you are going to modify it, you should at least open
> up the API to the possibility that different optimization steps can be
> done using various techniques, depending on the problem.
>
> We should also accept that not everything can fit neatly into a
> package tree and a single set of APIs. A good example is least
> squares. Linear least squares does not require an initial guess at a
> solution, and by performing decomposition ahead of time you can
> quickly recompute the solution given different input values. However,
> an iterative least squares method might not have these properties.
> There are probably countless of other examples.
>
> Because optimization problems are really computationally hard all the
> little specific differences matter, that is why Gilles approach of
> sweeping everything under the rug and into some rigid not thought out
> hierarchical API forces these methods to adapt (or drop) numerical
> aspects that should not be there (e.x. polynomial fits). This has
> *huge* performance implications, but the issue is treated as some OO
> design 101 class, with the focus on how to force everything into a
> simple inheritance structure, numerics be damned.
>
> I would gladly help with the feedback when I can. Ajo and I provided
> code for adaptive integration, yet the whole issue was completely
> ignored. So I am not sure how much effort is required for the
> developers to take an idea or mostly completed code and make a change,
> rather than reject even the most basic numerical approaches that are
> taught in introduction classes as something that needs to be
> benchmarked.
As usual, you are mixing everything, from algorithms to implementations, from proposing new features to denigrating existing ones (with non-existent or inappropriate use-cases), from numerical to efficiency considerations...
[On top of it, you blatantly affirm that this issue has been ignored, even as I provided[1] an analysis[2] of what was actually happening.
People like you seem to ignore that we work benevolently on this project!] Not even speaking of derogatory remarks like "sweeping [...] under the rug"
and "not thought out" and insinuating that everything was better and more efficient before. Which is simply not true.
It's an asymmetrical discussion because you declare that half-baked code is good enough and _we_ have to work even more than if we'd have to implement the feature from scratch.
Gilles
[1] In the spare time I do _not_ have either.
[2] Which dragged me to the implementation of the Gauss-Hermite quadrature
scheme (although I had no personal use of it), which seems to be the
appropriate way to deal with the improper integral reported in the
issue which you refer to.
---------------------------------------------------------------------
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] Cleaning up the curve fitters
Posted by Gilles <gi...@harfang.homelinux.org>.
On Thu, 18 Jul 2013 11:47:03 -0400, Konstantin Berlin wrote:
> I appreciate the comment. I would like to help, but currently my
> schedule is full. Maybe towards the end of the year.
>
> I think the first approach should be do no harm. The optimization
> package keeps getting refactored every few months without much
> thinking involved. We had the discuss previously, with Gilles
> unilaterally deciding on the current tree, which he now wants to
> change again.
As I said,
as Luc said,
as Phil said,
again and again and again,
we are not optimization (as a scientific field) experts here,
but we do use Commons Math in scientific code that is pretty compute
intensive (and yes, maybe not in the same sense as you'd like it to
be for your comfort).
Current code has, and may still have problems, but we see them only
through running unit tests, running our applications, running
code examples submitted by issue reporters.
We improve what we can, given time and motivation constraints.
Other than that, there is nothing.
Yes, we already had that asymmetrical conversation where _you_ declare
what _we_ should do.
> As someone who uses optimization regular I would say the current API
> state (not just package naming) leaves a lot to be desired, and is
> not
> amenable to the various modification that people might need for
> larger
> problems. So if you are going to modify it, you should at least open
> up the API to the possibility that different optimization steps can
> be
> done using various techniques, depending on the problem.
>
> We should also accept that not everything can fit neatly into a
> package tree and a single set of APIs. A good example is least
> squares. Linear least squares does not require an initial guess at a
> solution, and by performing decomposition ahead of time you can
> quickly recompute the solution given different input values. However,
> an iterative least squares method might not have these properties.
> There are probably countless of other examples.
>
> Because optimization problems are really computationally hard all the
> little specific differences matter, that is why Gilles approach of
> sweeping everything under the rug and into some rigid not thought out
> hierarchical API forces these methods to adapt (or drop) numerical
> aspects that should not be there (e.x. polynomial fits). This has
> *huge* performance implications, but the issue is treated as some OO
> design 101 class, with the focus on how to force everything into a
> simple inheritance structure, numerics be damned.
>
> I would gladly help with the feedback when I can. Ajo and I provided
> code for adaptive integration, yet the whole issue was completely
> ignored. So I am not sure how much effort is required for the
> developers to take an idea or mostly completed code and make a
> change,
> rather than reject even the most basic numerical approaches that are
> taught in introduction classes as something that needs to be
> benchmarked.
As usual, you are mixing everything, from algorithms to
implementations,
from proposing new features to denigrating existing ones (with
non-existent or inappropriate use-cases), from numerical to efficiency
considerations...
[On top of it, you blatantly affirm that this issue has been ignored,
even as I provided[1] an analysis[2] of what was actually happening.
People like you seem to ignore that we work benevolently on this
project!]
Not even speaking of derogatory remarks like "sweeping [...] under the
rug"
and "not thought out" and insinuating that everything was better and
more
efficient before. Which is simply not true.
It's an asymmetrical discussion because you declare that half-baked
code is good enough and _we_ have to work even more than if we'd have
to implement the feature from scratch.
Gilles
[1] In the spare time I do _not_ have either.
[2] Which dragged me to the implementation of the Gauss-Hermite
quadrature
scheme (although I had no personal use of it), which seems to be
the
appropriate way to deal with the improper integral reported in the
issue which you refer to.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org
Re: [Math] Cleaning up the curve fitters
Posted by Konstantin Berlin <kb...@gmail.com>.
I appreciate the comment. I would like to help, but currently my schedule is full. Maybe towards the end of the year.
I think the first approach should be do no harm. The optimization package keeps getting refactored every few months without much thinking involved. We had the discuss previously, with Gilles unilaterally deciding on the current tree, which he now wants to change again.
As someone who uses optimization regular I would say the current API state (not just package naming) leaves a lot to be desired, and is not amenable to the various modification that people might need for larger problems. So if you are going to modify it, you should at least open up the API to the possibility that different optimization steps can be done using various techniques, depending on the problem.
We should also accept that not everything can fit neatly into a package tree and a single set of APIs. A good example is least squares. Linear least squares does not require an initial guess at a solution, and by performing decomposition ahead of time you can quickly recompute the solution given different input values. However, an iterative least squares method might not have these properties. There are probably countless of other examples.
Because optimization problems are really computationally hard all the little specific differences matter, that is why Gilles approach of sweeping everything under the rug and into some rigid not thought out hierarchical API forces these methods to adapt (or drop) numerical aspects that should not be there (e.x. polynomial fits). This has *huge* performance implications, but the issue is treated as some OO design 101 class, with the focus on how to force everything into a simple inheritance structure, numerics be damned.
I would gladly help with the feedback when I can. Ajo and I provided code for adaptive integration, yet the whole issue was completely ignored. So I am not sure how much effort is required for the developers to take an idea or mostly completed code and make a change, rather than reject even the most basic numerical approaches that are taught in introduction classes as something that needs to be benchmarked.
Here are some helpful webpages on optimization
http://plato.asu.edu/sub/pns.html
http://www.neos-guide.org/optimization-tree
On Jul 18, 2013, at 10:33 AM, Phil Steitz <ph...@gmail.com> wrote:
> On 7/18/13 7:12 AM, Patrick Meyer wrote:
>>> You have done a pretty good job in making the optimization package
>> non-sensical to user.
>>
>> +1
>
> We have definitely struggled with the design of the optimization
> package. It would be great if we could get to a stable API for 4.0
> onwards. If you guys are willing to help get to a structure that
> makes sense from a user's perspective, we are all ears. If you
> have time to help make or at least fully think through the changes
> necessary to get there, that would be most appreciated.
>
> I am not an optimization expert. I do know, however, that what we
> are dealing with in this package is well-understood theoretically.
> We should listen carefully to those who have the knowledge and
> background to help. And those providing the "help" should be
> patient and provide references (online, wherever possible) that we
> can use to get to a common understanding of the mathematical
> principles and terminology involved.
>
> We all want the same thing here - a high-quality library that is
> both maintainable and easy to use. We are all volunteers with
> limited time and of course limited knowledge. Lets work together on
> this.
>
> 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
>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org
Re: [Math] Cleaning up the curve fitters
Posted by Phil Steitz <ph...@gmail.com>.
On 7/18/13 7:12 AM, Patrick Meyer wrote:
>> You have done a pretty good job in making the optimization package
> non-sensical to user.
>
> +1
We have definitely struggled with the design of the optimization
package. It would be great if we could get to a stable API for 4.0
onwards. If you guys are willing to help get to a structure that
makes sense from a user's perspective, we are all ears. If you
have time to help make or at least fully think through the changes
necessary to get there, that would be most appreciated.
I am not an optimization expert. I do know, however, that what we
are dealing with in this package is well-understood theoretically.
We should listen carefully to those who have the knowledge and
background to help. And those providing the "help" should be
patient and provide references (online, wherever possible) that we
can use to get to a common understanding of the mathematical
principles and terminology involved.
We all want the same thing here - a high-quality library that is
both maintainable and easy to use. We are all volunteers with
limited time and of course limited knowledge. Lets work together on
this.
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
Re: [Math] Cleaning up the curve fitters
Posted by Patrick Meyer <me...@gmail.com>.
My vote was not directed toward the technical merits of the optimization
package. I am not an expert on optimization and I trust you in this regard.
My vote was a comment on the usability of the API. I find it to be
increasing difficult to use.
Maybe I have missed some refactoring, but why all of the depreicated
classes like
On Thu, Jul 18, 2013 at 10:58 AM, Gilles <gi...@harfang.homelinux.org>wrote:
> You have done a pretty good job in making the optimization package
>>> non-sensical to user.
>>>
>>
>> +1
>>
>>
> Check your facts ("svn log", JIRA, this ML), please: All modifications
> were done in plain sight, and responded to identified problems which
> I cared to solve.
> I do not deny that it could have raised issues for cases which I did
> not foresee. But all the requests for clearly defined
> use-cases,
> benchmarks,
> actual (i.e. working) code examples,
> have been met with unhelpful "do it yourself" statements.[1]
>
> Whatever we try here, including going somewhat in the direction you
> suggested for singling out algorithms aimed at solving a (non-linear)
> "leastsquares" problem:[2]
> http://markmail.org/message/**nkceta2cskpgbkug<http://markmail.org/message/nkceta2cskpgbkug>
> raises unsubstantiated criticism that never[3] translated into
> _practical_ advice[4] on how to improve the code.
>
>
> Gilles
>
> [1] What _I_ observed and used led me to try out what I think are
> improvements. I you think otherwise, _you_ have to get your hands
> dirty too.
> [2] Except that, at this point, it makes more sense for me, as a user,
> to put it under (model) "fitting" rather than "optim", for the
> reason I gave previously.
> [3] And that means: NEVER.
> [4] That is: an alternative Java code that compiles, runs and produces
> correct answers.
>
>
>
> ------------------------------**------------------------------**---------
> To unsubscribe, e-mail: dev-unsubscribe@commons.**apache.org<de...@commons.apache.org>
> For additional commands, e-mail: dev-help@commons.apache.org
>
>
RE: [Math] Cleaning up the curve fitters
Posted by Gilles <gi...@harfang.homelinux.org>.
>> You have done a pretty good job in making the optimization package
>> non-sensical to user.
>
> +1
>
Check your facts ("svn log", JIRA, this ML), please: All modifications
were done in plain sight, and responded to identified problems which
I cared to solve.
I do not deny that it could have raised issues for cases which I did
not foresee. But all the requests for clearly defined
use-cases,
benchmarks,
actual (i.e. working) code examples,
have been met with unhelpful "do it yourself" statements.[1]
Whatever we try here, including going somewhat in the direction you
suggested for singling out algorithms aimed at solving a (non-linear)
"leastsquares" problem:[2]
http://markmail.org/message/nkceta2cskpgbkug
raises unsubstantiated criticism that never[3] translated into
_practical_ advice[4] on how to improve the code.
Gilles
[1] What _I_ observed and used led me to try out what I think are
improvements. I you think otherwise, _you_ have to get your hands
dirty too.
[2] Except that, at this point, it makes more sense for me, as a user,
to put it under (model) "fitting" rather than "optim", for the
reason I gave previously.
[3] And that means: NEVER.
[4] That is: an alternative Java code that compiles, runs and produces
correct answers.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org
RE: [Math] Cleaning up the curve fitters
Posted by Patrick Meyer <me...@gmail.com>.
>You have done a pretty good job in making the optimization package
non-sensical to user.
+1
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org
Re: [Math] Cleaning up the curve fitters
Posted by Konstantin Berlin <kb...@gmail.com>.
Hi,
Bringing up points with you never leads anywhere since you refuse accept that your proposal might have issues, and as a last result you always bring out the "Examples Benchmarks" red herring, since it has nothing to do with the logical problems of your proposal. Since you work on commons projects, why don't you present benchmarks that say I am wrong, since clearly I presented why theoretically what you want is problematic.
You have done a pretty good job in making the optimization package non-sensical to user. We had a long discussion about this with pretty much everyone complaining but you. But for some reason you decided unilaterally that your opinion about package organization is correct.
If you think your GW method is terrible and it never works better LV why do you have it in the library? To trip up users?
You proposed a change. I just gave you about several reasons why it shouldn't be done without further thinking, yet somehow you feel that it is not enough. I guess you will do whatever you wanted to do anyways, but I would hope you listen to what I just said.
On Jul 18, 2013, at 9:34 AM, Gilles <gi...@harfang.homelinux.org> wrote:
> On Thu, 18 Jul 2013 09:16:46 -0400, Konstantin Berlin wrote:
>> Hi,
>>
>> I have two points on this
>> 1) See issue MATH-1009
>
> This is not directly related to my question (about cleanup of
> _existing_ code); it should thus be discussed in another thread.
>
>> 2) If LM was always better there would be no GuassNewton. Clearly
>> this is not the case.
>> LM is a mixture between GN and steepest descent, so it is only faster
>> for "tougher" functions. In case of strictly convex function GN should
>> be a good amount faster.
>
> Examples?
> Benchmarks?
> [Currently there aren't any unit tests showing the advantage for
> "GaussNewtonOptimizer". Contributions to this effect are most welcome.]
>
>> So the correct method depends on the problem.
>> Clearly for some of the fitters you know if the problem is well
>> behaved, so they should use GN, for the general method you cannot say.
>
> If we know in advance the best method for a given curve fitter (among those
> instantiated in package "o.a.c.m.fitting", then we could maybe "parameterize"
> the optimizer to be used (e.g. through an abstract method "createOptimizer()".
> It would still be transparent to the users.
>
>> I think you can easily benchmark if this is the case.
>
> I don't understand what this means.
>
> Gilles
>
>>
>>
>> On Jul 17, 2013, at 11:16 AM, Gilles <gi...@harfang.homelinux.org> wrote:
>>
>>> Hello.
>>>
>>> Constructors of classes in the "o.a.c.m.fitting" are instantiated using
>>> an (abstract) "MultivariateVectorOptimizer". The only concrete
>>> implementations of this class are
>>> * LevenbergMarquardtOptimizer
>>> * GaussNewtonOptimizer
>>> [I.e. the API suggests that the Jacobian is not necessary for
>>> some optimizers but no such (vector) optimizer exists currently.
>>> Anyways the Jacobian is computed automatically (in inner class
>>> "CurveFitter.TheoreticalValuesFunction") so that an optimizer
>>> without derivatives is never necessary...]
>>>
>>> Observing that
>>> 1. almost all the unit tests for the fitters use an instance of
>>> "LevenbergMarquardtOptimizer",
>>> 2. some comments in the "GaussNewtonOptimizerTest" unit test class makes
>>> one wonder when "GaussNewtonOptimizer" should actually be preferred
>>> over "LevenbergMarquardtOptimizer",
>>> I would propose to deprecate the non-default constructors in all fitter
>>> classes (and let the fitting be transparently performed with an instance
>>> of "LevenbergMarquardtOptimizer").
>>>
>>> Any objection?
>>>
>>>
>>> Regards,
>>> 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] Cleaning up the curve fitters
Posted by Gilles <gi...@harfang.homelinux.org>.
On Thu, 18 Jul 2013 09:16:46 -0400, Konstantin Berlin wrote:
> Hi,
>
> I have two points on this
> 1) See issue MATH-1009
This is not directly related to my question (about cleanup of
_existing_ code); it should thus be discussed in another thread.
> 2) If LM was always better there would be no GuassNewton. Clearly
> this is not the case.
> LM is a mixture between GN and steepest descent, so it is only faster
> for "tougher" functions. In case of strictly convex function GN
> should
> be a good amount faster.
Examples?
Benchmarks?
[Currently there aren't any unit tests showing the advantage for
"GaussNewtonOptimizer". Contributions to this effect are most welcome.]
> So the correct method depends on the problem.
> Clearly for some of the fitters you know if the problem is well
> behaved, so they should use GN, for the general method you cannot
> say.
If we know in advance the best method for a given curve fitter (among
those
instantiated in package "o.a.c.m.fitting", then we could maybe
"parameterize"
the optimizer to be used (e.g. through an abstract method
"createOptimizer()".
It would still be transparent to the users.
> I think you can easily benchmark if this is the case.
I don't understand what this means.
Gilles
>
>
> On Jul 17, 2013, at 11:16 AM, Gilles <gi...@harfang.homelinux.org>
> wrote:
>
>> Hello.
>>
>> Constructors of classes in the "o.a.c.m.fitting" are instantiated
>> using
>> an (abstract) "MultivariateVectorOptimizer". The only concrete
>> implementations of this class are
>> * LevenbergMarquardtOptimizer
>> * GaussNewtonOptimizer
>> [I.e. the API suggests that the Jacobian is not necessary for
>> some optimizers but no such (vector) optimizer exists currently.
>> Anyways the Jacobian is computed automatically (in inner class
>> "CurveFitter.TheoreticalValuesFunction") so that an optimizer
>> without derivatives is never necessary...]
>>
>> Observing that
>> 1. almost all the unit tests for the fitters use an instance of
>> "LevenbergMarquardtOptimizer",
>> 2. some comments in the "GaussNewtonOptimizerTest" unit test class
>> makes
>> one wonder when "GaussNewtonOptimizer" should actually be
>> preferred
>> over "LevenbergMarquardtOptimizer",
>> I would propose to deprecate the non-default constructors in all
>> fitter
>> classes (and let the fitting be transparently performed with an
>> instance
>> of "LevenbergMarquardtOptimizer").
>>
>> Any objection?
>>
>>
>> Regards,
>> Gilles
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org
Re: [Math] Cleaning up the curve fitters
Posted by Konstantin Berlin <kb...@gmail.com>.
Hi,
I have two points on this
1) See issue MATH-1009
2) If LM was always better there would be no GuassNewton. Clearly this is not the case.
LM is a mixture between GN and steepest descent, so it is only faster for "tougher" functions. In case of strictly convex function GN should be a good amount faster. So the correct method depends on the problem. Clearly for some of the fitters you know if the problem is well behaved, so they should use GN, for the general method you cannot say. I think you can easily benchmark if this is the case.
On Jul 17, 2013, at 11:16 AM, Gilles <gi...@harfang.homelinux.org> wrote:
> Hello.
>
> Constructors of classes in the "o.a.c.m.fitting" are instantiated using
> an (abstract) "MultivariateVectorOptimizer". The only concrete
> implementations of this class are
> * LevenbergMarquardtOptimizer
> * GaussNewtonOptimizer
> [I.e. the API suggests that the Jacobian is not necessary for
> some optimizers but no such (vector) optimizer exists currently.
> Anyways the Jacobian is computed automatically (in inner class
> "CurveFitter.TheoreticalValuesFunction") so that an optimizer
> without derivatives is never necessary...]
>
> Observing that
> 1. almost all the unit tests for the fitters use an instance of
> "LevenbergMarquardtOptimizer",
> 2. some comments in the "GaussNewtonOptimizerTest" unit test class makes
> one wonder when "GaussNewtonOptimizer" should actually be preferred
> over "LevenbergMarquardtOptimizer",
> I would propose to deprecate the non-default constructors in all fitter
> classes (and let the fitting be transparently performed with an instance
> of "LevenbergMarquardtOptimizer").
>
> Any objection?
>
>
> Regards,
> 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] Cleaning up the curve fitters
Posted by Konstantin Berlin <kb...@gmail.com>.
Hi,
Am I missing something? Why is a linear least squares problem (fitting constants of basis functions) being solved using a non-linear least squares solver in the first place?
On Jul 17, 2013, at 11:16 AM, Gilles <gi...@harfang.homelinux.org> wrote:
> Hello.
>
> Constructors of classes in the "o.a.c.m.fitting" are instantiated using
> an (abstract) "MultivariateVectorOptimizer". The only concrete
> implementations of this class are
> * LevenbergMarquardtOptimizer
> * GaussNewtonOptimizer
> [I.e. the API suggests that the Jacobian is not necessary for
> some optimizers but no such (vector) optimizer exists currently.
> Anyways the Jacobian is computed automatically (in inner class
> "CurveFitter.TheoreticalValuesFunction") so that an optimizer
> without derivatives is never necessary...]
>
> Observing that
> 1. almost all the unit tests for the fitters use an instance of
> "LevenbergMarquardtOptimizer",
> 2. some comments in the "GaussNewtonOptimizerTest" unit test class makes
> one wonder when "GaussNewtonOptimizer" should actually be preferred
> over "LevenbergMarquardtOptimizer",
> I would propose to deprecate the non-default constructors in all fitter
> classes (and let the fitting be transparently performed with an instance
> of "LevenbergMarquardtOptimizer").
>
> Any objection?
>
>
> Regards,
> 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