| RFfit {RandomFields} | R Documentation |
The function estimates arbitrary parameters of a random field specification with various methods. Currenty, the model to be fitted can be
The fitting of max-stable random fields and others has not been implemented yet.
RFfit(model, x, y = NULL, z = NULL, T = NULL, grid=NULL, data, lower = NULL, upper = NULL, methods, sub.methods, optim.control = NULL, users.guess = NULL, distances = NULL, dim, transform = NULL, ...)
model |
covariance model, see All parameters that are set to |
x |
vector of x coordinates, or object
of class |
y |
vector of y coordinates |
z |
vector of z coordinates |
T |
vector of T coordinates; these coordinates are given in
triple notation, see |
data |
vector or matrix of values measured at If an |
lower |
list or vector. Lower bounds for the parameters.
If If |
upper |
list or vector. Upper bounds for the parameters. See also lower. |
grid |
boolean. Whether coordinates build a grid. In nearly all cases
the value of |
methods |
Main methods to be used for estimating. If several methods, estimation will be performed with each method and the results reported. |
sub.methods |
variants of the least squares fit of the variogram. See Details. variants of the maximum likelihood fit of the covariance function. See Details. |
users.guess |
User's guess of the parameters. All the parameters must be given
using the same rules as for either |
distances,dim |
Instead of |
optim.control |
control list for |
transform |
this is an attempt to allow binding between parameters, e.g. one parameter value is supposed to equal another one, See examples below.
|
... |
further options and control arguments for the simulation
that are passed to and processed by |
For details on the simulation methods see
If x-coordinates are not given, the function will check
data for NAs and will perform imputing.
The function has many more options to tune the optimizer,
see RFoptions for details.
If the model defines a Gaussian random field, the options
for methods and submethods are currently
"ml" and c("self", "plain", "sqrt.nr", "sd.inv",
"internal"),
respectively.
The result depends on the logical value of
spConform.
If TRUE, an S4 object is greated. In case the model indicates
a Gaussian random field, an
RFfit object is created.
If spConform=FALSE, a list is returned.
In case the model indicates
a Gaussian random field, the details are given in fitgauss.
An important optional argument is boxcox which indicates
A Box-Cox transformation see boxcox in RFoptions
and RFboxcox for details.
Instead of optim, other optimiser can be used,
see RFfitOptimiser.
Several advanced options can be found in sections ‘General
options’ and ‘fit’ of RFoptions.
In particular, boxcox, boxcox_lb, boxcox_ub
allow Box-Cox transformation.
This function does not depend on the value of
RFoptions()$PracticalRange.
The function RFfit always uses the standard specification
of the covariance model as given in RMmodel
Martin Schlather, schlather@math.uni-mannheim.de http://ms.math.uni-mannheim.de/de/publications/software
Burnham, K. P. and Anderson, D. R. (2002) Model selection and Multi-Model Inference: A Practical Information-Theoretic Approach. 2nd edition. New York: Springer.
RFfitOptimiser
RFlikelihood,
RFratiotest,
RMmodel,
RandomFields,
weather.
RFoptions(seed=0) ## *ANY* simulation will have the random seed 0; set
## RFoptions(seed=NA) to make them all random again
RFoptions(modus_operandi="sloppy")
#########################################################
## simulate some data first ##
points <- 100
x <- runif(points, 0, 3)
y <- runif(points, 0, 3) ## random points in square [0, 3]^2
model <- RMgencauchy(alpha=1, beta=2)
d <- RFsimulate(model, x=x, y=y, grid=FALSE, n=100) #1000
#########################################################
## estimation; 'NA' means: "to be estimated" ##
estmodel <- RMgencauchy(var=NA, scale=NA, alpha=NA, beta=2) +
RMtrend(mean=NA)
RFfit(estmodel, data=d)
#########################################################
## coupling alpha and beta ##
estmodel <- RMgencauchy(var=NA, scale=NA, alpha=NA, beta=NA) +
RMtrend(NA)
RFfit(estmodel, data=d, transform = NA) ## just for information
trafo <- function(a) c(a[1], rep(a[2], 2))
fit <- RFfit(estmodel, data=d,
transform = list(c(TRUE, TRUE, FALSE), trafo))
print(fit)
print(fit, full=TRUE)