<div dir="ltr"><div><div><div>Anastasiia,<br><br></div>Concerning optimization methods.<br></div>What I am doing in my code is adding a knot between two other knots, and then using an optimization method of scipy (gradient based) to determine best placement of this knot and value at that knot. Constraints added on that knot to make sure it remains between the two bounding knots. <br><br></div>Main problem I see is how to determine which interval is best to add an extra knot. If there is literature that tackles this, that would be interesting. I have not done an extensive literature search yet. You also want to stop adding knots if their addition starts to no longer help in reducing an error measure (Total variation increases but error does nog significantly decrease).<br><div><div><div><div><div class="gmail_extra"><br></div><div class="gmail_extra">My use case is not directly determining spline interpolation but instead an indirect problem, so not directly usable for you, but I would suspect equal approaches to knot placement for pure interpolation exist. Eg, use levenberg-marquardt algorithm on placement of knots to reduce an error norm.<br></div><div class="gmail_extra"><br></div><div class="gmail_extra">Benny<br></div><div class="gmail_extra"><div class="gmail_quote"><br>2015-03-12 19:47 GMT+01:00 Anastasiia Tsyplia <span dir="ltr"><<a href="mailto:anastasiyatsyplya@gmail.com" target="_blank">anastasiyatsyplya@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">


        
        
        
        


<p style="margin-bottom:0in;line-height:100%" align="justify">
Hello!</p>
<p style="margin-bottom:0in;line-height:100%" align="justify">

</p>
<p style="margin-bottom:0in;line-height:100%" align="justify">
Thanks for expanded and kind reply!</p>
<p style="margin-bottom:0in;line-height:100%" align="justify">

</p>
<p style="margin-bottom:0in;line-height:100%" align="justify">
Especially thanks for the link to bezierbuilder! It opened my eyes on
what can be done with the matplotlib. I guess now I’ll abandon my
efforts to make the implementation with Qt and will start again with
only the matplotlib. Anyway, this can wait for some time, and when
it's done I'll definitely share the link to repo with  you.</p>
<p style="margin-bottom:0in;line-height:100%" align="justify">

</p>
<p style="margin-bottom:0in;line-height:100%" align="justify" lang="ru-RU">
<span lang="en-US">Regarding to the optimization I wrote about
before:</span></p>
<p style="margin-bottom:0in;line-height:100%" align="justify">
Initially I was thinking about the precise positioning of control
points while dragging them on the screen in order to get best fit. It
is obvious, that manual positioning of control points can give a good
visual result. Following automatic variation in some boundaries can
provide strict control points positions and numerically best fitting
result.</p>
<p style="margin-bottom:0in;line-height:100%" align="justify" lang="ru-RU">
<span lang="en-US">By now I’m thinking about </span><span lang="en-US">the</span><span lang="en-US">
possibility to </span><span lang="en-US">implement the </span><span lang="en-US">request
</span><span lang="en-US">for </span><span lang="en-US">some
additional parameters </span><span lang="en-US">from the user </span><span lang="en-US">for
approximati</span><span lang="en-US">ng</span><span lang="en-US"> 
spline functions. Actually, this can be user-provided n-order
derivatives in some points (for example endpoints to get good
extrapolation results). Maybe this will require implement</span><span lang="en-US">ation
of</span><span lang="en-US"> a new class like
</span><span lang="en-US"><i>DerivativeControlledSpline</i></span><span lang="en-US">
or something familiar. </span>
</p>
<p style="margin-bottom:0in;line-height:100%" align="justify" lang="ru-RU">
<span lang="en-US">Another issue of optimization is the construction
of </span><span lang="en-US">non-uniform knot vector</span><span lang="en-US">s</span><span lang="en-US">.
Just as an example, </span><span lang="en-US">I think </span><span lang="en-US">in
some cases non-uniform knot vector can be constructed using
information about the data points’ density along x and y axes. If
these thoughts make any sense please, let me know and I’ll try to
expand them to some proposal-like state.</span></p>
<p style="margin-bottom:0in;line-height:100%" align="justify">

