当前位置: 动力学知识库 > 问答 > 编程问答 >

n-dimensional interpolation c++ algorithm

问题描述:

How can I implement n-dimensional interpolation in C++? In ideal case I would like to have it generic on actual kernel so that I can switch between e.g., linear and polynomial interpolation (perhaps as a start: linear interpolation). This article ( http://pimiddy.wordpress.com/2011/01/20/n-dimensional-interpolation/ ) discusses this stuff but I have two problems:

1) I could not understand how to implement the "interpolate" method shown in the article in C++

2) More importantly I want to use it in a scenario where you have "multiple independent variables (X)" and "1 dependent variable (Y)" and somehow interpolate on both (?)

For example, if n=3 (i.e. 3-dimensional) and I have the following data:

#X1 X2 X3 Y

10 10 10 3.45

10 10 20 4.52

10 20 15 5.75

20 10 15 5.13

....

How could I know value of Y (dependent variable) for a particular combination of X (independent variables): 17 17 17

I know there exists other ways such as decision trees and SVM but here I am here interested in interpolation.

网友答案:

You can take a look at a set of interpolation alrogithms (including C++ implementation) at alglib.

Also it should be noted that neural networks (backpropagation nets, for example) are treated as good interpolators.

If your question is about the specific article, it's out of my knowledge.

分享给朋友:
您可能感兴趣的文章:
随机阅读: