Advertisement
Guest User

Untitled

a guest
Feb 18th, 2020
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
R 1.45 KB | None | 0 0
  1. siatka <- read_stars("simulation.tif")
  2. paleta <-  hcl.colors(12, palette = "ag_Sunset")
  3.  
  4. # Kriging prosty - losowe
  5. sk_random <-  gstat::krige(values ~ 1,
  6.                      locations = random_sample,
  7.                      newdata = siatka,
  8.                      model = model_random,
  9.                      beta = mean(random_sample$values))
  10. plot(sk_random["var1.pred"], col = paleta)
  11.  
  12. # Kriging prosty - preferencyjne
  13. sk_pref <-  gstat::krige(values ~ 1,
  14.                      locations = pref_sample,
  15.                      newdata = siatka,
  16.                      model = fitted_pref,
  17.                      beta = mean(pref_sample$values))
  18. plot(sk_pref["var1.pred"], col = paleta)
  19.  
  20. # Kriging prosty - preferencyjne po rozgrupowaniu losowym
  21. sk_pref_rand <-  gstat::krige(values ~ 1,
  22.                          locations = decl_pref,
  23.                          newdata = siatka,
  24.                          model = fitted_pref_rand,
  25.                          beta = mean(decl_pref$values))
  26. plot(sk_pref_rand["var1.pred"], col = paleta)
  27.  
  28. # Kriging prosty - dla próbkowania preferencyjnego po rozgrupowaniu losowym na podstawie modelu próbkowania preferencyjnego
  29. sk_model_pref <- gstat::krige(values~1,
  30.                               locations = pref_sample,
  31.                               newdata = siatka,
  32.                               model = fitted_pref,
  33.                               beta = mean(decl_pref$values))
  34. plot(sk_model_pref["var1.pred"], col = paleta)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement