GLS/OLS
On 08/16/2012 02:29 PM, M.Kuntz at stud.uni-heidelberg.de wrote:
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?
predict.gstat will always use the variogram model passed, so uses GLS unless a pure nugget model is passed (in which case GLS and OLS are identical). The example in ?variogram shows how you can get a variogram from GLS residuals, by default OLS residuals are used HERE (and when dX is not set). BLUE=TRUE is used in predict.gstat to get the trend component ONLY at prediction locations, instead of the trend+predicted residual which what we call kriging. If all this is confusing from the manuals, please let me know what exactly confused you.
Any help would be appreciated. Cheers! Michael
_______________________________________________ R-sig-Geo mailing list R-sig-Geo at r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-geo
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