RE: [PEAR-DEV] New package proposal: Math_Calculus
| From: | Lukasz Karapuda | Date: | Mon, 19 May 2003 22:57:07 +0000 |
| Subject: | RE: [PEAR-DEV] New package proposal: Math_Calculus | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-16482@lists.php.net to get a copy of this message | ||
Jesus,
The site www.phpmath.com is still a BETA release, so don't expect to
find there too much stuff at the moment. I do agree that PEAR coding
standards, as well as phpDocumentor compatible inline documentation
should be used. However at this point it's difficult to enforce this,
because other admins are not exactly concerned with the format.
The reason I got very interested in this particular project is because
one of the admins had already published 2 articles on IBM developerworks
about the Regression classes, present in the toolkit. I thought that
this would be a great incentive for PHP developers to get involved.
Here are the articles:
http://www-106.ibm.com/developerworks/web/library/wa-linphp2/
http://www-106.ibm.com/developerworks/web/library/wa-linphp/
Regards,
__________________________________________
Lukasz Karapuda [ lkarap00@mercyhurst.edu ]
Mercyhurst Web Developer
Y! lukaszkarapuda
-----Original Message-----
From: Jesus M. Castagnetto [mailto:jcastagnetto@yahoo.com]
Sent: Monday, May 19, 2003 6:39 PM
To: Lukasz Karapuda; 'Johannes Schlueter'
Cc: pear-dev@lists.php.net
Subject: RE: [PEAR-DEV] New package proposal: Math_Calculus
Hi Lukasz and Johannes,
--- Lukasz Karapuda <luke@thenewline.com> wrote:
> > Overall the idea is good. The implementation needs some work. For
> example,
> > a stable and reliable differentiation package could be use to solve
> funding
> > the roots of an equations using any of the well-known methods (e.g.
> > Newton-Raphson's).
>
> If you are considering developing a reliable and complete
> differentiation package, take a look at http://www.phpmath.com.
>
Sounds interesting. A more encompasing project than the 'Numeric PHP'
(one that
I started eons ago, and now have terminated). Most of the code from that
is in
PEAR now (see the Math_* packages).
> It's a
> major effort to create a complete mathematical toolkit for PHP
(language
> based).
Went to the site, found not much information. In particular I was
expecting to
see some downloadable code. I found the autocorrelation, distribution,
and
linear regression stuff code (some of which can be factored out to other
packages, eg. Math_Stats in PEAR).
> I am one of the administrators, and currently we are looking at
> as many contributors as possible. Perhaps you could join our mailing
> list. We currently have implemented Simple Linear Regression, Matrix
> Operations and Linear Algebra.
I did not see any matrix operations code (see PEAR::Math_Matrix). Also,
it
would be a good idea to use the PEAR Code Standards, for both the actual
PHP
code and the code documentation. Also, you might consider creating a
package.xml so the classes can be installed using the PEAR installer.
Finally, why not consider to create a series of Math_* classes that can
be
included/integrated in PEAR. Having a team of maintainers that can be
grouped
under the phpmath.com site would be great, that way the code will be
better and
the errors/bugs fewer. This can be done in two ways, by adding the
packages as
they are approved to PEAR's CVS, or by keeping the code in a separate
CVS and
releasing them via PEAR, or both ;-)
>
> Best Regards,
>
> __________________________________________
> Lukasz Karapuda [ lkarap00@mercyhurst.edu ]
> Mercyhurst Web Developer
> Y! lukaszkarapuda
>
>
> -----Original Message-----
> From: Johannes Schlueter [mailto:phpng@schlueters.de]
> Sent: Saturday, May 17, 2003 10:03 AM
> To: Jesus M. Castagnetto
> Cc: pear-dev@lists.php.net
> Subject: Re: [PEAR-DEV] New package proposal: Math_Calculus
>
> On Friday 16 May 2003 23:45, you wrote:
> > The class looks OK for simple functions withouth many singular
points.
> > As it stands now, I would not recommend its inclusion in PEAR: -1
>
> Ok.
>
> > 1) The name of the class: Perhaps you will be better of having 2 or
> more
> > Math_Numerical_Differentiation, Math_Numerical_Integration, etc. Or
> how
> > about a Math_Numerical (or Math_NumericalMethod or
> Math_NumericalSolution?)
> > class that works as facade to the ones implementing the algorithms?
>
> Math_Numerical looks good, but then we need many method's with it, but
> I'll
> look how I can implement all useful Numerical Alogrithms with PHP ;-)
>
> > 2) The implementation of your differentiation function, if you are
> handed a
> > non-continuous function, then you will be in trouble using the
simple
> > approach, w/o previously testing for continuity in the interval
where
> you
>
> Yes, that's true. The version I posted was the work of very few hours,
> just
> for solving a problem I had. Therefore it worked. Then I saw there's
no
> such
> thing for PEAR so I wrote some comments to see the reactions, imho it
> don't
> make sense spending hours of work if nobody wants it ;-)
>
> > are calculating the derivative. A look at:
> > http://lib-www.lanl.gov/numerical/index.html, and in
> > particular at:
> > http://lib-www.lanl.gov/numerical/bookfpdf/f5-7.pdf, will
> > surely
help
> in
> > this respect. Might also need to be careful not to generate an
> floating
> > point overflow.
>
> The links look really interesting. All have a closer look over these
an
> improve my code.
>
> > 3) The implementation of the Romberg's integration method tries to
> minimize
> > errors by using iterations of the trapezoidal rule. But for
analytical
> > functions, you might be better using other approaches.
>
> Romberg'smethod was the one I've found most implementations for and
the
> one
> I've understood easily ;-)
>
> > 4) The method that finds point of a function where the derivative is
> zero
> > is OK, but it is of no use if it is not coupled with one that find
the
> > extrema (minima and maxima). Also, if might be better named
> > findZeroDerivative() instead. Of course you will need to define a
> second
> > derivative method for the extrema.
>
> Yes...
>
> > Overall the idea is good. The implementation needs some work. For
> example,
> > a stable and reliable differentiation package could be use to solve
> funding
> > the roots of an equations using any of the well-known methods (e.g.
> > Newton-Raphson's).
> >
> > The URL mentioned above has a lot of great numerical recipes. And as
> we
> > cannot add GSL to PECL due to licensing conflicts, perhaps
> implementing
> > them in PHP would be nice.
>
> If I'm going to implement all of them I'll never be bored again. And
if
> I'm
> still bored I can implement it using BCMath, GMP and PEAR
Math_Complex.
> ;-)
>
> johannes
>
=====
--- Jesus M. Castagnetto (jcastagnetto@yahoo.com)
Research:
http://metallo.scripps.edu/
Personal: http://www.castagnetto.org/
__________________________________
Do you Yahoo!?
The New Yahoo! Search - Faster. Easier. Bingo.
http://search.yahoo.com