</p>
<p style="margin-bottom:0in;line-height:100%" align="justify">
Regarding to alternative tasks:</p>
<p style="margin-bottom:0in;line-height:100%" align="justify" lang="ru-RU">
<span lang="en-US">The list of your alternative tasks pushed me to
reread the 7</span><sup><span lang="en-US">th</span></sup><span lang="en-US">
chapter of the book on spline methods, what made me feel excited
about tensor product spline surfaces. Current module fitpack2 has a
big set of classes representing bivariate splines. Aren’t they
tensor product splines? Or the idea is to move away from FITPACK
wrapping? Anyway I feel some interest to the issue and I would be
grateful if you </span><span lang="en-US">describe the problem more
specific</span><span lang="en-US"> so I can estimate </span><span lang="en-US">the
effort and the  milestones</span><span lang="en-US">.</span></p>
<p style="margin-bottom:0in;line-height:100%" align="justify">
Implementation of Cardinal B-splines seems to be of the less effort,
but not less interest :) 
</p>
<p style="margin-bottom:0in;line-height:100%" align="justify">

</p>
<p style="margin-bottom:0in;line-height:100%" align="justify" lang="ru-RU">
<span lang="en-US">I</span><span lang="en-US">n addition, I would
like to know what you are thinking about </span><font color="#0000ff"><u><a href="http://gtwavelet.bme.gatech.edu/wp/ExpoSplines.pdf" target="_blank"><span lang="en-US">expo-rational
B-splines</span></a></u></font><span lang="en-US">. If their
implementation in SciPy is welcome, I can think about the appropriate
proposal. </span>
</p>
<p style="margin-bottom:0in;line-height:100%" align="justify">

</p>
<p style="margin-bottom:0in;line-height:100%" align="justify" lang="ru-RU">
<span lang="en-US">So by now I have 4 ways to go:</span></p>
<ol><li><p style="margin-bottom:0in;line-height:100%" align="justify">
        Tensor product spline surfaces;</p>
        </li><li><p style="margin-bottom:0in;line-height:100%" align="justify">
        Cardinal B-splines;</p>
        </li><li><p style="margin-bottom:0in;line-height:100%" align="justify">
        Expo-rational B-splines;</p>
        </li><li><p style="margin-bottom:0in;line-height:100%" align="justify">
        Optimization methods for spline functions.</p>
</li></ol>
<p style="margin-bottom:0in;line-height:100%" align="justify">

</p>
<p style="margin-bottom:0in;line-height:100%" align="justify" lang="ru-RU">
<span lang="en-US">If it is possible, please provide the information
on their importance to the SciPy project so I can choose 1 or 2 of
them to make the GSoC proposal(s).</span></p>
<p style="margin-bottom:0in;line-height:100%" align="justify">

</p>
<p style="margin-bottom:0in;line-height:100%" align="justify">
Thanks a lot and best regards,</p>
<p style="margin-bottom:0in;line-height:100%" align="justify">
Anastasiia</p>
<p style="margin-bottom:0in;line-height:100%" align="justify">
<br>
</p>
<p style="margin-bottom:0in;line-height:100%" align="justify">
PS</p>
<p style="margin-bottom:0in;line-height:100%" align="justify">
While discovering fitpack2 module I guess I found some copy-paste bug
in docstring on <i>LSQBivariateSpline</i>. It seems that the class
doesn’t require smoothing parameter on initialization but the
docstring about it somehow migrated from another class. Should I
write about it on IRC channel or somewhere else, or maybe do it by
myself? 
</p>
<p style="margin-bottom:0in;line-height:100%" align="justify">
<br>
</p>
<p style="margin-bottom:0in;line-height:100%" align="justify">
<br>
</p>

</div><div class="gmail_extra"><br><div class="gmail_quote">2015-03-09 23:48 GMT+02:00 Ralf Gommers <span dir="ltr"><<a href="mailto:ralf.gommers@gmail.com" target="_blank">ralf.gommers@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Hi Anastasiia, welcome!<br><br><div><div class="gmail_extra"><br><div class="gmail_quote"><span>On Sun, Mar 8, 2015 at 10:25 AM, Anastasiia Tsyplia <span dir="ltr"><<a href="mailto:anastasiyatsyplya@gmail.com" target="_blank">anastasiyatsyplya@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><p style="margin-bottom:0in"><font face="DejaVu Sans, sans-serif">Hello,</font></p>

<p style="margin-bottom:0in" align="JUSTIFY"><font face="DejaVu Sans, sans-serif">My
name is Anastasiia Tsyplia. I am a 5th-yaer student of National
Mining University of Ukraine. </font>
</p>

