mleRF {RandomFields}R Documentation

Maximum Likelihood Estimation of Random Field Parameters

Description

This function estimates arbitrary parts of the parameter vector of a random field specification by maximising the likelihood.

Usage

mleRF(coord, data, model, param, lower.kappa=NULL, upper.kappa=NULL,
      sill=NA, ...) 

mleRF.default(coord, data, model, param, lower.kappa=NULL,
              upper.kappa=NULL, sill=NA,
              use.naturalscaling=TRUE, PrintLevel=0, trace.optim=0,
              bins=20, distance.factor=0.5, upperbound.scale.factor=10,
              lowerbound.scale.factor=20, lowerbound.scale.LS.factor=5,
              upperbound.var.factor=10, lowerbound.var.factor=100,
              lowerbound.sill=1e-10, scale.max.relative.factor=1000,
              minbounddistance=0.001, minboundreldist=0.02,
              approximate.functioncalls=50, pch="*")

Arguments

coord (n x 2)-matrix of coordinates.
data vector of values measured at coord.
model string; covariance model, see CovarianceFct, or type PrintModelList() to get all options.
param vector of parameters for a random field specification: param=c(mean, variance, nugget, scale,...); the parameters must be given in this order. Further parameters are to be added in case of a parametrised class of covariance functions, see CovarianceFct. Any components set to NA are estimated; the others are kept fix.
lower.kappa lower bounds for additional parameters of a parametrised class.
upper.kappa upper bounds for additional parameters of a parametrised class.
sill If not NA the sill is kept fix. See Details.
... arguments as given in mleRF.default and listed in the following.
use.naturalscaling logical. If TRUE then internally, rescaled covariance functions will be used for which cov(1)~=0.05. See Details.
PrintLevel level to which messages are shown. See Details.
trace.optim tracing of the function optim
bins number of bins of the empirical variogram. See Details.
distance.factor relative right bound for the bins. See Details.
upperbound.scale.factor relative upper bound for scale. See Details.
lowerbound.scale.factor relative lower bound for scale. See Details.
lowerbound.scale.LS.factor relative lower bound for scale in an auxiliary function call. See Details.
upperbound.var.factor relative upper bound for variance and nugget. See Details.
lowerbound.var.factor relative lower bound for variance and nugget. See Details.
lowerbound.sill absolute lower bound for variance and nugget. See Details.
scale.max.relative.factor relative lower bound for scale below which an additional nugget effect is detected. See Details.
minbounddistance absolute distance to the bounds below which a part of the algorithm is considered as having failed. See Details.
minboundreldist relative distance to the bounds below which a part of the algorithm is considered as having failed. See Details.
approximate.functioncalls approximate evaluations of the ML target function on a grid. See Details.
pch character shown before each step of calculation; depending on the specification there are two to five steps. Default: "*".

Details

The maximisation is performed using optim. Since optim needs as input parameter an initial vector of parameters, mleRF estimates this initial parameter first using an auxiliary target function, namely weighted least squares for the empirical variogram.

If the best parameter vector of the MLE found so far is too close to some given bounds, see the specific parameters below, it is assumed that optim ran into a local minimum because of a bad starting value by the auxiliary target function. In this case the MLE target function is calculated on a grid, the best parameter vector is taken, and the optimisation is restarted with this parameter vector.

Comments on specific parameters:

Another maximum likelihood estimator for random fields exists as part of the package geoR whose homepage is at http://www.maths.lancs.ac.uk/~ribeiro/geoR.html. However, the philosophies of mleRF and likfit of the package geoR differ. The function likfit offers more possibilities and higher flexibility concerning co-variates and value transformations, for example. By way of contrast, mleRF is still restricted to estimating parts of the parameter vector of a random field (as a consistent part of the package RandomFields). However, mleRF allows for estimating any combination of the components of this parameter vector. In case both functions can be used, the parameters estimated by likfit and mleRF agree in about 95 percent of the cases. Concerning the remaining cases, likfit beats mleRF more frequently than vice versa; however mleRF does not need initial values for the optimisation, and the code of mleRF is in general faster.

Value

A vector of the form c(mean,variance,nugget,sill,...) is returned, i.e. the parameter vector of the ML estimation including the fixed components. Here, the dots ... stand for additional parameters of the covariance model, see CovarianceFct.

Acknowledgement

Thanks to Paulo Ribeiro for hints and comparing mleRF to likfit of the package geoR whose homepage is at http://www.maths.lancs.ac.uk/~ribeiro/geoR.html.

Note

This function does not depend on the value of RFparameters()$PracticalRange. The function mleRF always uses the standard specification of the covariance model as given in CovarianceFct.

Author(s)

Martin Schlather, Martin.Schlather@uni-bayreuth.de http://www.geo.uni-bayreuth.de/~martin

References

Ribeiro, P. and Diggle, P. (2001) Software for geostatistical analysis using R and S-PLUS: geoR and geoS, version 0.6.15. http://www.maths.lancs.ac.uk/~ribeiro/geoR.html.

See Also

CovarianceFct, GetPracticalRange, RandomFields.

Examples

 model <-"expon"
 param <- c(0,1,0,1)
 estparam <- c(NA,NA,0,NA) ## NA means here: "to be estimated"
 ## sequence in `estparam' is
 ## mean, variance, nugget, scale, (+ further model parameters)
 ## So, mean, variance, and scale will be estimated here.
 ## Nugget is fixed and equals zero.
 points <- 100
 x <- runif(points,0,3)
 y <- runif(points,0,3) ## 100 random points in square [0, 3]^2
 f <- GaussRF(x=x, y=y, grid=FALSE, model=model, param=param)
 mleRF(coord=cbind(x,y), data=f, model=model, param=estparam)

[Package Contents]