Questions tagged [gstat]

An R package that provides support for performing spatial and spatio-temporal geostatistical modelling, prediction and simulation.

Filter by
Sorted by
Tagged with
0
votes
0answers
18 views

R gstat krige() NA predictions increasing with larger nmax

I've been playing around with a King County house dataset posted on Kaggle (link: https://www.kaggle.com/harlfoxem/housesalesprediction) and tried to predict house prices with Kriging. The entire ...
1
vote
1answer
62 views

R kriging raster returns NA for some prediction points?

I am trying to interpolate a raster layer of chlorophyll-a data using kriging (gstat::krige) in R, however the resulting interpolation is showing NA values in a peculiar straight line through the ...
0
votes
1answer
42 views

After I give kring command, this error comes up: data item in gstat object and newdata have different coordinate reference systems

> library(gstat) > library(readxl) > library(sp) > library(rgdal) #2013(FATALITIES) data <- read.csv("C:/Users/sbs/Desktop/Study/RA/Accident analysis/New folder/Iowa total crashes ...
0
votes
1answer
133 views

R - IDW interpolation using gstat

It contains two coordinate columns dist for distance in x direction and rel_alt for an altitude in y direction. The other two columns are the data points for each combination of those two coordinate ...
-1
votes
1answer
40 views

Default parameter values in r's gstat idw?

In r, gstat has an Inverse distance weighted (IDW) interpolation method. Does anyone know what the default values of nmin, nmax and maxdist are?
0
votes
1answer
340 views

How kriging variance is calculated in R gstat?

How does exactly the krige function (a wrapper to gstat and predict functions) from package gstat calculate kriging variance (minimized estimation variance) in Ordinary Kriging? I wanted to reproduce ...
1
vote
0answers
65 views

Error in Universal Kriging using gstat package in R [closed]

