Kernel Interpolation

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Kernel Interpolation

Dimathematician
Hi all.

I'm almost done with coding an additional 1D interpolation technique: the kernel approach, which can
for example be found in the book "Foreign Exchange Risk" by Hakkala, Wystup. I plan to
code it for 2D later.


I have some questions regarding the existing interpolation functions:

- As usual: Any reasons not to include it? Is someone else working on the same project?
- The existing  classes all have primitive, derivative and second derivative functions, which
I don't all have for kernels. What shall I do? Return a zero/throw error?

- For me its not really clear, what the function update is doing. Can someone elaborate?


Best regards, Dima

------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
QuantLib-dev mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-dev
Reply | Threaded
Open this post in threaded view
|

Re: Kernel Interpolation

Luigi Ballabio
On Mon, 2009-03-09 at 14:40 +0100, Dima wrote:

> I'm almost done with coding an additional 1D interpolation technique:
> the kernel approach, which can
> for example be found in the book "Foreign Exchange Risk" by Hakkala,
> Wystup. I plan to
> code it for 2D later.
>
> I have some questions regarding the existing interpolation functions:
>
> - As usual: Any reasons not to include it? Is someone else working on
> the same project?

Not that I know of.

> - The existing  classes all have primitive, derivative and second
> derivative functions, which I don't all have for kernels. What shall I
> do? Return a zero/throw error?

Throw an error.

> - For me its not really clear, what the function update is doing. Can
> someone elaborate?

It recalculates the interpolation coefficients.  The point is that the
Interpolation object only stores iterators into the underlying data, not
a copy of the data.  If external code changes the original data, it will
invalidate the interpolation (since the stored interpolated coefficients
are still based on the old data, but the stored iterators will now
access the new data.) After changing the data, the external
code---which, usually, is some method of the object storing the data and
the interpolation---must call update() to renew the interpolation
coefficients.

Luigi


--

Prediction is very difficult, especially if it's about the future.
-- Niels Bohr



------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
QuantLib-dev mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-dev
Reply | Threaded
Open this post in threaded view
|

Re: Kernel Interpolation

Dimathematician

Thanks  Luigi,

makes sence. I considered this in my implementation. I finished my
implementations which you can find in the following zip:

www.longvega.com/KernelInterpolation.zip

ready for submission from my perspective. The test functions can be copied
straightforwardly to the other test functions in interpolations.cpp in the
testcases project.

Not sure if this form of submission is convenient for you, let me know
if some other form creates less work.

Best regards, Dima



2009/3/9 Luigi Ballabio <[hidden email]>
On Mon, 2009-03-09 at 14:40 +0100, Dima wrote:
> I'm almost done with coding an additional 1D interpolation technique:
> the kernel approach, which can
> for example be found in the book "Foreign Exchange Risk" by Hakkala,
> Wystup. I plan to
> code it for 2D later.
>
> I have some questions regarding the existing interpolation functions:
>
> - As usual: Any reasons not to include it? Is someone else working on
> the same project?

Not that I know of.

> - The existing  classes all have primitive, derivative and second
> derivative functions, which I don't all have for kernels. What shall I
> do? Return a zero/throw error?

Throw an error.

> - For me its not really clear, what the function update is doing. Can
> someone elaborate?

It recalculates the interpolation coefficients.  The point is that the
Interpolation object only stores iterators into the underlying data, not
a copy of the data.  If external code changes the original data, it will
invalidate the interpolation (since the stored interpolated coefficients
are still based on the old data, but the stored iterators will now
access the new data.) After changing the data, the external
code---which, usually, is some method of the object storing the data and
the interpolation---must call update() to renew the interpolation
coefficients.

Luigi


--

Prediction is very difficult, especially if it's about the future.
-- Niels Bohr




------------------------------------------------------------------------------

_______________________________________________
QuantLib-dev mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-dev
Reply | Threaded
Open this post in threaded view
|

Re: Kernel Interpolation

Luigi Ballabio
On Tue, 2009-03-10 at 16:58 +0100, Dima wrote:
> I finished my
> implementations which you can find in the following zip:
>
> www.longvega.com/KernelInterpolation.zip
>
> ready for submission from my perspective. The test functions can be
> copied straightforwardly to the other test functions in
> interpolations.cpp in the testcases project.

Ok, thanks.  I'll try and give it a look as soon as I get some time.


> Not sure if this form of submission is convenient for you, let me know
> if some other form creates less work.

If you're contributing new files, as in this case, it's ok.  If you
happen to contribute changes to existing files in the future, diff files
would be the preferred way. But don't worry too much about it.

Luigi


--

Any software problem can be solved by adding another layer of
indirection.
-- Steven M. Bellovin



------------------------------------------------------------------------------
Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
easily build your RIAs with Flex Builder, the Eclipse(TM)based development
software that enables intelligent coding and step-through debugging.
Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com
_______________________________________________
QuantLib-dev mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-dev