data: A d-dimensional vector (a single spatial realisation) or a (dxd)-matrix (a single spatial realisation on regular grid) or an (dxdxn)-array (n iid spatial realisations on regular grid) or a (txd)-matrix (a single spatial-temporal realisation) or an (dxdxt)-array (a single spatial-temporal realisation on regular grid). See GeoFit for details.
coordx: A numeric (dx2)-matrix or (dx3)-matrix Coordinates on a sphere for a fixed radius radius
are passed in lon/lat format expressed in decimal degrees.
coordy: A numeric vector giving 1-dimension of spatial coordinates; Optional argument, the default is NULL.
coordz: A numeric vector giving 1-dimension of spatial coordinates; Optional argument, the default is NULL.
coordt: A numeric vector giving 1-dimension of temporal coordinates. Optional argument, the default is NULL then a spatial random field is expected.
coordx_dyn: A list of m numeric (dx2)-matrices containing dynamical (in time) spatial coordinates. Optional argument, the default is NULL
corrmodel: String; the name of a correlation model, for the description (see GeoFit).
distance: String; the name of the spatial distance. The default is Eucl, the euclidean distance. See the Section Details
of GeoFit.
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 list(nugget=0) the nugget effect is ignored.
grid: Logical; if FALSE (the default) the data are interpreted as a vector or a (nxd)-matrix, instead if TRUE then (dxdxn)-matrix is considered.
maxdist: A numeric value denoting the maximum distance, see Details in GeoFit.
neighb: Numeric; an optional positive integer indicating the order of neighborhood. See Details and GeoFit
maxtime: Numeric; an optional positive value indicating the maximum temporal lag considered.See Details and GeoFit.
model: String; the type of random field. Gaussian is the default, see GeoFit for the different types.
optimizer: String; the optimization algorithm (see optim for details). 'Nelder-Mead' is the default.
numbins: A numeric value denoting the numbers of bins, see the Section Details
radius: Numeric; a value indicating the radius of the sphere when using the great circle distance. Default value is the radius of the earth in Km (i.e. 6371)
start: A named list with the initial values of the parameters that are used by the numerical routines in maximization procedure. NULL is the default (see GeoFit).
weighted: Logical; if TRUE then the weighted least square estimator is considered. If FALSE (the default) then the classic least square is used.
optimization: Logical; if TRUE then the weighted least square minimization is performed. Otherwise the weighted least square function is evaluated at the starting value.
Details
The numbins parameter indicates the number of adjacent intervals to consider in order to grouped distances with which to compute the (weighted) lest squares.
The maxdist parameter indicates the maximum distance below which the shorter distances will be considered in the calculation of the (weigthed) least squares.
Returns
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;
message: Extra message passed from the numerical routines;
model: The type of random fields;
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 spatial-temporal variogram;
weighted: A logical value indicating if its the weighted method;
wls: The value of the least squares at the minimum.
References
Cressie, N. A. C. (1993) Statistics for Spatial Data. New York: Wiley.
Gaetan, C. and Guyon, X. (2010) Spatial Statistics and Modelling. Spring Verlang, New York.
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 <-0sill <-1nugget <-0scale <-0.15/3param <- 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)