autofitVariogram.dist: Automatically fitting a variogram

Description Usage Arguments

View source: R/geoR_dist_functions.R

Description

Automatically fitting a variogram to the data on which it is applied. The automatic fitting is done through fit.variogram. In fit.variogram the user had to supply an initial estimate for the sill, range etc. autofitVariogram provides this estimate based on the data and then calls fit.variogram. For details, see autofitVariogram

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
autofitVariogram.dist(
  formula,
  input_data,
  model = c("Sph", "Exp", "Gau", "Ste"),
  kappa = c(0.05, seq(0.2, 2, 0.1), 5, 10),
  fix.values = c(NA, NA, NA),
  verbose = FALSE,
  GLS.model = NA,
  start_vals = c(NA, NA, NA),
  cutoff,
  miscFitOptions = list(),
  dist.mat = NULL,
  ...
)

Arguments

formula

formula that defines the dependent variable as a linear model of independent variables; suppose the dependent variable has name 'z', for ordinary and simple kriging use the formula 'z~1'; for simple kriging also define 'beta' (see below); for universal kriging, suppose 'z' is linearly dependent on 'x' and 'y', use the formula 'z~x+y'.

input_data

An object of SpatialPointsDataFrame-class.

model

The list of variogrammodels that will be tested.

kappa

Smoothing parameter of the Matern model. Provide a list if you want to check more than one value.

fix.values

Can be used to fix a variogram parameter to a certain value. It consists of a list with a length of three. The items describe the fixed value for the nugget, range and sill respectively. They need to be given in that order. Setting the value to NA means that the value is not fixed.

verbose

logical, if TRUE the function will give extra feedback on the fitting process

GLS.model

If a variogram model is passed on through this parameter a Generalized Least Squares sample variogram is calculated.

start_vals

Can be used to give the starting values for the variogram fitting. The items describe the fixed value for the nugget, range and sill respectively. They need to be given in that order. Setting the value to NA means that the value will be automatically chosen.

cutoff

Parameter included in variogram (maximum distance of variogram). Default to diagonal * 0.35.

miscFitOptions

A list with named arguments that provide additional control over the fitting process. For example: list(merge.small.bins = TRUE). If the list is empty, autofitVariogram uses default values. The following parameters can be set:

merge.small.bins:

logical, when TRUE, the function checks if there are bins with less than 5 points. If so, the first two bins are merged and the check is repeated. This is done until all bins have more than min.np.bin points.

min.np.bin:

integer, the minimum number of points allowed in a bin before we start merging bins. See also merge.small.bins.

dist.mat

Square matrix of distances between points of the dataset ## Not implemented yet

...

parameters that are passed on to variogram when calculating the sample variogram.


statnmap/GeoDist documentation built on Feb. 4, 2020, 8:34 p.m.