Setting control arguments
RFoptions sets and returns control arguments for the analysis
and the simulation of random fields
RFoptions(..., no.readonly = TRUE)
... |
arguments in |
no.readonly |
If |
The subsections below comment on
1. basic: Basic options
2. solve: Options for solving linear systems
3. Reserved words
1. Basic options
asListlogical. 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
coresNumber of cores for multicore algorithms; currently only used for the Cholesky decomposition.
Default : 1
cPrintlevelcPrintlevel 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
helpinfological. If TRUE then
additional information is printed for more efficient programming
in R.
kahanCorrectionlogical. If TRUE, the Kahan summation algorithm is used for
calculating scalar products.
Default: false
printlevelIf printlevel<=0
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
seedinteger (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 ith
simulation is started with the seed ‘seed+i-1’.
skipcheckslogical.
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 $
verboselogical. If FALSE it identical to
printlevel = 1 else to printlevel = 2.
2. solve: Options for solving linear systems
det_as_logeigen2zeroWhen the svd or eigen decomposition is calculated,
all values with modulus less than or equal to eigen2zero
are set to zero.
Default: 1e-12
max_cholinteger. Maximum number of rows of a matrix in a Cholesky decomposition
Default: 16384
max_svdinteger. Maximum number of rows of a matrix in a svd decomposition
Default: 10000
pivotType 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.
Default: PIVOT_NONE
pivot_actual_sizeinteger.
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.
pivot_checklogical. 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
pivot_idxvector 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
pivot_relerrorpositive number. Tolerance for (numerically) negative eigenvalues and for (numerically) overdetermined systems appearing in the pivoted Cholesky decomposition.
Default: 1e-11
pivot_max_deviationpositive 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
pivot_max_reldeviationpositive 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
solve_methodvector 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".
spam_factorinteger. See argument spam_sample_n.
Default: 4294967
spam_min_ninteger. THe minimal size for a matrix to apply a sparse matrix algorithms automatically.
Default: 400
spam_min_pnumber in (0,1) giving the proportion of zero about which an sparse matrix algorithm is used.
Default: 0.8
spam_pivotinteger. Pivoting algorithm for sparse matrices:
No pivoting
See package spam for details.
Default: PIVOTSPARSE_MMD
spam_sample_nWhether 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.
spam_tollargest absolute value being considered as zero.
Default: DBL_EPSILON
svdtolInternal.
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
use_spamShould 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
LISTLIST 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.
GETOPTIONSstring 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.
SAVEOPTIONSstring 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.
Martin Schlather, schlather@math.uni-mannheim.de, http://ms.math.uni-mannheim.de
if (FALSE) {
n <- 500
M <- matrix(rnorm(n * n), nc=n)
M <- M %*% t(M)
system.time(chol(M))
system.time(cholesky(M))
RFoptions(cores = 2)
system.time(cholesky(M))
}Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.