
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, ...)
RMmodel
or
type RFgetModelNames(type="variogram")
to get all options.
All parameters that are set to NA
will be estimated;
see the examples below.
GridTopology
or
raster
;
For more options see RFsimulateAdvanced.
RFsimulate
.coord
;
If a matrix is given then the columns are interpreted as independent
realisations.
If also a time component is given, then in the data the indices for
the spatial components run the fastest.
If an m
-variate model is used, then each realisation is given as
m
consecutive columns of data
.
param
is a vector, lower
has to be a vector as well and
its length must equal the number of parameters to be estimated. The order
of param
has to be maintained. A component being NA
means
that no manual lower bound for the corresponding parameter is set.
If param
is a list, lower
has to be of (exactly) the same
structure.
grid
is self-detected, so that grid
need not be given,
in generalparam
(except that no NA's should
be contained) or model
.
x
-coordinates, distances might
be given. The the dimension of the space dim
must be given explicitely.optim
,
which uses ‘L-BFGS-B’. However parscale
may not be given. transform=list()
is not valid for estimating, but returns
structural information to set up the correct function.
See examples below.
RFoptions
.
If x
-coordinates are not given, the function will check
data
for NA
s 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.
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)
Run the code above in your browser using DataLab