haifengl / smile

Statistical Machine Intelligence & Learning Engine
https://haifengl.github.io
Other
6k stars 1.12k forks source link

RBFInterpolation NaN #44

Closed bwkchee closed 8 years ago

bwkchee commented 8 years ago

Thanks for providing a Kriging and RBFInterpolation function! I'm trying to use: RBFInterpolation(coords, vals, new GaussianRadialBasis()) coords is a 2d double array of points in a x,y plane with a range (0,3000). vals is a 1d double array of values in the range (20-100). After initializing the RBFInterpolation I try to call interpolate(x,y) where x and y are in the range (0,3000) eg interpolate(153,331) and the result is NaN.

I noticed in your ScatterDemo code you swap the coordinates and you multiply it by a scaling factor: rbf.interpolate(j_.12, i_12)

Do I need to swap my x and y coordinates when calling interpolate? What is the significance of the scaling factor?

haifengl commented 8 years ago

scaling and swap were for visualization purpose. these are not the reason. can you please post your code snippet? Thanks!

haifengl commented 8 years ago

Do you have problems with it?

haifengl commented 8 years ago

If you have no problems with it any more, I will close this. Thanks!