[R-sig-Geo] GLS/OLS

M.Kuntz at stud.uni-heidelberg.de M.Kuntz at stud.uni-heidelberg.de
Thu Aug 16 14:29:28 CEST 2012


Dear List members,

after reading several old mail from R-sig-geo and checking the gstat  
manual there is still sth. confusion about the way how gstat  
calculates the Regressions.
On the on hand some mails, as the the following one, tell that GLS is  
used to estimate the Regressioncoefficients and the error:
http://mailman.geo.uu.nl/pipermail/gstat-info/2006q3/000091.html

> 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).

So does the gstat manual as it tells that there is the possibility of  
calculating only the regressioncoefficients by using
> predict( ..., BLUE=TRUE), which implicates that GLS is used.

On the other hand there exists the command
> gstat( ..., set = list(gls = 1) )
and the manual reads as follows:

"By default, the residuals gstat uses are ordinary least squares residuals
(i.e. regular regression residuals), meaning that for the sake of estimating
the trend, observations are considered independent. To honour a dependence
structure present, generalised least squares residuals can be  
calculated instead.
For this, a variogram model to define the covariance structure is needed. In
the following example..."

which implicates that by default OLS is used.

So I am asking: What exactly occurs, when I use the predict.gstat command?
Is it possibly that, by default, the Trend is fitted by OLS and then  
the variogram if fitted by GLS? But why is there this BLUE=TRUE option  
for the predict.gstat command?



Any help would be appreciated.

Cheers!  Michael



More information about the R-sig-Geo mailing list