I am trying to perform universal kriging in R using the gstat package and running into the following error: krige(formula = CDD_LT_stC ~ Imperv1km + Elev_new, locations = sp.cal_data, newdata = sp....
1
vote
1answer
38 views

Kriging for unevenly spaced points using R?

I started to read about Kriging and the implementation into R. In all the tutorials I found, a (regular) grid is used to do ordinary or universal kriging. My situation is as follows, I try to ...
0
votes
1answer
123 views

gstat variogram errors

I am at a complete loss on what I am doing wrong here. I am trying to build a variogram. No matter what i do i get errors. My Data: id lon lat datetime ...
5
votes
1answer
136 views

Cokriging: zero distance cross-semivariance in undersampled cases [gstat error]

Trying to cokrige two variables that are not perfectly colocated (one has sparser measurements than the other), I faced an issue that I'll illustrate with the following MRE. With the meuse dataset, ...
0
votes
0answers
71 views

Cokriging, Zero distance semivariance in cross-variogram error

Trying cokriging with simulated data, I faced a problem that did not seem one in the demo(cokriging) with the meuse dataset: I can't use fit.lmc() default but need to specify fit.method=1 as the ...
0
votes
1answer
152 views

Calculating coefficient of variation from gstat output to create uncertainty map in R

I was asked by my supervisor to create uncertainty maps of kriging interpolation based on the coefficient of variation ((sd/mean)*100%). I used krige function from gstat package to perform the ...
5
votes
1answer
1k views

Kriging example with sf object

I am new to geo spacial analysis. I would like to learn kriging from a simple example. Say, we have four points with some z value. library(sf) library(gstat) library(tidyverse) dt<-tibble::...
0
votes
1answer
158 views

Error in gstat.formula.predict(d$formula, newdata, na.action = na.action, : NROW(locs) != NROW(X): this should not occur

I'm trying to perform regression kriging using the code creating variogram m <- vgm(var(soil$Ba), "Sph", sqrt(areaSpatialGrid(slope))/4, nugget=0) v <- fit.variogram(variogram(Ba~RASTERVALU, ...
0
votes
1answer
130 views

spatio temporal anisotropy in R: stAni argument in vgmST and krigeST

I have some problems in understanding the usage of argument 'stAni' of vgmST and krigeST functions, for the setting of spatio temporal anisotropy. How have I to interpret this argument, that is the ...
4
votes
1answer
233 views

Preparing dataset to perform co-kriging in R gstat?

This is the first time I'm using co-kriging in gstat. My problem is that I'm not sure how to prepare the data frame to supply to co-kriging when the variable of interest and auxiliary variables are ...
2
votes
0answers
81 views

Spatial Downscaling of global temperature in R?

I am interested in spatial downscaling of global temperature to grid cell. What I have is a vector of future annual global temperature values which I would like to downscale to (hopefully) 0.5°. ...
3
votes
1answer
220 views

Error in fit.variogram.gls method of gstat package in R

I was trying to fit the variogram parameters of an empirical variogram using GLS (Generalized Least Squares) fitting method. I used the 'fit.variogram.gls' method of the 'gstat' package in R. I tried ...
1
vote
1answer
259 views

R, Gstat predict() error

I'm trying to use gstat to predict spatially autocorrelated random variables. I'm using these sea surface temperature data. I first fit a variogram model and use this in predict. The approach works ...
1
vote
1answer
175 views

how to predict on hold on test sample using krige.cv from gstat R toolbox?

I am using the 'krige.cv' function from the gstat toolbox in R. It does not take any 'newdata' as input for prediction ( as in universal kriging). How can I predict using the fitted model from this ...
1
vote
0answers
86 views

How to obtain nugget parameter from fit.variogram in gstat? [closed]

I have the following code where I fit a variogram using gstat. vA = variogram(dep_var~elevation=x+y, data, cressie=TRUE) vmodel = vgm("Sph") vB = fit.variogram(vA,vmodel) How can I get the nugget ...
0
votes
1answer
915 views

Create a rainfall raster with gstat or idw in R

I am a beginner in R, I need to use gstat or idw function to get a rainfall raster, but I have an error in the formula. How can I change it? This is my code: setwd("C:/Users/A/Desktop/...
1
vote
1answer
1k views

Fit Variogram Iteration Warning

I would like to perform kriging using a variable call "Secchi.Disk" from a data set I have. However, when fitting the variogram I get the following warming message Warning message: In fit.variogram(v,...
0
votes
1answer
2k views

Raster Interpolation

I have a three column dataset with LAT, LON and Temperature data I would like to produce a raster image that predicts the temperature of the landscape based on 24 data logger data points. The dataset ...
1
vote
1answer
628 views

Error in Kriging function

I am using gstat::krige to interpolate a data set of arund 2700 points. However I get an error message "Error in seq.default(zrng[1], zrng[2], length.out = cuts + 2):'from' must be a finite number" ...
4
votes
2answers
1k views

How to achieve parallel Kriging in R to speed up the process?

I have tried the gstat package in R to perform bathymetry predictions based on Kriging interpolation methods. However, the process is very time consuming due the large amount of sampling data I'm ...
4
votes
2answers
707 views

Backtransformation of kriging predictions and variances

I'm not sure how to back-transform log-normal kriged results. This example using the "meuse" data shows how to make variogram and use it to get kriging predictions (and variances) using the popular '...
1
vote
0answers
63 views

Determining covariance of irregularly spaced spatial data in R?

I'm comparing concentration C of a contaminant in the same spatial region at two time point 2000 and 2010 with sample size of N_2000 = 51 and N_2010 = 26 (not all the samples are from the same ...
3
votes
1answer
2k views

R 'gstat - Warning: singular model in variogram fit

I am trying to perform a kriging interpolation. But when it comes to the point when i want to fit the variogram to the model I get the following warning: In fit.variogram(vario, vgm("Sph")) : singular ...
1
vote
2answers
655 views

How do I get the fitted values and/or residuals in fit.variogram() function of gstat package of R?

I am trying to do some diagnostics after fitting a variogram model to my empirical variogram using fit.variogram() function in gstat package of R. I need to get a hold of residuals and the fitted ...
8
votes
1answer
2k views

R gstat krige() - Covariance matrix singular at location [5.88,47.4,0]: skipping

When I want to perform the kriging it only works sometimes, depending on what values I use in my datatable. As a result of the krige function I get for var1.pred: NA NA NA ... and var1.var: NA NA NA .....
2
votes
0answers
308 views

gstat's krige.cv() error: “Error: dimensions do not match:”

I am using krige.cv() for cross validation of a data set with 1394 locations. In my code, empirical variogram estimation, model fitting, and kriging (by krige()) everything works fine. But when I use ...
2
votes
1answer
2k views

Ignoring NA values when computing variogram in R?

I am trying to compute a variogram with the R gstat package: > variogram(yield_cleaned~1, data= newdf) but it turns out: Error in .local(obj, ...) : NA values in coordinates My dataset has ...
2
votes
1answer
161 views

weighting scheme of gstat for fitting models to variograms

I use R and the gstat package to construct variograms of temperature, and I would like to ask If anyone knows what weighting scheme does the gstat package use to fit a model to the sample variogram?
6
votes
1answer
368 views

Cell declustering using open-source software

I want to perform cell declustering in a small point data set. I have 9 observation points and I want to find the size of the region of influence for an observation, and afterwards use that as ...
9
votes
3answers
2k views

Spatio-temporal block kriging with R package gstat?

In the documentation of sp I saw that the coords argument of the SpatialPolygons function only accepts 2 columns. Is it not possible to create 3-dimensional polygons? I am doing spatio-temporal ...