Setting control arguments

RFoptions sets and returns control arguments for the analysis and the simulation of random fields

RFoptions(..., no.readonly = TRUE)

arguments in tag = value form, or a list of tagged values.


If RFoptions is called without argument then all arguments are returned in a list. If no.readonly=TRUE then only rewritable arguments are returned. Currenlty all arguments are rewritable. So the list is empty.


The subsections below comment on 1. basic: Basic options 2. solve: Options for solving linear systems 3. Reserved words

1. Basic options


logical. Lists of arguments are treated slightly different from non-lists. If asList=FALSE they are treated the same way as non-lists. This options being set to FALSE after calling RFoptions it should be set as first element of a list.

Default: TRUE


Number of cores for multicore algorithms; currently only used for the Cholesky decomposition.

Default : 1


cPrintlevel is automatically set to printlevel when printlevel is changed. Standard users will never use a value higher than 3.

0 : no messages 1 : messages and warnings when the user's input looks odd 2 : messages (and internal errors) documenting the choice of the simulation method 3 : further user relevant informations 4 : information on recursive function calls 5 : function flow information of central functions 6 : errors that are internally treated 7 : details on building up the covariance structure 8 : details on taking the square root of the covariance matrix 9 : details on intermediate calculations 10 : further details on intermediate calculations

Note that printlevel works on the R level whereas cPrintlevel works on the C level.

Default: 1


logical. If TRUE then additional information is printed for more efficient programming in R.


logical. If TRUE, the Kahan summation algorithm is used for calculating scalar products.

Default: false


If printlevel\(\le0\) there is not any output on the screen. The higher the number the more tracing information is given. Standard users will never use a value higher than 3.

0 : no messages 1 : important (error) messages and warnings 2 : less important messages 3 : details, but still for the user 4 : recursive call tracing 5 : function flow information of large functions 6 : errors that are internally treated 7 : details on intermediate calculations 8 : further details on intermediate calculations

Default: 1


integer (currently only used by the package RandomFields). If NULL or NA set.seed is not called. Otherwise, set.seed(seed) is set before any simulations are performed.

If the argument is set locally, i.e., within a function, it has the usual local effect. If it is set globally, i.e. by RFoptions the seed is fixed for all subsequent calls.

If the number of simulations n is greater than one and if RFoptions(seed=seed) is set, the \(i\)th simulation is started with the seed ‘seed\(+i-1\)’.


logical. If TRUE, several checks whether the given parameter values and the dimension are within the allowed range is skipped. Do not change the value of this variable except you really know what you do.

Default: FALSE $


logical. If FALSE it identical to printlevel = 1 else to printlevel = 2.

2. solve: Options for solving linear systems

% to do


When the svd or eigen decomposition is calculated, all values with modulus less than or equal to eigen2zero are set to zero.

Default: 1e-12


integer. Maximum number of rows of a matrix in a Cholesky decomposition

Default: \(16384\)


integer. Maximum number of rows of a matrix in a svd decomposition

Default: \(10000\)


Type of pivoting for the Cholesky decomposition. Possible values are


No pivoting.


If the matrix has a size greater than 3x3 and Choleskey fails without pivoting, privoting is done. For matrices of size less than 4x4, no pivoting and no checks are performed. See also PIVOT_DO


Do always pivoting. NOTE: privoted Cholesky decomposition yields only very approximately an upper triangular matrix L, but still L^t L = M holds true.


uses the same pivoting as in the previous pivoted decomposition. This option becomes relevant only when simulations with different parameters or different models shall be performed with the same seed so that also the pivoting must be coupled.

% \item{PIVOT_IDXBACK}{ same as \code{PIVOT_IDX}, but % the sequence of indices of the pivoting is returned via % \code{RFoptions()$solve$pivot_idx}.}



integer. Genuine dimension of the linear mapping given by a matrix in cholx. This is a very rarely used option when pivoting with pivot=PIVOT_IDX.


logical. Only used in pivoted Cholesky decomposition. If TRUE and a numerically zero diagonal element is detected, it is checked whether the offdiagonal elements are numerically zero as well. (See also pivot_max_deviation and pivot_max_reldeviation.) If NA then only a warning is given.

Default: TRUE


vector of integer. Sequence of pivoting indices in pivoted Cholesky decomposition. Note that pivot_idx[1] gives the number of indices that will be used. The vector must have at least the length pivot_idx[1] + 1.

Default: NULL


positive number. Tolerance for (numerically) negative eigenvalues and for (numerically) overdetermined systems appearing in the pivoted Cholesky decomposition.

Default: 1e-11


positive number. Together with pivot_max_reldeviation it determines when the rest of the matrix (eigenvalues) in the pivoted Cholesky decomposition are considered as zero.

Default: 1e-10


positive number. Together with pivot_max_deviation it determines when the rest of the matrix (eigenvalues) in the pivoted Cholesky decomposition are considered as zero.

Default: 1e-10


vector of at most 3 integers that gives the sequence of methods in order to inverse a matrix or to calculate its square root: "cholesky", "svd", "eigen" "sparse", "method undefined". In the latter case, the algorithm decides which method might suit best.

Note that if use_spam is not false the algorithm checks whether a sparse matrix algorithm should be used and which is then tried first.

Default: "method undefined".


integer. See argument spam_sample_n.

Default: 4294967


integer. THe minimal size for a matrix to apply a sparse matrix algorithms automatically.

Default: 400


number in \((0,1)\) giving the proportion of zero about which an sparse matrix algorithm is used.

Default: 0.8


integer. Pivoting algorithm for sparse matrices:


No pivoting



See package spam for details.



Whether a matrix is sparse or not is tested by a ‘random’ sample of size spam_sample_n; The selection of the sample is iteratively obtained by multiplying the index by spam_factor modulo the size of the matrix.

Default: 500.


largest absolute value being considered as zero. Default: DBL_EPSILON


Internal. When the svd decomposition is used for calculating the square root of a matrix then the absolute componentwise difference between this matrix and the square of the square root must be less than svdtol. No check is performed if svdtol is not positive.

Default: 0


Should the package spam (sparse matrices) be used for matrix calculations? If TRUE spam is always used. If FALSE, it is never used. If NA its use is determined by the size and the sparsity of the matrix.

Default: NA.

3. Reserved Words


LIST usually equals the output of RFoptions(). This argument is used to reset the RFoptions. Some of the options behave differently if passed through LIST. E.g. a warning counter is not reset. The argument LIST cannot be combined with any other arguments.


string vector of prefixes that indicate classes of options. In this package they can be "basic" and "solve". (E.g. package RandomFields has many more classes of options.) The given classes of options are then returned by RFoptions(). Note that the values are the previous values.

GETOPTIONS must always be the very first argument.


string vector of prefixes. Same as for GETOPTIONS, except that important classes are always returned and thus should not be given. Hence SAVEOPTIONS is often a convenient short cut for GETOPTIONS. The class always included in this package is "basic", in package RandomFields these are the two classes "basic" and "general".

SAVEOPTIONS must always be the very first argument. In particular, it may not given at the same time with GETOPTIONS.


NULL if any argument is given, and the full list of arguments, otherwise.

  • RFoptions
if (FALSE) {
  n <- 500
  M <- matrix(rnorm(n * n), nc=n)
  M <- M %*% t(M)
  RFoptions(cores = 2)

# }
Documentation reproduced from package RandomFieldsUtils, version 0.5.3, License: GPL (>= 3)

Community examples

Looks like there are no examples yet.