simtub {RGeostats}R Documentation

Performs Simulations

Description

Performs conditional or non-conditional simulations using Turning Bands

Usage

simtub(dbin = NA, dbout, model = model.input(), neigh = neigh.input(), 
uc = c("1"), mean = NA, seed = 232131, domain=0, nbsimu = 1, nbtuba = 100,
accept.fun = NA, accept.nloop.max = 10, accept.verbose=TRUE,
radix = "Simu",modify.target = db.locmod())

Arguments

dbin

The db-class structure containing the data file. This file is optional. If absent, non-conditional simulations are performed.

dbout

The db-class structure containing the target file

model

The model-class structure containing the Model information.

neigh

The neigh-class structure containing the Neighborhood information. This structure is compulsory for conditional simulations.

uc

The drift description. Use command uc.names for details.

mean

Array containing the mean of each variable.

seed

Seed used for the generation of random numbers. When 0, the seed is not initialized.

domain

When (strictly) positive, it corresponds to the reference domain value. If a Db attribute is defined as a Domain variable in a Db file, a sample will be selected only if the corresponding Domain variable is equal to the reference domain value. This Domain selection can serve as a secondary selection for the sample in the Input Db or as a mask in the Output Db.

nbsimu

Number of simulations

nbtuba

Number of turning bands

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.

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 db.locmod.

Value

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:

The function must return TRUE if the outcome is accepted or FALSE otherwise. 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:

Examples

# Acceptation function #
accept <- function(db,iatt) 
{
  (mean(db.extract(db,iatt) > -1) > 0.9)
}

# 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.compare(grid,names="Simu*",fun="mean")
plot(grid,title="Average of Simulations (under constraints)",pos.legend=1)

rm(grid,model,nbsimu,accept)

[Package RGeostats version 11.1.2 Index]