# Re: [R] 2/3d interpolation from a regular grid to another regular grid

From: jiho <jo.irisson_at_gmail.com>
Date: Wed, 5 Dec 2007 11:44:31 +0100

On 2007-December-04 , at 21:38 , Scionforbai wrote:
>> - krigging in package fields, which also requires irregular spaced
>> data
>
> That kriging requires irregularly spaced data sounds new to me ;) It
> cannot be, you misread something (I feel free to say that even if I
> never used that package).

Of Krigging I only know the name and general intent so I gladly line up to your opinion.
I just read the description in ?Krig in the package fields which says: " Fits a surface to irregularly spaced data. " But there are probably other Krigging methods I overlooked.

> It can be tricky doing kriging, though, if you're not comfortable with
> a little bit of geostatistics. You have to infer a variogram model for
> each data set; you possibly run into non-stationarity or anisotropy,
> which are indeed very well treated (maybe at best) by kriging in one
> of its forms, but ... it takes more than this list to help you then;
> basically kriging requires modelling, so it is often very difficult to
> set up an automatic procedure. I can reccomend kriging if the spatial
> variability of your data (compared to grid refinement) is quite
> important.

This was the impression I had too: that Krigging is an art in itself and that it requires you to know much about your data. My problem is simpler: the variability is not very large between grid points (it is oceanic current velocity data so it is highly auto-correlated spatially) and I can get grids fine enough for variability to be low anyway. So it is really purely numerical.

> In other simple cases, a wheighted mean using the (squared) inverse of
> the distance as wheight and a spherical neighbourhood could be the
> simpliest way to perform the interpolation.

Yes, that would be largely enough for me. I had C routines for 2D polynomial interpolation of a similar cases and low order polynomes gave good results. I just hoped that R had that already coded somewhere in an handy and generic function rather than having to recode it myself in a probably highly specialized and not reusable manner.

Thank you very much for you answer and if someone knows a function doing what is described above, that would be terrific.

JiHO

```---
http://jo.irisson.free.fr/

______________________________________________
R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
```
Received on Wed 05 Dec 2007 - 10:49:33 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Wed 05 Dec 2007 - 16:30:17 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.