The Stack Overflow podcast is back! Listen to an interview with our new CEO.

Hot answers tagged

3

Package sf also provides sf::st_make_grid library(sf) library(gstat) data <- as.data.frame(data_to_analise) colnames(data)[1:3] <- c("longitude", "latitude", "z") st.sf <- st_as_sf(x = data, coords = c("longitude", "latitude"), crs=NA) colnames(st.sf)[1] <- "z" vgm1 <- gstat::variogram(z~1, st.sf) fit1 <- gstat::fit.variogram(vgm1, ...


2

Thank you very much for your help. I solved problem in such way: library(gstat) library(sp) longitude_for_data = c(32,68,89,145,176, -14, -42) latitude_for_data = c(22, 8,21,13 , 16,- 34,-12) Z_for_data = c(10,20,30,40 , 50, 60, 70) data_together = cbind(longitude_for_data,latitude_for_data,Z_for_data) data_to_analise = as.data.frame(...


2

There's massive literature for sampling schemes for spatial interpolation. Here's some thoughts: On 1: yes they will generate different empirical variograms and different kriged maps. But if the underlying data is independent of your sampling scheme then the outputs should be in agreement within standard errors. But if your data are somehow related to your ...


2

I think there's a difference in the variogram between the model fitted here with gstat and the one in the linked question. In the linked question, the model is expressed in terms of the covariance as C: C(h) = σ² = 4, if |h| = 0 C(h) = (σ² - a)exp(-3|h|/r) = (4 - 1)exp(-3|h|/6), if |h| > 0 In R, C = function(h){3*exp(-3*h/6)} And the variogram from ...


2

A common misconception is that kriging estimates may be simply exponentiated to recover the field values. Sebastien Rochette's fantastic answer on this thread explains that since the prediction of log(y) is based on a Gaussian distribution, the back-transformation following Laurent (1963) should look like this: There is a large literature on this topic, ...


1

The proj string for your newdata appears to be coordinate reference system 4326, which is in units degrees. If your data is, as you say, in units meters, then they are indeed not in identical coordinate reference systems. Try reprojecting your data to that string returned in the error first and see if that solves the problem: library(rgdal) ...


1

You have 11 points and a very flat variogram. This means there appears to be no spatial structure and your data is random noise. Any best prediction at a non-sample location is going to be the sample average. You could modify the variogram binning or variogram parameters and get something with a bit of spatial structure, but that might be more luck than ...


1

gstat can do spatial-temporal kriging, as explained here: https://www.r-bloggers.com/spatio-temporal-kriging-in-r/ . Time is just a third dimension, and you could use "elevation" data instead of time, in the same algorithms, reaching the desired output. As an alternative, although not completely native in R, Saga Gis 7.4 just implemented full 3d kriging. ...


1

The simplest thing to do to take into account the positional uncertainty would be to simulate from it, and see how that affects your measurements. So do a thousand (or maybe fewer or more...) iterations of: for each well with an imprecise location: position it uniformly at random within the grid cell compute the variogram do kriging and save the ...


1

if you have demographic data at hand, co-kriging with population density computed on the same radius would be very powerful. Otherwise, I would consider bilinear interpolation between the points, because your density is not a punctual measure.


1

Is it true that we're just using a different set of weight values than the 1/distance in IDW? Yes, both IDW interpolation and Ordinary Kriging (OK) will calculate weights based on distance, but with different criteria. In both methods, weights do not depend on sample values. The answer from Dahn Jahn in Ordinary kriging example step by step? is very ...


Only top voted, non community-wiki answers of a minimum length are eligible