
Last chance! 50% off unlimited learning
Sale ends in
Fits a spatio-temporal variogram of a given type to spatio-temporal sample variogram.
fit.StVariogram(object, model, ..., method = "L-BFGS-B",
lower, upper, fit.method = 6, stAni=NA, wles)
Returns a spatio-temporal variogram model, as S3 class StVariogramModel. It carries the temporal and spatial unit as attributes "temporal unit"
and "spatial unit"
in order to allow krigeST
to adjust for different units. The units are obtained from the provided empirical variogram. Further attributes are the optim output "optim.output"
and the always not weighted mean squared error "MSE"
.
The spatio-temporal sample variogram. Typically output from variogramST
The desired spatio-temporal model defined through vgmST
.
further arguments passed to optim
. extractParNames
provides the parameter structure of spatio-temporal variogram models that help to provide sensible upper
and lower
limits.
Lower limits used by optim. If missing, the smallest well defined values are used (mostly near 0).
Upper limits used by optim. If missing, the largest well defined values are used (mostly Inf
).
fit method, pass to optim
an integer between 0 and 13 determine the fitting routine (i.e. weighting of the squared residuals in the LSE). Values 0 to 6 correspond with the pure spatial version (see fit.variogram
). See the details section for the meaning of the other values (partly experimental).
The spatio-temporal anisotropy that is used in the weighting. Might be missing if the desired spatio-temporal variogram model does contain a spatio-temporal anisotropy parameter (this might cause bad convergence behaviour). The default is NA
and will be understood as identity (1 temporal unit = 1 spatial unit). As this only in very few cases a valid assumption, a warning is issued.
Should be missing; only for backwards compatibility, wles = TRUE
corresponds to fit.method = 1
and wles = FALSE
corresponds to fit.method = 6
.
Benedikt Graeler
The following list summarizes the meaning of the fit.method
argument which is essential a weighting of the squared residuals in the least-squares estimation. Please note, that weights based on the models gamma value might fail to converge properly due to the dependence of weights on the variogram estimate:
fit.method = 0
no fitting, however the MSE between the provided variogram model and sample variogram surface is calculated.
fit.method = 1
Number of pairs in the spatio-temporal bin:
fit.method = 2
Number of pairs in the spatio-temporal bin divided by the square of the current variogram model's value:
fit.method = 3
Same as fit.method = 1
for compatibility with fit.variogram
but as well evaluated in R.
fit.method = 4
Same as fit.method = 2
for compatibility with fit.variogram
but as well evaluated in R.
fit.method = 5
Reserved for REML for compatibility with fit.variogram
, not yet implemented.
fit.method = 6
No weights.
fit.method = 7
Number of pairs in the spatio-temporal bin divided by the square of the bin's metric distance. If stAni
is not specified, the model's parameter is used to calculate the metric distance across space and time:
fit.method = 8
Number of pairs in the spatio-temporal bin divided by the square of the bin's spatial distance.
fit.method = 9
Number of pairs in the spatio-temporal bin divided by the square of the bin's temporal distance.
fit.method = 10
Reciprocal of the square of the current variogram model's value:
fit.method = 11
Reciprocal of the square of the bin's metric distance. If stAni
is not specified, the model's parameter is used to calculate the metric distance across space and time:
fit.method = 12
Reciprocal of the square of the bin's spatial distance.
fit.method = 13
Reciprocal of the square of the bin's temporal distance.
See also Table 4.2 in the gstat manual for the original spatial version.
fit.variogram
for the pure spatial case. extractParNames
helps to understand the parameter structure of spatio-temporal variogram models.
# separable model: spatial and temporal sill will be ignored
# and kept constant at 1-nugget respectively. A joint sill is used.
if (FALSE) {
separableModel <- vgmST("separable",
method = "Nelder-Mead", # no lower & upper needed
space=vgm(0.9,"Exp", 123, 0.1),
time =vgm(0.9,"Exp", 2.9, 0.1),
sill=100)
data(vv)
separableModel <- fit.StVariogram(vv, separableModel,
method="L-BFGS-B",
lower=c(10,0,0.01,0,1),
upper=c(500,1,20,1,200))
plot(vv, separableModel)
} # dontrun
Run the code above in your browser using DataLab