-
Notifications
You must be signed in to change notification settings - Fork 55
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Optimize distance function in kriging #58
Comments
I commented in #60 ... |
Only half-way. I added the two subtasks above... But the solution is to use the same method as with #60 above, including the cKDTree optimization. |
OK, great! Then I'll leave this open. |
The idea I have is to generate a pdist matrix for all observation points at the top, then select the sub-matrix for the nearby points instead of calling self.dist(). |
As far as I can see this is solved in https://github.com/mmaelicke/scikit-gstat/blob/master/skgstat/Kriging.py#L415 |
When krigin, a distance function is called for each point to calculate its distance to every point in the variogrammed dataset. This might be necessary if the use has supplied their own distance metric, but if it's one of the built in scipy, we can use scipy.spatial.distance.cdist on all points instead, and if it's euclidean, we can even use scipy.spatial.cKDTree, see ttps://iliauk.wordpress.com/2016/02/16/millions-of-distances-high-performance-python/ , which would automatically cull the points farther away than the range without actually doing a distance calculation on them.
The text was updated successfully, but these errors were encountered: