Learn R Programming

RandomFields (version 3.0.62)

RFoptions: Setting control arguments

Description

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

Usage

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

Arguments

...
arguments in tag = value form, or a list of tagged values.
no.readonly
If RFoptions is called without argument then all arguments are returned in a list. If no.readonly=TRUE then only rewritable arguments are returned.

Value

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

    if no.readonly=FALSE then additionally, a list called readonly is included containing * covmaxchar: the maximum length of a model name * covnr: number of currently implemented variogram/covariance models (-1 means that none of the functions like RFsimulate, RFfit , etc., have been called yet.) * distrmaxchar: max. name length for a distribution * distrnr: number of currently implemented distributions * maxdim: maximum number of dimensions for a random field * maxmodels: maximum number of elementary models in definition of a complex covariance model * methodmaxchar: max. name length for methods * methodnr: number of currently implemented simulation methods

bold

  • 9. gauss: Options for simulating Gaussian random fields
  • 10. graphics: Options for graphical output
  • 11. gui: Options for cRFgui
  • 12. hyper: Options for simulating hyperplane tessellations
  • 13. krige: Options for Kriging
  • 14. maxstable: Options for simulating max-stable random fields
  • 15. mpp: Options for the random coins (shot noise) methods
  • 16. nugget: Options for the nugget effect

describe

  • about_zeroIn certain cases (Coins,RMtruncsupport), functions are assumed to zero if the value is less than about_zero. Default: 0.001 .
  • n_estim_Einteger. Number of draws from the distribution of the scale to estimate the mean of the distribution. This is used only if the mean of the scale distribution is not explicitely given. Default: 50000 .
  • scatter_size, scatter_maxUsed in function RMscatter that calculates $\sum_{i=1}^n f(x + h_i)$ for some function $f$ and for some distances $h_i$. Real valued and integer valued, respectively, or NA. Let $\varepsilon=$about_zero, $s=$scatter_size and $m=$scatter_max. We distinguish 4 cases:
    • scatter_size > 0andscatter_max >= 0 Here,$n$equals$(2m)^d$. and$h_i \in M = { (k s, \ldots, k s),\ldots, (m s, \ldots, m s)}$with$k=-m$.
    • scatter_size > 0andscatter_max < 0 same as the previous case, but$m$is chosen such that$f(k_i e_i s_i) \approx \varepsilon$,$-k_i\in N$,$i=1,\ldots,d$and$f(m_i e_i s_i) \approx \varepsilon$,$m \in N$.
    • scatter_size <= 0<="" code="">andscatter_max >= 0 This option is possible only for grids. Here$h_i$runs on the given grid$i=1,\ldots,d$, but at mostscatter_maxsteps.
    • scatter_size <= 0<="" code="">andscatter_max < 0 this option is possible only for grids. Here,$h_i$runs over the whole grid.
  • shape_powerShape functions are powered by shape_power before used as intensity function for the point process. Default: 2.0.

Details

The subsections below comment on 1. general: General options 2. br: Options for Brown-Resnick Fields 3. circulant: Options for circulant embedding methods RPcirculant 4. coords: Options for coordinates and units, see coordinate systems 5. direct: Options for simulating by simple matrix decomposition 6. distr: Options for distributions, in particular RRrectangular 7. empvario: Options for calculating the empirical variogram 8. fit: Options for RFfit, RFratiotest, and RFcrossvalidate 9. gauss: Options for simulating Gaussian random fields 10. graphics: Options for graphical output 11. gui: Options for RFgui 12. hyper: Options for simulating hyperplane tessellations 13. krige: Options for Kriging 14. maxstable: Options for simulating max-stable random fields 15. mpp: Options for the random coins (shot noise) methods 16. nugget: Options for the nugget effect 17. registers: Register numbers 18. sequ: Options for the sequential method 19. special: Options for some special methods 20. spectral: Options for the spectral (turning bands) method 21. tbm: Options for the turning bands method 22. internal: Internal General comments 1. General options [object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]2. Options for Brown-Resnick Fields [object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object] 3. circulant: Options for circulant embedding methods, cf. RPcirculant These options influence the standard circulant embedding method, cutoff circulant embedding intrinsic circulant embedding. It can also influence RPtbm if the line is simulated with any circulant embedding method. [object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]4. coords: Options for coordinates and units [object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]5. direct: Options for simulating by simple matrix decomposition [object Object],[object Object],[object Object]6. distr: Options for distributions, in particular RRrectangular [object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]7. empvario: Options for calculating the empirical variogram [object Object],[object Object],[object Object],[object Object],[object Object] 8. fit: Options for RFfit, RFratiotest, and RFcrossvalidate

