# [R-sig-Geo] Ordinary and Regression Kriging combined to deal with missing values in predictor variables

Paul Hiemstra p.hiemstra at geo.uu.nl
Mon May 26 14:49:57 CEST 2008

```Point taken Edzer, I guess calling the gurus is the easy way out when I
have difficulties formulating an answer :). But I will give it a shot.

I oppose mixing RK and OK because:
- There is no sound reason other than a pragmatical one to use OK. If
you know that there are trends in the data it is not logical to not
include them for part of the dataset, particularly if that part is large
in comparison to the total study area (which I assume because if the
area where small you (Eelke) would probably just exclude the area with
no predictor information available).
- The kriging variance for the RK part and the OK part will be different
(depending on the R^2 of the regression, more R^2 means lower kriging
error in RK). So using the kriging variance in any subsequent analysis
is questionable.

I would prefer interpolating the predictors. This ensures that you can
use RK on the whole study area. A problem is that if you estimate the
predictors through interpolation you introduce an additional error in
the parts of the predictor map that are estimated. Consequently, any RK
based on this estimated predictor will not yield good estimates of the
kriging prediction variance.

So both approaches have their drawback, but I would prefer interpolating
the predictor.

Eelke, if you don't have predictor values for all locations you could
try co-kriging.

hth and cheers,
Paul

Edzer Pebesma wrote:
> Paul, calling for gurus is easy, but why don't you try to elaborate on
> the problems that you claim this approach has without telling Eelke
> what they are?
> --
> Edzer
>
> Paul Hiemstra wrote:
>> Hi Eelke,
>>
>> I would advise against filling up the RK grid with OK predictions.
>> Interpolating the predictors would have my preference, although it
>> has it own set of problems. What is the opinion of the r-sig-geo
>> gurus on this subject?
>>
>> cheers,
>> Paul
>>
>> Eelke Folmer wrote:
>>> Hello all,
>>> I'm using Gstat/R for regression kriging. I don't have values for
>>> all locations in the predictor variables for which I want to
>>> interpolate a surface. I do however want to make use of the
>>> independent predictors. Therfor I combined regression kriging with
>>> ordinary kriging:
>>> 1. regression kriging:     krige(log(cer+1) ~ pred1 + pred2 ,
>>> data,  data.pred.grid, model = vgm.fit1) 2. ordinary
>>> kriging:         krige(log(cer+1) ~ 1,                     data,
>>> pred.grid,        model = vgm.fit0) 3. add the values from the
>>> second step to the grid where the first step gives NA:   s0 =
>>> surface.krige0 at data\$var1.pred
>>>   s1 = surface.krige1 at data\$var1.pred
>>>   s1[is.na(s1)] <- 0    # make the NA zero
>>>   s0[!is.na(s1)] <- 0   # make everyting that is not NA in s1 zero
>>>   s1 = s1 + s0          # now, all locations get a predicted value
>>> despite missing predictors
>>> surface.krige at data\$var1.pred.inclusive = s1
>>>
>>> Is this ok, or should I interpolate (in fact, extrapolate) the
>>> predictors to get values at all necessary locations instead? Better
>>> solutions available?
>>> Thank you in advance for time and effort.
>>> Best regards,
>>> Eelke
>>>
>>> Eelke Folmer
>>> Animal Ecology Group
>>> University of Groningen
>>> P. O. Box 14
>>> 9750 AA Haren
>>> The Netherlands
>>> +31(0)50 3632091
>>>     [[alternative HTML version deleted]]
>>>
>>> _______________________________________________
>>> R-sig-Geo mailing list
>>> R-sig-Geo at stat.math.ethz.ch
>>> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>>>
>>
>>
>

--
Drs. Paul Hiemstra
Department of Physical Geography
Faculty of Geosciences
University of Utrecht
Heidelberglaan 2
P.O. Box 80.115
3508 TC Utrecht
Phone: 	+31302535773
Fax:	+31302531145
http://intamap.geo.uu.nl/~paul

```