





















Dear all,

I have some soil moisture measurements
distributed in the basin and I’m trying to find the best simulation method for
my data through the cross validation. I started with the tutorial of Meuse
dataset that implemented in gstat. In the case of
predictions, the cross validation is straight forward:

> lzn.kriged = krige(log(zinc) ~ 1,
meuse, meuse.grid, model = lzn.fit) 

[using ordinary kriging]

>
spplot(lzn.kriged["var1.pred"]) 

> spplot(lzn.kriged["var1.var"])


> str(lzn.kriged )

Formal class 'SpatialPixelsDataFrame'
[package "sp"] with 7 slots

 
..@ data       :'data.frame':            3103
obs. of  2 variables:

 
.. ..$ var1.pred: num [1:3103] 6.5 6.62 6.51 6.39 6.76 ...

 
.. ..$ var1.var : num [1:3103] 0.32 0.252 0.273 0.296 0.178 ...

 
..@ coords.nrs : num(0) 

 
..@ grid       :Formal class 'GridTopology'
[package "sp"] with 3 slots

 
.. .. ..@ cellcentre.offset: Named num [1:2] 178460 329620

 
.. .. .. ..- attr(*, "names")= chr [1:2] "x"
"y"

 
.. .. ..@ cellsize         : Named num [1:2]
40 40

 
.. .. .. ..- attr(*, "names")= chr [1:2] "x"
"y"

 
.. .. ..@ cells.dim        : Named int [1:2] 78 104

 
.. .. .. ..- attr(*, "names")= chr [1:2] "x"
"y"

 
..@ grid.index : int [1:3103] 69 146 147 148 223 224 225 226 300 301 ...

 
..@ coords    
: num [1:3103, 1:2] 181180 181140 181180 181220 181100 ...

 
.. ..- attr(*, "dimnames")=List of 2

 
.. .. ..$ : NULL

 
.. .. ..$ : chr [1:2] "x" "y"

 
..@ bbox       : num [1:2, 1:2] 178440 329600
181560 333760

 
.. ..- attr(*, "dimnames")=List of 2

 
.. .. ..$ : chr [1:2] "x" "y"

 
.. .. ..$ : chr [1:2] "min" "max"

 
..@ proj4string:Formal class 'CRS' [package "sp"] with 1 slots

 
.. .. ..@ projargs: chr NA

 

In the case of simulations it works also as
follows:

> lzn.condsim = krige(log(zinc) ~ 1,
meuse, meuse.grid, model = lzn.fit, 

+ 
nmax = 30, nsim = 4) 

drawing 4 GLS realisations of beta...

[using conditional Gaussian simulation]

>  spplot(lzn.condsim, main = "three
conditional simulations")

When I put

> str(lzn.condsim)

It shows the following:

Formal class 'SpatialPixelsDataFrame'
[package "sp"] with 7 slots

 
..@ data       :'data.frame':            3103
obs. of  4 variables:

 
.. ..$ sim1: num [1:3103] 6.12 6.58 5.98 5.66 5.92 ...

 
.. ..$ sim2: num [1:3103] 6.68 6.65 7.01 6.29 6.65 ...

 
.. ..$ sim3: num [1:3103] 5.43 5.32 6.22 5.75 6.85 ...

 
.. ..$ sim4: num [1:3103] 5.91 5.88 6.09 5.82 6.64 ...

 
..@ coords.nrs : num(0) 

 
..@ grid       :Formal class 'GridTopology'
[package "sp"] with 3 slots

 
.. .. ..@ cellcentre.offset: Named num [1:2] 178460 329620

 
.. .. .. ..- attr(*, "names")= chr [1:2] "x"
"y"

 
.. .. ..@ cellsize         : Named num [1:2]
40 40

 
.. .. .. ..- attr(*, "names")= chr [1:2] "x"
"y"

 
.. .. ..@ cells.dim        : Named int [1:2] 78 104

 
.. .. .. ..- attr(*, "names")= chr [1:2] "x"
"y"

 
..@ grid.index : int [1:3103] 69 146 147 148 223 224 225 226 300 301 ...

 
..@ coords    
: num [1:3103, 1:2] 181180 181140 181180 181220 181100 ...

 
.. ..- attr(*, "dimnames")=List of 2

 
.. .. ..$ : NULL

 
.. .. ..$ : chr [1:2] "x" "y"

 
..@ bbox       : num [1:2, 1:2] 178440 329600
181560 333760

 
.. ..- attr(*, "dimnames")=List of 2

 
.. .. ..$ : chr [1:2] "x" "y"

 
.. .. ..$ : chr [1:2] "min" "max"

 
..@ proj4string:Formal class 'CRS' [package "sp"] with 1 slots

 
.. .. ..@ projargs: chr NA

 

In the case of prediction I have the
variance (lzn.kriged$ var1.var) and residual (lzn.kriged$ residual) directly,
but How can I determine the best simulation (sim1,sim2 ….) for my data doing
the cross validation, I did not find var1.var and lzn.condsim$residuals in the lzn.condsim.



 Thanks,

Ageel

 

 

 

 

 





      
	[[alternative HTML version deleted]]

