Learn R Programming

geoR (version 1.0-0)

likfit.old: Likelihood Estimation for Gaussian Random Fields

Description

This function estimates the parameters of a (transformed) Gaussian random field using either maximum likelihood (ML) or restricted maximum likelihood (REML). Includes option for the estimation the Box-Cox transformation parameter. This is a earlier version of the function likfit and it will be made obsolete.

Usage

likfit(geodata, coords=geodata$coords, data=geodata$data,
       trend = "cte", ini, fix.nugget = FALSE, nugget = 0, 
       cov.model = c("exponential", "matern", "gaussian",
                     "spherical", "circular", "cubic", "wave",
                     "powered.exponential", "cauchy", "gneiting",
                     "gneiting.matern", "pure.nugget"),
       kappa = 0.5, fix.lambda = TRUE, lambda = 1, method = "ML", 
       predicted = FALSE, residuals = FALSE, 
       minimisation.function = c("optim","nlmP", "nlm"),
       automatic.refit = FALSE, range.limits,
       messages.screen = TRUE, ...)

Arguments

geodata
a list containing the elements coords and data as described next. If not provided the arguments coords and data must be provided instead.
coords
an $n \times 2$ matrix containing in each row Euclidean coordinates of the n data locations. By default it takes the element coords of the argument geodata.
data
a vector with data values. By default it takes the element data of the argument geodata.
trend
specifies the mean part of the model. The options are: "cte" (constant mean - the default option), "1st" (a first degree polynomial on the coordinates), "2nd" (a second degree polynomial on the coordinate
ini
initial values of the covariance parameters. These values are used to start the numerical minimizer. If the model to be fitted has the following 3 parameters: nugget ($\tau^2$), sill ($\sigma^2$) and range ($\phi$), ini should be
fix.nugget
logical, indicating whether or not the nugget parameter must be included in the estimation. If fix.nugget = T the argument ini must be a vector of length 2 or a matrix with 2 columns
nugget
value for the nugget parameter when fix.nugget = TRUE. Defaults to zero.
cov.model
correlation function model. See documentation for the function cov.spatial.
kappa
extra smoothness parameter required if one of the following correlation function is used: "matern", "powered.exponential", "gneiting" or "gneiting.matern"). For more details see documentati
fix.lambda
If TRUE, the default, the transformation parameter is regarded as fixed (known) during the estimation process, otherwise the ML/REML for this parameter is also computed.
lambda
the value of the Box-Cox transformation parameter. Two particular cases are $\lambda = 1$ which corresponds to no transformation and $\lambda = 0$ corresponding to the log-transformation. The value of the transformation parameter $\lambda$
method
"ML" defines maximum likelihood and "REML" defines restricted maximum likelihood. Defaults to "ML".
predicted
a matrix with the values for the components of the predicted values at the data locations as defined by the model adopted.
residuals
a matrix with values for the components of the random part of the model at the data locations.
automatic.refit
Defaults to FALSE. If set to TRUE the model is automatically changed and re-fitted in the following cases:
  • if the model includes the nugget and if the estimated relative nugget is less than 0.01, the model w
minimisation.func
minimization function to be used. Options are "optim", the default, "nlmP" and "nlm".
range.limits
minimum and maximum values allowed for the parameter $\phi$, the range parameter. Defaults to c(0, +Inf).
messages.screen
logical. Indicates whether or not status messages are printed on the screen (or output device) while the function is running.
...
additional parameters to be passed to the minimization function. Typically control type arguments which controls the behavior of the minimization algorithm. For further details see documentation for the minimization functions.

Value

  • An object of the class variomodel which is a list with the following components:
  • cov.modela string with the name of the correlation function.
  • nuggetvalue of the nugget parameter $\tau^2$. This is the estimated value if fix.nugget = FALSE or the fixed (known) value if fix.nugget = TRUE.
  • cov.parsa 2 elements vector with the estimated values of the partial sill and range parameter, respectively.
  • kappathe fixed value of the smoothness parameter required by some of the correlation functions.
  • betaestimated mean parameters. Can be a scalar or vector depending on the specification of the trend part of the model (covariates).
  • beta.varestimated variance (or covariance matrix) of the mean parameter.
  • lambdaBox-Cox transformation parameter. A fixed (know) value if fix.lambda = TRUE or the estimated value if fix.lambda = FALSE.
  • loglikthe value of the maximized likelihood.
  • nparsnumber of estimated parameters.
  • AICvalue of the Akaike information criteria.
  • BICvalue of the Bayesian information criteria.
  • trend.olstrend (mean parameters) estimated by ordinary least squares (i.e. ignoring the spatial correlation).
  • info.lambdastores information about the Box-Cox transformation parameter. Typically this is used by other functions which process the output of likfit.old().
  • methodestimation method used, "ML" (maximum likelihood) or "REML" (restricted maximum likelihood).
  • s2estimated residual variance. Only returned if predicted = TRUE or residuals = TRUE.
  • predictedpredicted values at data locations. Only returned if predicted = TRUE.
  • residualsestimated residuals at data locations. Only returned if residuals = TRUE.
  • inforesults returned by the minimization function.
  • max.distmaximum distance between two data locations. Typically this value is used by other functions which process results from likfit.old().
  • trend.matrixthe trend (covariates) matrix.
  • callthe function call.

Details

The random field model considered here has the following parameters:
  • the mean parameter$\beta$,
  • the covariance parameters: partial sill$\sigma^2$and range parameter$\phi$,
  • the smoothness parameter$\kappa$,
  • the nugget parameter$\tau^2$,
  • the Box-Cox transformation parameter$\lambda$,
  • and the anisotropy parameters: anisotropy angle$\psi_A$and anisotropy ratio$\psi_R$,
However not all of them can be estimated using this function. For this current implementation:
  1. the parameters$\beta$,$\sigma^2$,$\phi$are always estimated;
  2. the parameters$\tau^2$,$\lambda$can be estimated or considered fixed;
  3. the parameters$\kappa$,$\alpha$,$\psi$are always regarded as fixed values.

References

Further information about geoR can be found at: http://www.maths.lancs.ac.uk/~ribeiro/geoR.html.

See Also

summary.variomodel, plot.variogram, lines.variogram, and lines.variomodel for graphical output. Profile likelihoods can be computed by proflik. olsfit and wlsfit performs variogram based estimation while krige.bayes performs Bayesian inference. For details about the minimization functions see the documentation for optim and nlm.

Examples

Run this code
if(is.R()) data(s100)
ml <- likfit(s100, ini=c(.5, .5), fix.nug=T)
summary(ml)
reml <- likfit(s100, ini=c(.5, .5), fix.nug=T, met="REML")
summary(reml)
plot(variog(s100))
lines(ml)
lines(reml, lty=2)

Run the code above in your browser using DataLab