Re: [Numpy-discussion] Suggestions for GSoC Projects
sp.hyp2f1(10,5,-300.5,0.5) -6.5184949735e+156 The present implementation of the function in scipy, involves one Euler Transform followed by the application of Power Series (as a and b turn negative after Euler Transform is applied once). This most probably blows up the values of function as |c||a| or |b|. In one of the attempts to debug this the function hyp2f1 (when c0; a,b0; |c|a,b) was made to call hys2f1 (power series) without Euler Transformation. The result was the same as what mpmath gives when the precision is less (~100), as the error tolerance for hys2f1 is high. (MACHEP of order 10^-17). On increasing the sensitivity by changing the local tolerance to the order of 10^-200, it works perfect. What are the implications of adopting this method in the cases where hyp2f1 fails to give accurate results? Except of course the fact that this implementation would be heavy. Our current hyp2f1 implementation does use recurrences (hyp2f1ra), but perhaps they are not invoked for this case. The problem here can be the accurate determination of the convergence region for each parameter value. The straight-forwardness of power series and its resemblance to mpmath tempted me to first try with hys2f1, However I have a strong feeling that owing to strong sensitivity of recurrence function in general, the implementation will be much faster. However direct implementation without a change in sensitivity fails to give the required answer. Regards Jenny -- Pauli Virtanen ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion
Re: [Numpy-discussion] Suggestions for GSoC Projects
In an attempt to analyze the accuracy of hyp2f1, Different cases mentioned in Abramowitz ( http://people.math.sfu.ca/~cbm/aands/page_561.htmhttp://bl-1.com/click/load/UmcPPANhUGxVMQNuUGU-b0231 ) and also in the Thesis on 'Computation of Hypergeometric functions (http://people.maths.ox.ac.uk/porterm/research/pearson_final.pdfhttp://bl-1.com/click/load/VmMBMlw-b0221ADxRNVI-b0169BDY-b0231, pg 65-66) were tried out, and the function fails without warning when: c0, c is not integral |c||a| and |b| For example: sp.hyp2f1(10,5,-300.5,0.5) -6.5184949735e+156 while the answer is *-3.8520770815e+32* this case appears to filter down to hys2f1 in the source code (scipy.special.cephes.hyp2f1) I tried the same input in mpmath to check if it works there: hyp2f1(10,5,-300.5,0.5) mpf('0.9211827166328477893913199888') which is the solution when we apply power series expansion. however MATLAB succeeds in giving the required solution. Another interesting fact is that of the methods mentioned in the thesis: Taylor series expansion, fraction method with double precision, Gauss-Jacobi method and RK4), none succeeds in the given case. I don't have any idea how the function itself is evaluated in the given case. Any leads on how it is done and how MATLAB executes it? On Thu, Feb 20, 2014 at 1:16 AM, Jennifer stone jenny.stone...@gmail.comwrote: If you are interested in the hypergeometric numerical evaluation, it's probably a good idea to take a look at this recent master's thesis written on the problem: http://people.maths.ox.ac.uk/porterm/research/pearson_final.pdfhttp://bl-1.com/click/load/BDEKOABvUWAAYgNhATc-b0231 The thesis is really comprehensive and detailed with quite convincing conclusions on the methods to be used with varying a,b,x (though I am yet to read the thesis properly enough understand and validate each of the multitude of the cases for the boundaries for the parameters). It seems to be an assuring and reliable walk through for the project. This may give some systematic overview on the range of methods available. (Note that for copyright reasons, it's not a good idea to look closely at the source codes linked from that thesis, as they are not available under a compatible license.) It may well be that the best approach for evaluating these functions, if accuracy in the whole parameter range is wanted, in the end turns out to require arbitrary-precision computations. In that case, it would be a very good idea to look at how the problem is approached in mpmath. There are existing multiprecision packages written in C, and using one of them in scipy.special could bring better evaluation performance even if the algorithm is the same. Yeah, this seems to be brilliant idea. mpmath too, I assume, must have used some of the methods mentioned in the thesis. I ll look through the code and get back. I am still unaware of the complexity of project expected at GSoC. This project looks engaging to me. Will an attempt to improve both Spherical harmonic functions ( improving the present algorithm to avoid the calculation for lower n's and m's) and hypergeometric functions be too ambitious or is it doable? Regards Jennifer -- Pauli Virtanen ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion
Re: [Numpy-discussion] GSOC
https://wiki.python.org/moin/SummerOfCode/2014 The link provided by Josef is yet to list SciPy/NumPy under it. Somebody please contact Terri. That page acts as major guiding factor for Python-GSoC prospective students. Please have SciPy listed there. ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion
Re: [Numpy-discussion] Suggestions for GSoC Projects
If you are interested in the hypergeometric numerical evaluation, it's probably a good idea to take a look at this recent master's thesis written on the problem: http://people.maths.ox.ac.uk/porterm/research/pearson_final.pdfhttp://bl-1.com/click/load/BDEKOABvUWAAYgNhATc-b0231 The thesis is really comprehensive and detailed with quite convincing conclusions on the methods to be used with varying a,b,x (though I am yet to read the thesis properly enough understand and validate each of the multitude of the cases for the boundaries for the parameters). It seems to be an assuring and reliable walk through for the project. This may give some systematic overview on the range of methods available. (Note that for copyright reasons, it's not a good idea to look closely at the source codes linked from that thesis, as they are not available under a compatible license.) It may well be that the best approach for evaluating these functions, if accuracy in the whole parameter range is wanted, in the end turns out to require arbitrary-precision computations. In that case, it would be a very good idea to look at how the problem is approached in mpmath. There are existing multiprecision packages written in C, and using one of them in scipy.special could bring better evaluation performance even if the algorithm is the same. Yeah, this seems to be brilliant idea. mpmath too, I assume, must have used some of the methods mentioned in the thesis. I ll look through the code and get back. I am still unaware of the complexity of project expected at GSoC. This project looks engaging to me. Will an attempt to improve both Spherical harmonic functions ( improving the present algorithm to avoid the calculation for lower n's and m's) and hypergeometric functions be too ambitious or is it doable? Regards Jennifer -- Pauli Virtanen ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion
Re: [Numpy-discussion] Suggestions for GSoC Projects
On Wed, Feb 12, 2014 at 2:11 AM, Pauli Virtanen p...@iki.fi wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi It's not so often someone wants to work on scipy.special, so you'd be welcome to improve it :) That's great! Thanks a lot for your guidance. . - Spherical harmonics might be a reasonable part of a GSoC proposal. However, note that there exists also a *second* Legendre polynomial function `lpmv`, which doesn't store the values of the previous N functions. There's one numerical problem in the current way of evaluation via ~Pmn(cos(theta)), which is that this approach seems to lose relatively much precision at large orders for certain values of theta. I don't recall now exactly how imprecise it becomes at large orders, but it may be necessary to check. I checked lpmv and lpmn. As you rightly said, lpmv avoids the storage of values small N's by using recursion. Why can't we first check if m and n are n positive integers and pass them to lpmv itself rather than lpmn? lpmn does give us the derivatives too, but sph_harm has no need for that, and of course all the values for m and n too are trimmed. What is the benefit of lpmn over lpmv at present? Adding new special functions also sounds like an useful project. Here, it helps if they are something that you expect you will need later on :) I am unable to think beyond ellipsoidal functions. As for their use, we as students used them in problems of thermal equilibrium in ellipsoidal bodies, and some scattering cases. Though I have no idea if its use in general is quite prominent. And cylindrical harmonic function would be useful but I feel it's quite straight forward to implement (correct me if I am wrong) . There's also the case that several of the functions in Scipy have only implementations for real-valued inputs, although the functions would be defined on the whole complex plane. A list of the situation is here: https://github.com/scipy/scipy/blob/master/scipy/special /generate_ufuncs.py#L85 Lowercase d correspond to real-valued implementations, uppercase D to complex-valued. I'm not at the moment completely sure which would have the highest priority --- whether you need this or not really depends on the application. If you want additional ideas about possible things to fix in scipy.special, take a look at this file: https://github.com/scipy/scipy/blob/master/scipy/special/tests /test_mpmath.py#L648 The entries marked @knownfailure* have some undiagnosed issues in the implementation, which might be useful to look into. However: most of these have to do with corner cases in hypergeometric functions. Trying to address those is likely a risky GSoC topic, as the multi-argument hyp* functions are challenging to evaluate in floating point. (mpmath and Mathematica can evaluate them in most parameter regimes, but AFAIK both require arbitrary-precision methods for this.) Yeah, many of the known failures seem to revolve around hyp2f1. An unexplained inclination towards hypergeometric functions really tempts me to plunge into this. If it's too risky, I can work on this after the summers, as I would have gained quite a lot of experience with the code here. So I think there would be a large number of possible things to do here, and help would be appreciated. - -- Pauli Virtanen -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.14 (GNU/Linux) iEYEARECAAYFAlL6iwAACgkQ6BQxb7O0pWBfOgCfYHAB12N4FWDmrqx8/ORTBRps pXYAoL3ufAiShe+0qTEGfEvrmDgr1X0p =kAwF -END PGP SIGNATURE- Regard Jennifer ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion
Re: [Numpy-discussion] GSOC
On Thu, Feb 13, 2014 at 10:18 PM, Charles R Harris charlesr.har...@gmail.com wrote: Thought I'd forward this to the lists in case we need to do something. Hi everyone, Just a friendly reminder that applications for mentoring organizations close in about 24 hours. Please get your applications in soon, we will not accept late applications for any reason! Thanks, Carol Chuck Guys, please register. People like me are eagerly looking forward to work with the organization this summer! ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion
Re: [Numpy-discussion] Suggestions for GSoC Projects
3. As stated earlier, we have spherical harmonic functions (with much scope for dev) we are yet to have elliptical and cylindrical harmonic function, which may be developed. This sounds very doable. How much work do you think would be involved? As Stefan so rightly pointed out, the function for spherical harmonic function, sph_harm at present calls lpmn thus evaluating all orders N. An initial glance at the code and the algorithm gives me a feeling that it would be very well possible to avoid that by maybe avoiding the dependence on lpmn. Further, we can introduce ellipsoidal harmonic functions of first kind and the second kind. I am confident about about the implementation of ellipsoidal H function of first kind but don't know much about the second kind. But I believe we can work it out in due course.And cylindrical harmonics can be carried out using Bessel functions. ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion
Re: [Numpy-discussion] Suggestions for GSoC Projects
On Fri, Jan 31, 2014 at 11:34 AM, Stéfan van der Walt ste...@sun.ac.zawrote: On Fri, 31 Jan 2014 04:31:01 +0530, jennifer stone wrote: 3. As stated earlier, we have spherical harmonic functions (with much scope for dev) we are yet to have elliptical and cylindrical harmonic function, which may be developed. As stated before, I am personally interested in seeing the spherical harmonics in SciPy improve. Finding a suitable mentor for whatever project Jennifer chooses is an important factor in the choice of project, so I have to ask: do you have the bandwidth to be a mentor or help out this summer? Ralf Thanks a ton Ralf, for bringing this up. It would my dream come true experience to work under any of you guys.However tough be the project, the guidance of a willing mentor shall make it a smooth and fruitful experience. Please let me know if you can help out. I would be really grateful to you. Regards ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion
[Numpy-discussion] Suggestions for GSoC Projects
With GSoC 2014 being round the corner, I hereby put up few projects for discussion that I would love to pursue as a student. Guidance, suggestions are cordially welcome:- 1. If I am not mistaken, contour integration is not supported by SciPy; in fact even line integrals of real functions is yet to be implemented in SciPy, which is surprising. Though we at present have SymPy for line Integrals, I doubt if there is any open-source python package supporting the calculation of Contour Integrals. With integrate module of SciPy already having been properly developed for definite integration, implementation of line as well as contour integrals, I presume; would not require work from scratch and shall be a challenging but fruitful project. 2. I really have no idea if the purpose of NumPy or SciPy would encompass this but we are yet to have indefinite integration. An implementation of that, though highly challenging, may open doors for innumerable other functions like the ones to calculate the Laplace transform, Hankel transform and many more. 3. As stated earlier, we have spherical harmonic functions (with much scope for dev) we are yet to have elliptical and cylindrical harmonic function, which may be developed. 4. Lastly, we are yet to have Inverse Laplace transforms which as Ralf has rightly pointed out it may be too challenging to implement. 5. Further reading the road-map given by Mr.Ralf, I would like to develop the Bluestein's FFT algorithm. Thanks for reading along till the end. I shall append to this mail as when I am struck with ideas. Please do give your valuable guidance ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion
Re: [Numpy-discussion] (no subject)
Both scipy and numpy require GSOC candidates to have a pull request accepted as part of the application process. I'd suggest implementing a function not currently in scipy that you think would be useful. That would also help in finding a mentor for the summer. I'd also suggest getting familiar with cython. Chuck Thanks a lot for the heads-up. I am yet to be familiarized with Cython and it indeed is playing a crucial role especially in the 'special' module I don't see you on github yet, are you there? If not, you should set up an account to work in. See the developer guide http://docs.scipy.org/doc/numpy/dev/for some pointers. Chuck I am present on github but the profile at present is just a mark of humble mistakes of a beginner to open-sourcing, The id is https://github.com/jennystone. I hope to build upon my profile. Jennifer ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion
Re: [Numpy-discussion] (no subject)
Scipy doesn't have a function for the Laplace transform, it has only a Laplace distribution in scipy.stats and a Laplace filter in scipy.ndimage. An inverse Laplace transform would be very welcome I'd think - it has real world applications, and there's no good implementation in any open source library as far as I can tell. It's probably doable, but not the easiest topic for a GSoC I think. From what I can find, the paper Numerical Transform Inversion Using Gaussian Quadrature from den Iseger contains what's considered the current state of the art algorithm. Browsing that gives a reasonable idea of the difficulty of implementing `ilaplace`. A brief scanning through the paper Numerical Transform Inversion Using Gaussian Quadrature from den Iseger does indicate the complexity of the algorithm. But GSoC project or not, can't we work on it, step by step? As I would love to see a contender for Matlab's ilaplace on open source front!! You can have a look at https://github.com/scipy/scipy/pull/2908/files for ideas. Most of the things that need improving or we really think we should have in Scipy are listed there. Possible topics are not restricted to that list though - it's more important that you pick something you're interested in and have the required background and coding skills for. Thanks a lot for the roadmap. Of the options provided, I found the 'Cython'ization of Cluster great. Would it be possible to do it as the Summer project if I spend the month learning Cython? Regards Janani Cheers, Ralf ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion
Re: [Numpy-discussion] (no subject)
What are your interests and experience? If you use numpy, are there things you would like to fix, or enhancements you would like to see? Chuck I am an undergraduate student with CS as major and have interest in Math and Physics. This has led me to use NumPy and SciPy to work on innumerable cases involving special polynomial functions and polynomials like Legendre polynomials, Bessel Functions and so on. So, The packages are closer known to me from this point of view. I have a* few proposals* in mind. But I don't have any idea if they are acceptable within the scope of GSoC 1. Many special functions and polynomials are neither included in NumPy nor on SciPy.. These include Ellipsoidal Harmonic Functions (lames function), Cylindrical Harmonic function. Scipy at present supports only spherical Harmonic function. Further, why cant we extend SciPy to incorporate* Inverse Laplace Transforms*? At present Matlab has this amazing function *ilaplace* and SymPy does have *Inverse_Laplace_transform* but it would be better to incorporate all in one package. I mean SciPy does have function to evaluate laplace transform After having written this, I feel that this post should have been sent to SciPy but as a majority of contributors are the same I proceed. Please suggest any other possible projects, as I would like to continue with SciPy or NumPy, preferably NumPy as I have been fiddling with its source code for a month now and so am pretty comfortable with it. As for my experience, I have known C for past 4 years and have been a python lover for past 1 year. I am pretty new to open source communities, started before a manth and a half. regards Jennifer ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion
[Numpy-discussion] (no subject)
Hello, This is Jennifer Stupensky. I would like to contribute to NumPy this GSoC. What are the potential projects that can be taken up within the scope of GSoC? Thanks a lot in anticipation Regards Jennifer ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion