https://github.com/cran/RandomFields
Revision a88578bf75299850a5f3ff3efba8d520c28d6a81 authored by Martin Schlather on 26 April 2005, 00:00:00 UTC, committed by Gabor Csardi on 26 April 2005, 00:00:00 UTC
1 parent b2f6358
Tip revision: a88578bf75299850a5f3ff3efba8d520c28d6a81 authored by Martin Schlather on 26 April 2005, 00:00:00 UTC
version 1.2.10
version 1.2.10
Tip revision: a88578b
extremes.R
## it does not make sense to me at the moment that a space-time model
## for extremes is defined.
"InitMaxStableRF" <-
function(x, y = NULL, z = NULL, grid, model, param, maxstable,
method = NULL, register = 0, gridtriple = FALSE)
{
MaxStableList <- c("extremalGauss","BooleanFunction")
stopifnot(length(maxstable)==1)
MaxStableNr <- pmatch(maxstable,MaxStableList)
if (is.na(MaxStableNr)) stop(paste("Unknown max-stable random field",
"\nPossible values for `maxstable': \"",
paste(MaxStableList,collapse="\", \""),
"\"",sep=""))
if (MaxStableNr==2) {
if (is.null(method)) method <- "max.MPP"
else{
if (!is.character(method) || (length(method)==0))
stop("Method must be a string.")
if (.C("GetMethodNr",as.character(method),
as.integer(1), nr = integer(1), PACKAGE="RandomFields")$nr
!=
.C("GetMethodNr",as.character("max.MPP"),
as.integer(1), nr = integer(1), PACKAGE="RandomFields")$nr) {
warning("Method does not match max-stable random field definition. Set to `max.MPP'.")
method <- "max.MPP"
}
}
}
return(InitSimulateRF(x=x, y=y, z=z, grid=grid, model=model, param=param,
method=method, register=register,
gridtriple=gridtriple,
distribution="MaxStable")
)
}
"MaxStableRF" <-
function (x, y = NULL, z = NULL, grid, model, param, maxstable,
method = NULL, n = 1, register = 0, gridtriple = FALSE, ...)
{
old.param <- RFparameters(no.readonly=TRUE)
if (n>1 && !old.param$Storing) {
RFparameters(Storing=TRUE)
}
RFpar <- list(...)
if (length(RFpar)>0) RFparameters(RFpar)
on.exit({RFparameters(old.param);
if (!old.param$Storing) DeleteRegister(register)})
error <- InitMaxStableRF(x=x, y=y, z=z, grid=grid, model=model, param=param,
maxstable=maxstable, method=method,
register=register, gridtriple=gridtriple)
if (error > 0) stop(paste("InitMaxStable: error", error, "occured"))
return(DoSimulateRF(n=n, reg=register, paired=FALSE))
}
Computing file changes ...