View source: R/diagnostics_sim.R
| tulpa_variogram | R Documentation |
Computes the empirical semivariogram in distance bins for visual assessment of remaining spatial structure in residuals.
tulpa_variogram(
object,
coords,
n_bins = 15L,
max_dist = NULL,
resid_type = "pearson"
)
## S3 method for class 'tulpa_variogram'
plot(x, ...)
## S3 method for class 'tulpa_variogram'
print(x, ...)
object |
A fitted model, or a numeric vector of residuals |
coords |
N x 2 coordinate matrix (required) |
n_bins |
Number of distance bins (default 15) |
max_dist |
Maximum distance (default: half the maximum pairwise distance) |
resid_type |
Residual type if extracting from model (default |
x |
A |
... |
Passed to |
A tulpa_variogram data.frame with columns dist, gamma, n_pairs
plot() draws the semivariance against distance, point size scaled
by the pair count, and returns x invisibly.
set.seed(1)
coords <- cbind(runif(60), runif(60))
tulpa_variogram(rnorm(60), coords, n_bins = 5)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.