[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Default: 'respect bound'.

refine_onborder{logical. If TRUE and an estimated parameter of the model is close to the boundary, a second search for the optimum is started.

Default: TRUE } minmixedvar{ lower bound for variance in a mixed model; so, the covariance model for mixed model part might be calibrated appropriately

Default: 1/1000 } solvesigma{Logical. -- experimental stage! If a mixed effect part is present where the variance has to be estimated, then this variance parameter is solved iteratively within the profile likelihood function, if solvesigma=TRUE.This makes sense if the number of independent variables is very small. If solvesigma=FALSE then the variance parameter is treated as any other parameter to be estimated.

Default: FALSE. } ratiotest_approx{logical. if TRUE the approximative formula that twice the difference of the likelihoods follow about a $\chi^2$ distribution is used. The parameter of freedom equals the number of parameters to be estimated for the covariance function, including those for the covariates.

Default: TRUE } reoptimise{logical. If TRUE && !only_users then at a very last step, the optimisation is redone with currently best parameters and likelihood as scale parameter for optim. Default: TRUE. }

scale_max_relative_factor{ If the initial scale value for the ML estimation obtained by the LSQ target function is less than $(minimum distance between different pairs of points) /$ scale_max_relative_factor a warning is given that probably a nugget effect is present. Note: if scale_max_relative_factor is greater than lowerbound_scale_ls_factor then no warning is given as the scale has the lower bound $(minimum distance between different pairs of points) /$ lowerbound_scale_ls_factor. Default: 1000 }

scale_ratio{ RFfit uses parscale and fnscale in the calls of optim. As these arguments should have the magnitude of the estimated values, RFfit checks this by calculating the absolute log ratios. If they are larger than scale_ratio, parscale and fnscale are reset and the optimisation is redone. Default: 0.1. } shortnamelength{ The names of the variables in the returned table are abbreviated by taking the first shortnamelength letters. Default: 4. } sill{ Additionally to estimating nugget and variance separately, they may also be estimated together under the condition that nugget + variance = sill. For the latter a finite value for sill has to be supplied, and nugget and variance are set to NA. sill is only used for the standard model. Default: NA. }

smalldataset{ If the number of locations is considered as small, then some more data are kept in the storage to accelerate the estimation algorithm. Default: 2000. } split{logical. If TRUE then RFfit checks whether a space-time covariance model or a multivariate covariance model can be split into components, so that certain parameters can be estimated separately. Default: TRUE. } splitn_neighbours{integer. In case the maximum number of locations maxn is exceeded, then RFfit tries to split the data set into parts of size split or less, but never more than maxn. Default: c(3000, 200, 1000). } splitfactor_neighbours{ The total number of neighbouring boxes in each direction $1 + 2\code{splitfactor}$, including the current box itself. Default: 2. } split_refined{logical. If TRUE then also submodels are fitted if splitted. This takes more time, but anova and RFratiotest, for instance, will give additional information.

Default: TRUE. } upperbound_scale_factor{ The upper bound for the scale is determined as

upperbound_scale_factor * (maximum distance between all pairs of points). Default: 3. } upperbound_var_factor{ The upper bound for the variance and the nugget is determined as upperbound_var_factor * var(data) Default: 10. }

use_naturalscaling{ logical. Only used if model is given in standard (simple) way. If TRUE then internally, rescaled covariance functions will be used for which cov(1)$\approx$0.05. use_naturalscaling has the advantage that scale and the form parameters of the model get orthogonal, but use_naturalscaling does not work for all models. Note that this argument does not influence the output of RFfit: the parameter vector returned by RFfit refers always to the standard covariance model as given in RMmodel. (In contrast to practicalrange in RFoptions.) Advantages if use_naturalscaling=TRUE:

  • scaleand the shape parameter of a parameterised covariance model can be estimated better if they are estimated simultaneously.
  • The estimated bounds calculated by means ofupperbound_scale_factorandlowerbound_scale_factor, etc. might be more realistic.
  • in case of anisotropic models, the inverse of the elements of the anisotropy matrix should be in the above bounds.
Disadvantages if use_naturalscaling=TRUE:
  • For some covariance models with additional parameters, the rescaling factor has to be determined numerically. Then, more time is needed to performRFfit.
Default: TRUE. }

use_spam{ 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. }

References

  • General
    • Schlather, M. (1999)An introduction to positive definite functions and to unconditional simulation of random fields.Technical report ST 99-10, Dept. of Maths and Statistics, Lancaster University.
    • Schlather, M. (2011) Construction of covariance functions and unconditional simulation of random fields. In Porcu, E., Montero, J.M. and Schlather, M.,Space-Time Processes and Challenges Related to Environmental Problems.New York: Springer. % \item Schlather, M. (2002) Models for stationary max-stable
  • rectangular distribution;eps_zhou
    • Oesting, M., Schlather, M. and Zhou, C. (2013) On the Normalized Spectral Representation of Max-Stable Processes on a compact set.arXiv,1310.1813
  • shape_power
    • Ballani, F. and Schlather, M. (2015) In preparation.

See Also

RFsimulate, RFoptionsAdvanced, RandomFields, and RFgetMethodNames.

Examples

Run this code
RFoptions(seed=0) ## *ANY* simulation will have the random seed 0; set
##                   RFoptions(seed=NA) to make them all random again
RFoptions()


############################################################
##                                                        ## 
## use of exactness                                       ##
##                                                        ##
############################################################
x <- seq(0, 1, if (interactive()) 1/30 else 0.5)
model <- RMgauss()

for (exactness in c(NA, FALSE, TRUE)) { 
  readline(paste("exactness: `", exactness, "'; press return"))
  z <- RFsimulate(model, x, x, exactness=exactness,
                  stationary_only=NA, storing=TRUE)
  print(RFgetModelInfo(which="internal")$internal$name)
}

FinalizeExample()

Run the code above in your browser using DataLab