[Gstat-info] gstat defaults

Edzer J. Pebesma e.pebesma at geo.uu.nl
Wed Aug 30 17:21:38 CEST 2006


Nick Hamm wrote:
> Dear all 
>
> I would just like to clarify a few things about gstat.  In the gstat
> manual it says:
>
> "All variograms and covariograms are calculated from predicted residuals
> e(s_i) = z(s_i) - m(s_i), with m(s_i) the ordinary least square
> estimates of m(s_i), fitted globally (all data of the variable are used
> in a linear model assuming IID errors), unless one of dX, noresidual or
> gls is set."
>
> note that (s_i) is the location for data-point i.
>
> >From this I assume the default situation is to use a global mean or
> global model for a trend (whether the trend is a function of location or
> another variable) and that this is then used for kriging.  This
>   
For calculation of residuals for the variogram yes, for kriging in 
general, not necessarily (as you may opt for local kriging)
> variogram would then be modelled.  Hence, the kriged predictor (for OK
> and UK), Z(s_0) = m(s_0) + e(s_0) is the sum of the (global) trend and
> the kriged error term (a weighted average of (i) all the residuals or
> (ii) the user defined nearest neighbours).  Is this right?
>   
Kriging systems may be solved using all data (global) or data in a 
neigbourhood (local).
> Specifying "noresidual" would, I presume, calculate the variogram on the
> z(s) rather than the e(s).  Hence the kriged predictor, Z(s_0) would be
> the kriged estimate of Z at s_0 (ie a weighted average of (i) all the
> data or (ii) the user defined nearest neightbours).  Is this right?  
>   
noresiduals only affects the variogram computation part, not the kriging 
part.
> I am not quite clear how gls works.  Is this an iterative approach, some
> thing like
> 1) Use OLS to estimate the betas (globally)
> 2) Calcualte the residuals
> 3) Calculate and model the variogram
> 4) Get the covariance matrix
> 5) Use GLS to calculate the betas
> 6) Go back to (2) and repeat until convergence.
> The resulting betas and variogram are then used for kriging, as
> described above.  Is this right?
>
>   
No, the order gstat does in a single pass is 4, 5, 2, 3: you feed it 
with a variogram, this variogram is used to obtain gls residuals instead 
of ols. After 3, you could repeat this, but gstat has not an automated 
looping mechanism for this (the interactive menu can be used for it, but 
requires the user to do the iterations).
> Finally, I have a data-set which, when modelled using OLS, gives
> heteroskedastic residuals.  This can be dealt with using WLS (there is
> reasonable information to suggest what the weights should be).  However,
> these data-points are spatially referenced so I would like to model the
> spatial component of the error.  Is there a way of utilising these
> weights in gstat?
>   
Look at the variance field of a data (points) statement; it can be used 
to specify point-specific variances, and hence use these in WLS 
estimation of residuals.

Best wishes,
--
Edzer


More information about the Gstat-info mailing list