[R-sig-Geo] spplot : Computing variances of prediction with log-transformed data in R
Edzer Pebesma
edzer.pebesma at uni-muenster.de
Wed Oct 30 18:24:34 CET 2013
Dear Emmanuel, you may want to look into what gstat::krigeTg does, it
might be close or identical to what you want.
On 10/30/2013 03:47 PM, baremma2002 wrote:
> Dear users,
>
> How can I compute the variances of prediction (ordinary kriging) using
> log-transformed data in R:
>
> library(gstat)
> library(sp)
> data(meuse)
> coordinates(meuse)=~x+y
> data(meuse.grid)
> gridded(meuse.grid) = ~x+y
> modv <- vgm(psill=0.5, model="Sph", range=900, nug = 0)
> fitv <- fit.variogram(variogram(log(zinc)~ 1,meuse),model=modv)
> res <- krige(log(zinc) ~ 1, meuse, meuse.grid,model = fitv)
>
> Suppose the observed process Z(s) is the variable "zinc". If we assume that
> Y(s) = log Z(s)
> is a Gaussian process where s is a space-point, we can write:
>
> res <- krige(Y(s) ~ 1, meuse, meuse.grid,model = fitv)
>
> Moreover, Y(s) = mean(Y) + delta(s)
>
> where delta(s) is intrinsically stationary with mean 0. Ordinary Kriging on
> the Y-scale yields kriging coefficients lambdaY and Lagrange multiplier mY.
> Then the best linear predictor of Y(s0) is
>
> pY(s0) = lambdaY Y
>
> and the kriging variance is
>
> var(Y(s0) = SUM(lambdaY semivar(s0-si) + MUY
>
> Cressie (1993) proposed this formula to compute the unbiased predictor for
> variances (mean-squared prediction error,) back on the Z-scale, of Z(s0):
>
> var = {exp(2mean(Y) + var(Y(s0))}{exp(var(Y(s0)) + exp(var(pY(s0))) -
> 2exp(cov(Y(s0),pY(s0))} ;
>
> The last term is the covariance between the observed and the predicted data
> at the space-point s0. However, suppose that this variable is observed at 10
> space-points. The predicted values will be at the other points where the
> values are unknown. The covariance will be equal to zero and var will be a
> constant. The kriging is exact interpolator and the predicted values are
> equal to the observed values at the observed points and the covariance will
> be equal to zero. Is it true? How can I compute this variance in R with
> back-transformed data? Thanks.
>
> Emmanuel BARANKANIRA
>
>
>
>
> --
> View this message in context: http://r-sig-geo.2731867.n2.nabble.com/spplot-Computing-variances-of-prediction-with-log-transformed-data-in-R-tp7584987.html
> Sent from the R-sig-geo mailing list archive at Nabble.com.
>
> _______________________________________________
> 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
Heisenbergstraße 2, 48149 Münster, Germany. Phone: +49 251
83 33081 http://ifgi.uni-muenster.de GPG key ID 0xAC227795
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 555 bytes
Desc: OpenPGP digital signature
URL: <https://stat.ethz.ch/pipermail/r-sig-geo/attachments/20131030/3e19dbaa/attachment.bin>
More information about the R-sig-Geo
mailing list