Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

RR

Distribution families (RR commands)


Description

Distribution families to specify random parameters in the model definition.

Details

See Bayesian Modelling for a less technical introduction to hierarchical modelling.

When simulating Gaussian random fields, the random parameters are drawn only once at the very beginning. So, if the argument n in RFsimulate is greater than 1 then n simulations conditional on a single realization of the random parameters are performed. See the examples below.

There are (simple) multivariate versions and additional versions to the distributions families implemented. Further, any distribution family defined in R can be used, see the examples below.

These functions will allow for Bayesian modelling. (Future project).

Implemented models

RRdeterm no scattering
RRdistr families of distributions transferred from R
RRgauss a (multivariate) Gaussian random variable
RRloc modification of location and scale
RRspheric random scale for the RMball to simulate RMspheric, etc.
RRunif a (multivariate) uniform random variable

Note

The allowance of random parameters is a very recent, developing feature of RandomFields.

Future changings of the behaviour are not unlikely.

Note

A further random element is RMsign, which is an operator on shape functions. As an exception its name starts with RM and not with RR.

Author(s)

See Also

Examples

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

## here, the scale is given by an exponential variable:
model <- RMgauss(scale=exp())
for (i in 1:4) {
  RFoptions(seed = i)
  # each leads to a simulation with a different scale parameter
  plot(model) ## random
  plot(RFsimulate(model, x=seq(0,10,0.1)))
  readline("press return")
}

# but here, all 4 simulations have the same (but random) scale:
plot(RFsimulate(model, x=seq(0,10,0.1), n=4)) 


## hierarchical models are also possible:
## here, the scale is given by an exponential variable whose
## rate is given by a uniform variable
model <- RMgauss(scale=exp(rate=unif()))
plot(model)
plot(RFsimulate(model, x=seq(0,10,0.1)))


## HOWEVER, the next model is deterministic with scale \code{e=2.718282}.
model <- RMgauss(scale=exp(1))
plot(model)
plot(RFsimulate(model, x=seq(0,10,0.1)))

RandomFields

Simulation and Analysis of Random Fields

v3.3.10
GPL (>= 3)
Authors
Martin Schlather [aut, cre], Alexander Malinowski [aut], Marco Oesting [aut], Daphne Boecker [aut], Kirstin Strokorb [aut], Sebastian Engelke [aut], Johannes Martini [aut], Felix Ballani [aut], Olga Moreva [aut], Jonas Auel[ctr], Peter Menck [ctr], Sebastian Gross [ctr], Ulrike Ober [ctb], Paulo Ribeiro [ctb], Brian D. Ripley [ctb], Richard Singleton [ctb], Ben Pfaff [ctb], R Core Team [ctb]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.