Hello Aman,


Hello,
This is my second Draft, Proposal : Second Draft


I'd echo Ralf's comments on that the proposal needs some more focus. Several further comments:

* Removing FITPACK is not a goal in itself. It would be better to focus a bit more on adding what is not available otherwise. In particular:

- spending two weeks on reimplementing the knot insertion is not very useful, I'd say. 
- ditto for spending a whole week on the root finding. Sure, root-finding for non cubic splines is something we do not have currently, so adding it could be useful to have and fun to work on. However it's lower priority IMO.

* If you say your main focus is cardinal splines, then just as Ralf said, it's better to start working on them earlier. However just adding a BSpline subclass would not be enough: there are some b-splines in scipy.signal, and some of it is in not too good of a shape. It would be nice to ask scipy.signal folks for feedback to drive your design: both on cleaning up scipy.signal, and on what sort of API / functionality they would find useful. 

* I would suggest to expand a bit the algorithmic part of the proposal. From the current state of the proposal it's not even clear that you know or will learn how to implement algorithms you are discussing (conversions between bases, periodic interpolation).

* In my POV, the project could/should lean a bit more towards writing algorithmic code (this is what Nikolay was saying a while ago in a parallel thread).

-- Rereading the thread, I now find that I missed a prompt for comments from Nikolay:

> For "Spline fitting to data" I'm somewhat confused, because make_lsq_spline and make_interp_spline 
> seem to already solve fitting problems without relying on FITPACK. Evgeni, what is the situation here

* make_interp_spline needs an algorithmic improvement to handle periodic boundary conditions. It uses banded linear algebra, but with periodic BC, the collocation matrix has additional off-band elements, because first and last data points are close to each other. Chuck was saying at some point that a while ago he did something like that with a variant of the Sherman-Morrison formula for cubic splines. 

* make_lsq_spline is basically a stub:

 (i) it only works with user-supplied knots. Knot selection is a major thing which FITPACK does, and we don't have any alternatives. IMO looking into alternative algorithms could a major improvement from this sort of project. I'm not aware of *the* method, so possibly there's room for offering several alternatives and/or better user control. (cf https://github.com/scipy/scipy/issues/2579https://github.com/scipy/scipy/issues/1753)

(ii) it explicitly forms the normal equations (A.T @ A, where A is the collocation matrix). A better way would be to do some form of banded SVD or QR. I just recently learned (from a student) that LAPACK has routines for that (*gbbrd, *bdsqr), and we even expose them via cython_lapack.

To sum up, I see at least three directions the project can focus on:

- Low-level algorithms: some of the knot selection, periodic interpolation, banded SVD etc.
- Cardinal b-splines and their uses in scipy.signal
- What Stefan suggested upthread.

Either of these can be coupled with easier-fix tasks for the first few weeks.

Cheers,

Evgeni

 
This is somewhat incomplete in detailing. It will take me some time to make it more clear and obvious as to what I am going to do.
I am facing a problem though, in getting my hands on the book "A Practical Guide to Splines" by Carl R de Boor. Also, I need some more time to get the algorithms clear in my head. So, please bear with me. Looking forward to your feedback.

Thank You




On 24 March 2017 at 23:12, Evgeni Burovski <evgeny.burovskiy@gmail.com> wrote:


On Fri, Mar 24, 2017 at 2:15 PM, Nikolay Mayorov <nikolay.mayorov@zoho.com> wrote:
Resent my answer to the new address.


============ Forwarded message ============
From : Nikolay Mayorov <nikolay.mayorov@zoho.com>
To : "SciPy Developers List"<scipy-dev@scipy.org>
Date : Fri, 24 Mar 2017 01:07:10 +0500
Subject : Re: [SciPy-Dev] GSoC 2017: BSpline support
============ Forwarded message ============

De Boor, "Practical guide to splines", Chapter IX should be the place for your. Likely you will need to thoroughly study several chapters in it, it's not an easy book to quickly pick up a recipe from it.

Nikolay.


---- On Thu, 23 Mar 2017 19:31:32 +0500 Aman Pratik <amanpratik10@gmail.com> wrote ----



Hello,
I need some help with "Convert a CubicSpline/PPoly object to a BSpline". I am unable to find suitable literature for it, or maybe I am overlooking something. I would be really grateful if you could guide me to some reading material or code samples.



can be an easier first read than de Boor (which is, indeed, *the* reference). 

(Hat tip to Pauli who suggested this to me a while ago).

Cheers,

Evgeni

_______________________________________________
SciPy-Dev mailing list
SciPy-Dev@python.org
https://mail.python.org/mailman/listinfo/scipy-dev



_______________________________________________
SciPy-Dev mailing list
SciPy-Dev@python.org
https://mail.python.org/mailman/listinfo/scipy-dev