0

I am attempting to run some interpolations using kriging on transformed data using the transformation log (x + 1) - because my non-negative data has many zero values. The problem I have is with back-transforming the kriging estimates back to the original scale.

I am already aware of this related question Backtransformation of kriging predictions and variances but the accepted answer does not produce satisfactory results for my data.

Here's what I am doing (the data can be downloaded from : https://www.dropbox.com/sh/xnwp3zz5abnilyo/AABRVJZ0kTmWk0T9Fcp4-bVSa?dl=0/)

library(gstat)
library(sp)
library(automap)
library(rgdal)

hs1<- readOGR (".", "Hollicombe_S1_L1-5_A1.2")

#There are some negative values for the PerArIn metric which must be wrong
#for now let's assume these are 0 

# replaces any negative values with 0 and remove duplicate loactions


hs1$PerArIn[hs1$PerArIn < 0] <- 0; 

hs1 <- hs1[which(!duplicated(hs1@coords)), ]



#Perform autoKrige with transformed PerArIn data
PerIn.krg <- autoKrige(log1p(PerArIn)~1, hs1)

So now I want to back-transform the krige_output for PerIn.krg and this is where my issue is.

In the answer to the question referenced above the recommended procedure is to use the correction of Laurent (1963), as follows:

#estimate back to original scale following Laurent (1963)

PerIn.krg$krige_output$var1.pred <- exp(PerIn.krg$krige_output$var1.pred +0.5 * 
                                          (PerIn.krg$krige_output$var1.var))

PerIn.krg$krige_output$var1.var <- exp(2*PerIn.krg$krige_output$var1.pred +       PerIn.krg$krige_output$var1.var)*
  (exp(PerIn.krg$krige_output$var1.var)-1)

But this back-transformation shows predictions well above 100 - the data is percentage data so the original scale does not extend beyond 100!

For example:

    > print(PerIn.krg$krige_output$var1.pred)
...
[297] 236.275600 231.036118 223.001912 212.319480 199.312973 184.456154 
...

So I tried just using exp() as follows:

PerIn.krg$krige_output$var1.pred <- exp(PerIn.krg$krige_output$var1.pred)

PerIn.krg$krige_output$var1.var <- exp(PerIn.krg$krige_output$var1.var)

Which results in more realistic predictions, but still with some values over 100:

> print(PerIn.krg$krige_output$var1.pred)
 [497] 97.465657 100.742912 103.146009 104.504026 104.671525 103.543346 

Are there any insights or suggested alternative methods (either for different transformations or back-transformation procedures)?

3
  • Due to bias you are always going to se overshoot values in a back transformation. If you dont want to truncate, research correcting bias in log back transformations. You can also observe interpolated values outside the range of the data due to the error term (nugget). Commented Oct 4, 2017 at 20:09
  • When you do the kriging estimation, you assume a gaussian error. The standard deviations calculated are in accordance with this assumption. If the outputs are not satisfactory to you, it may be that the method is not appropriate. In your case, you want to interpolate percentages, which do not have gaussian errors because truncated at zero and 100. Maybe kriging for binomial data is a way to look at. Or you can scale to [0-1] and interpolate on logit which will be between [-Inf, Inf] and is gaussian. Commented Oct 4, 2017 at 21:00
  • Thank you both for your quick suggestions. I'll explore these options later and add my results as an answer.
    – Tom Newton
    Commented Oct 5, 2017 at 9:31

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.