| GeoWLS | R Documentation |
the function returns the parameter estimates of a Gaussian random field obtained by the weighted least squares estimator.
GeoWLS(data, coordx, coordy=NULL,coordz=NULL, coordt=NULL, coordx_dyn=NULL, corrmodel,
distance="Eucl", fixed=NULL, grid=FALSE, maxdist=NULL,neighb=NULL,
maxtime=NULL, optimizer='Nelder-Mead',
numbins=NULL, radius=1, start=NULL, weighted=FALSE,optimization=TRUE,
numbins_t=NULL)
data |
A |
coordx |
A numeric ( |
coordy |
A numeric vector giving 1-dimension of
spatial coordinates; Optional argument, the default is |
coordz |
A numeric vector giving 1-dimension of
spatial coordinates; Optional argument, the default is |
coordt |
A numeric vector giving one dimension of temporal coordinates. Optional argument; the default is |
coordx_dyn |
A list of |
corrmodel |
String; the name of a correlation model, for the
description (see |
distance |
String; the name of the spatial distance. The default is |
fixed |
A named list giving the values of the parameters that
will be considered as known values. The listed parameters for a
given correlation function will be not estimated, i.e. if
|
grid |
Logical; if |
maxdist |
A numeric value denoting the maximum distance, see
|
neighb |
Numeric; an optional positive integer indicating the
order of neighborhood. See |
maxtime |
Numeric; an optional positive maximum temporal lag, expressed in the same units as |
optimizer |
String; the optimization algorithm
(see |
numbins |
Historical GeoModels argument giving the number of spatial bin boundaries; |
numbins_t |
Optional positive integer giving the number of temporal classes for irregularly spaced |
radius |
Numeric; a value indicating the radius of the sphere when using the great circle distance. Default value is 1. |
start |
A named list with the initial values of the
parameters that are used by the numerical routines in maximization
procedure. |
weighted |
Logical; if |
optimization |
Logical; if |
GeoWLS is defined for Gaussian random fields and therefore does
not expose a model argument. Its native least-squares kernels compare
the empirical variogram with the Gaussian variogram parameterized by nugget,
sill, and the selected correlation model.
The historical numbins parameter gives the number of spatial bin
boundaries, so numbins - 1 spatial classes are used. For
spatio-temporal data, regular temporal coordinates are handled from their
common spacing without constructing all pairwise temporal differences;
irregular temporal coordinates use numbins_t temporal classes.
Empty empirical cells are retained in the rectangular spatial-temporal lag grid and are skipped by the least-squares objective through their zero pair count. This preserves the correspondence between empirical cells and their spatial/temporal lags.
The maxdist parameter indicates the positive finite maximum distance
below which pairs are considered in the (weighted) least squares.
Returns an object of class WLS.
An object of class WLS is a list containing
at most the following components:
bins |
Adjacent intervals of grouped distances; |
bint |
Adjacent intervals of grouped temporal separations |
centers |
The centers of the bins; |
coordx |
The vector or matrix of spatial coordinates; |
coordy |
The vector of spatial coordinates; |
coordt |
The vector of temporal coordinates; |
convergence |
A string that denotes if convergence is reached; |
corrmodel |
The correlation model; |
data |
The vector or matrix of data; |
distance |
The type of spatial distance; |
fixed |
The vector of fixed parameters; |
iterations |
The number of iteration used by the numerical routine; |
maxdist |
The maximum spatial distance used for the calculation of the variogram used in least square estimation. If no spatial distance is specified then it is NULL; |
maxtime |
The maximum temporal distance used for the calculation of the variogram used in least square estimation. If no temporal distance is specified then it is NULL; |
numbins_t |
The requested number of temporal classes for irregular time coordinates, or |
message |
Extra message passed from the numerical routines; |
numcoord |
The number of spatial coordinates; |
numtime |
The number the temporal realisations of the random field; |
param |
The vector of parameters' estimates; |
variograms |
The empirical spatial variogram; |
variogramt |
The empirical temporal variogram; |
variogramst |
The empirical spatio-temporal variogram; |
weighted |
A logical value indicating if its the weighted method; |
wls |
The value of the least squares at the minimum. |
Moreno Bevilacqua, moreno.bevilacqua89@gmail.com,https://sites.google.com/view/moreno-bevilacqua/home, Víctor Morales Oñate, victor.morales@uv.cl, https://sites.google.com/site/moralesonatevictor/, Christian Caamaño-Carrillo, chcaaman@ubiobio.cl,https://www.researchgate.net/profile/Christian-Caamano
Cressie, N. A. C. (1993) Statistics for Spatial Data. New York: Wiley.
Gaetan, C. and Guyon, X. (2010) Spatial Statistics and Modelling. Springer-Verlag, New York.
GeoFit, optim
library(GeoModels)
# Set the coordinates of the sites:
set.seed(211)
x <- runif(200, 0, 1)
set.seed(98)
y <- runif(200, 0, 1)
coords <- cbind(x,y)
################################################################
###
### Example 1. Least square fitting of a Gaussian random field
### with exponential correlation.
###
###############################################################
# Set the model's parameters:
corrmodel <- "Exponential"
mean <- 0
sill <- 1
nugget <- 0
scale <- 0.15/3
param <- list(mean=0,sill=sill, nugget=nugget, scale=scale)
# Simulation of the Gaussian random field:
set.seed(2)
data <- GeoSim(coordx=coords, corrmodel=corrmodel, param=param)$data
fixed=list(nugget=0,mean=mean)
start=list(scale=scale,sill=sill)
# Least square fitting of the random field:
fit <- GeoWLS(data=data,coordx=coords, corrmodel=corrmodel,
fixed=fixed,start=start,maxdist=0.5)
# Results:
print(fit)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.