STFDF结构时空数据:如何生成可识别Nugget、Sill、Range的Variogram plot
The default plots you’re using (plot(vario, map=FALSE) or wireframe) show combined spatio-temporal relationships, which are great for exploring overall patterns but not for isolating the key variogram parameters. To identify nugget, sill, and range, you need to focus on pure spatial (fixed time lag = 0) or pure temporal (fixed spatial lag = 0) variogram profiles—these mirror the classic 2D variogram format we use for spatial-only data.
Step 1: Extract Target Variogram Profiles
First, filter your STVariogram object to isolate either spatial or temporal lags:
Pure Spatial Variogram (Time Lag = 0)
This shows how semivariance changes with spatial distance when there’s no time difference between observations:
# Filter to keep only pairs with zero time lag spatial_only <- vario[vario$time.lag == 0, ] # Plot the raw semivariance points plot(spatial_only$dist, spatial_only$gamma, xlab = "Spatial Lag (distance)", ylab = "Semivariance", main = "Pure Spatial Variogram", pch = 16, col = "steelblue")
Pure Temporal Variogram (Spatial Lag = 0)
This shows semivariance changes over time for observations at the same spatial location:
# Filter to keep only pairs with zero spatial lag temporal_only <- vario[vario$dist == 0, ] # Plot the raw semivariance points plot(temporal_only$time.lag, temporal_only$gamma, xlab = "Temporal Lag (time units)", ylab = "Semivariance", main = "Pure Temporal Variogram", pch = 16, col = "darkorange")
Step 2: Fit a Variogram Model (Optional but Recommended)
To make parameter identification even clearer, fit a theoretical variogram model to your filtered data using fit.variogramST from the gstat package:
Example for Spatial Profile
# Define a theoretical spatial model (e.g., spherical) spatial_model <- vgmST("separable", spatial = vgm(psill = 1, model = "Sph", range = 100, nugget = 0.2)) # Fit the model to your pure spatial data spatial_fit <- fit.variogramST(spatial_only, model = spatial_model) # Add the fitted line to your plot lines(spatial_fit, col = "red", lwd = 2)
Step 3: Identify the Parameters
Once you have the 2D plot (raw points + fitted line), you can easily spot the three key values:
- Nugget: The semivariance value when the lag distance is 0 (y-intercept of the fitted model). This represents measurement error or micro-scale variation.
- Sill: The plateau value where the semivariance stops increasing (the maximum y-value the model reaches). This equals the total variance of your data minus the nugget.
- Range: The lag distance where the semivariance reaches ~95% of the sill (for spherical models) or ~63% (for exponential models). Beyond this distance, observations are no longer spatially/temporally correlated.
Alternative: Direct Plotting with which Parameter
You can also use the built-in plot method for STVariogram objects and specify the which argument to focus on specific profiles:
# Plot only the pure spatial variogram plot(vario, which = "spatial", main = "Pure Spatial Variogram") # Plot only the pure temporal variogram plot(vario, which = "temporal", main = "Pure Temporal Variogram")
This generates clean 2D plots that let you directly read off nugget, sill, and range just like you would with a standard spatial variogram.
内容的提问来源于stack exchange,提问作者Reta