<p style="margin-bottom:0in" align="JUSTIFY"><font face="DejaVu Sans, sans-serif">I am keen on interpolation/approximation with splines and it
was a nice surprise to find out that there is a demand in
interpolation improvements amongst the Scipy's ideas for GSoC'15.
However, I've spend some time on working out <a href="https://drive.google.com/file/d/0BzveGSDwNVtBanU1THpFTXNKZHc/view?usp=sharing" target="_blank">the idea</a>
of my own.  </font>
</p>

<p style="margin-bottom:0in" align="JUSTIFY"><font face="DejaVu Sans, sans-serif">Recently
I've made a <a href="http://tsplb.blogspot.com/" target="_blank">post</a> dedicated
to description of the parametric spline curves construction process and
approaches to approximate engineering data by spline functions and
parametric spline curves with SciPy. </font></p></div></blockquote><div><br></div></span><div>Nice blog post! <br>I'll leave the commenting on technical details you have in your draft proposal to Evgeni and others, just want to say you've made a pretty good start so far.<br></div><span><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><p style="margin-bottom:0in" align="JUSTIFY">
</p>
<p style="margin-bottom:0in" align="JUSTIFY"><font face="DejaVu Sans, sans-serif">It
seems that using parametric spline curves in approximation can be
extremely useful and time-saving approach. That's why I would like to
share my project idea and hope to hear some feedback as I am about to
make a proposal for the Google Summer of Code.</font></p>

<p style="margin-bottom:0in" align="JUSTIFY"><font face="DejaVu Sans, sans-serif">I
have a 2-year experience in programming with Python, PyOpengl, PyQt,
Matplotlib, Numpy & SciPy. Some time I spent to dive into ctypes
and scratched the surface of C. Now my priority is Cython. I've read
the book on the spline methods  recommended on SciPy's idea page, so I
feel myself competent in spline methods. I feel free with recursions:
the last challenge I faced was implementation of binary space
partitioning algorithm in python as I was writing my own ray-tracer. </font>
</p>

<p style="margin-bottom:0in" align="JUSTIFY"><font face="DejaVu Sans, sans-serif">I
would like to contribute to SciPy by any means, so I'm ready to
receive instructions on my next move. And, certainly I'm looking
forward to start dealing with B-Splines in Cython as it is also a
part of my project idea. </font></p></div></blockquote><div><br></div></span><div>What I recommend to all newcomers is to start by reading <a href="https://github.com/scipy/scipy/blob/master/HACKING.rst.txt" target="_blank">https://github.com/scipy/scipy/blob/master/HACKING.rst.txt</a> and then first tackly an issue labeled "easy-fix", just to get a feel for the development/PR process. <br><br></div><div>I've checked open issues for Cyhon code, there aren't that many at the moment. Maybe something fun could be to take some code now using np.ndarray and change it to use memoryviews (suggestion by @jakevdp that in scipy.sparse.csgraph this could help). And include a benchmark to show that it does speed things up (seehttps://<a href="http://github.com/scipy/scipy/tree/master/benchmarks" target="_blank">github.com/scipy/scipy/tree/master/benchmarks</a> for details).<br><br></div><div>Regarding B-splines there's <a href="https://github.com/scipy/scipy/issues/3423" target="_blank">https://github.com/scipy/scipy/issues/3423</a>, but I don't recommend tackling that now - that'll be a significant amount of work + discussion.<br><br></div><div>Cheers,<br></div><div>Ralf<br><br></div></div></div></div></div>
<br>_______________________________________________<br>
SciPy-Dev mailing list<br>
<a href="mailto:SciPy-Dev@scipy.org" target="_blank">SciPy-Dev@scipy.org</a><br>
<a href="http://mail.scipy.org/mailman/listinfo/scipy-dev" target="_blank">http://mail.scipy.org/mailman/listinfo/scipy-dev</a><br>
<br></blockquote></div><br></div>
<br>_______________________________________________<br>
SciPy-Dev mailing list<br>
<a href="mailto:SciPy-Dev@scipy.org">SciPy-Dev@scipy.org</a><br>
<a href="http://mail.scipy.org/mailman/listinfo/scipy-dev" target="_blank">http://mail.scipy.org/mailman/listinfo/scipy-dev</a><br>
<br></blockquote></div><br></div></div></div></div></div></div>