Dear All,


I have some questions about the development of variogram models in R, in
paerticular for setting a minimum lag distance and for modelling 3D
anisotropy.


The aim of our research is to analyze a set of spatial data Z(x; y)
distributed on a regular grid (x; y). We want to develop a Kriging
forecasting model trying different variogram models (both isotropic and
anisotropic) fitted using sample observations (empirical variograms).

If we use gstat (NOT STRICTLY NECESSARY) the initial codes to be run in R
are the following:


library(gstat)
DATA<- read.table("DATA.txt",header=TRUE)


In the following questions we specify some R (gstat) functions and
parameters that we consider appropriate for reaching our objectives of
analysis - although obviously still to be integrated/corrected considering
the answers to our questions. However, in case you consider more
appropriate to use different libraries, functions or parameters, we would
be grateful if you could specify the codes we should use to run the
analyses in R.





*1) *In the <variogram> function, for calculating the empirical variogram
(we call it “V.EMP”), we can set the [cutoff], that is the maximum lag
distance between the observations to be considered. For example, for a
maximum distance equal to 0.07:



V.EMP<- variogram(z~1, locations=~x+y, DATA, cutoff=0.07)


*How should we do to set also a minimum distance below which observations
must not be considered to determine the variogram? Which parameter should
we add in the <variogram> function (if that function is the correct one)?*

*Or should we add a minimum distance parameter later in the <vgm> function
for estimating the variogram model (and in case which one)?*

The empirical variogram is used for fitting a variogram model and finally
for Kriging. For example:

*
*model.variog <- vgm(psill=0.00725878, model="Exp", nugget=0,
range=0.2326746)

fit.variog <- fit.variogram(V.EMP, model.variog, fit.sills=TRUE,
fit.ranges=TRUE)

OK <- krige(z~1, DATA, FORECASTS.COORDINATES, model=fit.variog)


*2)* *How should we do to calculate the anisotropic empirical variogram
(that is the empirical variogram in the three dimensions x, y and z)?*

*How should we do to fit a 3D anisotropic variogram model (estimating also
the anisotropy parameters) to be used for Kriging?*

*What are the R codes for calculating i) the Ordinary Kriging and ii) the
Universal Kriging using that anisotropic variogram model (if gstat is
appropriate, can we use the same <krige> function?)?

*

We have tried to add one by one the following parameters (assuming an
anisotropy angle of 90°) in the <variogram> function: [dir=pi/2],
[dir.hor=90], [alpha=90]; nevertheless, those insertions produced no
effects, as all the resulting variograms we obtained coincide with the one
calculated without adding any of those parameters.

 Similarly, also the insertion of the [anis=c(k1, k2, k3, k4, k5)]
parameter in the <vgm> function (with realistic values of the ks) produced
no effects.



model.variog <- vgm(psill=0.00725878, model="Exp", nugget=0,
range=0.2326746, *anis=c(k1, k2, k3, k4, k5)*)



Furthermore, even if it produced effects, considering that – if we have
understood well – the <fit.variog> function does not estimate the
anisotropy parameters (the ks), we would have still the problem of
estimating them.


Once more, we have given suggestions for possible functions in gstat that
we consider appropriate, but in case you suggest other libraries or
functions, consider that we just need to know a code in R to calculate: i)
empirical variogram, ii) variogram model (with minimum lag, both isotropic
and anisotropic), iii) fit the variogram model and iv) develop Kriging on
the base of the variogram model.



Thanks in advance for your help



Best regards,

 Michele Di Marcantonio

	[[alternative HTML version deleted]]

