Guest User

Untitled

a guest
Nov 21st, 2018
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.92 KB | None | 0 0
  1. library(gstat)
  2. library(sp)
  3.  
  4. p = SpatialPoints(cbind(c(0,0,3),c(0,2,1)))
  5. p$z = c(10,7,3)
  6. krige(z~1, p, SpatialPoints(cbind(1,1)), vgm(psill=3, nugget=1, range=6, "Exp"))
  7.  
  8. #Results
  9. [using ordinary kriging]
  10. coordinates var1.pred var1.var
  11. 1 (1, 1) 6.813431 2.002507
  12.  
  13. σ²ε = sill - [w1 ... wn λ] [C10]
  14. |...|
  15. |Cn0|
  16. [1 ]
  17.  
  18. C(h) = σ² = 4, if |h| = 0
  19. C(h) = (σ² - a)exp(-3|h|/r) = (4 - 1)exp(-3|h|/6), if |h| > 0
  20.  
  21. C = function(h){3*exp(-3*h/6)}
  22.  
  23. VC = function(h){4-C(h)}
  24.  
  25. VCgstat = vgm(psill=3, nugget=1, range=6, "Exp")
  26. plot(variogramLine(VCgstat,maxdist=50), type="l")
  27. lines(0:50, VC(0:50), col="red")
  28.  
  29. VCgstat2 = vgm(psill=3, nugget=1, range=2, "Exp")
  30.  
  31. > krige(z~1, p, SpatialPoints(cbind(1,1)), vgm(psill=3, nugget=1, range=2, "Exp"))
  32. [using ordinary kriging]
  33. coordinates var1.pred var1.var
  34. 1 (1, 1) 6.887426 3.136307
Add Comment
Please, Sign In to add comment