| fit.StVariogram {gstat} | R Documentation |
Fit a spatio-temporal sample variogram to a sample variogram
Description
Fits a spatio-temporal variogram of a given type to spatio-temporal sample variogram.
Usage
fit.StVariogram(object, model, ..., method = "L-BFGS-B",
lower, upper, fit.method = 6, stAni=NA, wles)
Arguments
object |
The spatio-temporal sample variogram. Typically output from |
model |
The desired spatio-temporal model defined through |
... |
further arguments passed to |
lower |
Lower limits used by optim. If missing, the smallest well defined values are used (mostly near 0). |
upper |
Upper limits used by optim. If missing, the largest well defined values are used (mostly |
method |
fit method, pass to |
fit.method |
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 |
stAni |
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 |
wles |
Should be missing; only for backwards compatibility, |
Details
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 = 0no fitting, however the MSE between the provided variogram model and sample variogram surface is calculated.
fit.method = 1Number of pairs in the spatio-temporal bin:
N_jfit.method = 2Number of pairs in the spatio-temporal bin divided by the square of the current variogram model's value:
N_j/\gamma(h_j, u_j)^2fit.method = 3Same as
fit.method = 1for compatibility withfit.variogrambut as well evaluated in R.fit.method = 4Same as
fit.method = 2for compatibility withfit.variogrambut as well evaluated in R.fit.method = 5Reserved for REML for compatibility with
fit.variogram, not yet implemented.fit.method = 6No weights.
fit.method = 7Number of pairs in the spatio-temporal bin divided by the square of the bin's metric distance. If
stAniis not specified, the model's parameter is used to calculate the metric distance across space and time:N_j/(h_j^2 + {\rm stAni}^2\cdot u_j^2)fit.method = 8Number of pairs in the spatio-temporal bin divided by the square of the bin's spatial distance.
N_j/h_j^2. Note that the 0 distances are replaced by the smallest non-zero distances to avoid division by zero.fit.method = 9Number of pairs in the spatio-temporal bin divided by the square of the bin's temporal distance.
N_j/u_j^2. Note that the 0 distances are replaced by the smallest non-zero distances to avoid division by zero.fit.method = 10Reciprocal of the square of the current variogram model's value:
1/\gamma(h_j,u_j)^2fit.method = 11Reciprocal of the square of the bin's metric distance. If
stAniis not specified, the model's parameter is used to calculate the metric distance across space and time:1/(h_j^2 + {\rm stAni}^2\cdot u_j^2)fit.method = 12Reciprocal of the square of the bin's spatial distance.
1/h_j^2. Note that the 0 distances are replaced by the smallest non-zero distances to avoid division by zero.fit.method = 13Reciprocal of the square of the bin's temporal distance.
1/u_j^2. Note that the 0 distances are replaced by the smallest non-zero distances to avoid division by zero.
See also Table 4.2 in the gstat manual for the original spatial version.
Value
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".
Author(s)
Benedikt Graeler
See Also
fit.variogram for the pure spatial case. extractParNames helps to understand the parameter structure of spatio-temporal variogram models.
Examples
# separable model: spatial and temporal sill will be ignored
# and kept constant at 1-nugget respectively. A joint sill is used.
## Not run:
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)
## End(Not run) # dontrun