simtub {RGeostats} | R Documentation |
Performs conditional or non-conditional simulations using Turning Bands
simtub(dbin = NA, dbout, model = model.input(), neigh = neigh.input(), uc = c("1"), mean = NA, seed = 232131, nbsimu = 1, nbtuba = 100, anam = NA, accept.fun = NA, accept.nloop.max = 10, accept.verbose=TRUE, flag.check=FALSE, radix = "Simu",modify.target = db.locmod())
dbin |
The |
dbout |
The |
model |
The |
neigh |
The |
uc |
The drift description. Use command |
mean |
Array containing the mean of each variable. |
seed |
Seed used for the generation of random numbers. When 0, the seed is not initialized. |
nbsimu |
Number of simulations |
nbtuba |
Number of turning bands |
anam |
The |
accept.fun |
An acceptation function. See details for more information. |
accept.nloop.max |
Maximum number of iterations before 'nbsimu' acceptable simulation outcomes is reached. |
accept.verbose |
When TRUE, the activity of the acceptation function is echoed. |
flag.check |
When TRUE, the Gaussian value of the conditional simulation is compared to the value of the closest data. |
radix |
Radix of the name given to the variables storing the results in the target Db. |
modify.target |
Decides whether or not the newly created variables will have their
locator defined or not. For more information, see |
The target Db where 'nbsimu' variables have been added. These variables are multiplied for each one of the data variables.
The acceptation function must have the following argument:
db db-class
containing the simulated outcome(s)
iatt Rank of the simulated outcome whole validity must be checked/
The function must return a list containing the following items:
ok which must be TRUE if the outcome is accepted or FALSE otherwise.
db which contains the returned Db (which may have been modified by the acceptation function.
When an acceptation function is provided, the simulation procedure is iterated until 'nbsimu' accepted simulations are stored. This iterative procedure is iterated until one of the following criteria is fulfilled:
The number of accepted simulations is reached
The maximum number of loops is reached
# Acceptation function: an outcome is valid if more than 90 per cent # # of its pixels have a value larger than -1 # accept <- function(db,iatt) { ok = (mean(db.extract(db,iatt) > -1) > 0.9) res = list(ok=ok, db=db) res } # Perform a conditional simulation of facies # nbsimu = 25 grid = db.create(nx=c(100,100)) model = model.create(vartype="Cubic",range=70) grid = simtub(,grid,model=model, accept.fun=accept,nbsimu=nbsimu,nbtuba=1000) grid = db.locerase(grid,"z") grid = db.compare(grid,names="Simu*",fun="mean") plot(grid,title="Average of Simulations (under constraints)",pos.legend=1) rm(grid,model,nbsimu,accept)