[R-sig-Geo] custom variogram models
Edzer Pebesma
edzer.pebesma at uni-muenster.de
Wed Mar 10 20:09:07 CET 2010
Dylan Beaudette wrote:
> Hi,
>
> Is it possible to create "custom" variogram models that can be used within the
> gstat framework?
>
> For example, would it be possible to generate a custom exponential model in
> the form of:
>
> gamma = C [ 1 - exp (-3h/a) ]
>
> instead of the typical:
>
> gamma = C [ 1 - exp (-h/a) ]
>
Hi Dylan,
variogram function evaluation is done in the gstat C code, to which you
cannot pass R functions right now. If you need a particular variogram
function that is not there, it may be easy to implement it (I could help
here), as the code is set up such that adding functions is close to
trivial if you've done it once. In that case, fit.variogram, vgm etc
will also work.
It is possible to pass a custom variogram function to the krige0
function, which does ordinary point kriging for global neighbourhoods
(and is pure R). It means that you need the function including its
parameters, you don't pass on C and a separately, as your example
suggests. See ?krige0 for an example (and ignore the y argument); in
addition, demo(wind) ends with an example with a separable product
space-time covariance defined as R function, which is also not available
in fit.variogram, krige etc.
This is an active research area for me, now -- feedback & suggestions
are more than welcome.
--
Edzer Pebesma
Institute for Geoinformatics (ifgi), University of Münster
Weseler Straße 253, 48151 Münster, Germany. Phone: +49 251
8333081, Fax: +49 251 8339763 http://ifgi.uni-muenster.de
http://www.52north.org/geostatistics e.pebesma at wwu.de
More information about the R-sig-Geo
mailing list