RRmcmc {RandomFields}R Documentation

Random Sample From The Modulus Of A Function

Description

RRmcmc draws a random sample from the modulus of any given function (provided the integral is finite).

Usage

RRmcmc(phi, mcmc_n, sigma, normed, maxdensity, rand.loc, gibbs)

Arguments

phi

an arbitrary integrable function

mcmc_n

positive integer. Every mcmc_nth element of the MCMC chain is returned.

sigma

positive real number. The MCMC update is done by adding a normal variable with standard deviation sigma.

normed

logical. Only used if the value of the density is calculated. If FALSE the unnormed value given by phi is returned.

Default: FALSE.

maxdensity

positive real number. The given density is truncated at maxdensity.

Default: 1000.

rand.loc

logical. Internal. Do not change the value.

Default: FALSE.

gibbs

logical. If TRUE only one component is updated at a time.

Default: FALSE.

Value

RRmcmc returns an object of class RMmodel.

Note

The use of RRmcmc is completely on the risk of the user. There is no way to check whether the integral of the modulus is finite.

Author(s)

Martin Schlather, schlather@math.uni-mannheim.de, http://ms.math.uni-mannheim.de

See Also

RMmodel, RR, RRdistr, RMuser.

Examples

RFoptions(seed=0) ## *ANY* simulation will have the random seed 0; set
##                   RFoptions(seed=NA) to make them all random again
## here a model with random scale parameter

## not exponential, but the Laplace distribution as symmetry is assumed
z <- RFrdistr(RRmcmc(RMexp(), sigma=1), n=10000, cores=1)
hist(z, 100, freq=FALSE)
curve(0.5 * exp(-abs(x)), add=TRUE, col="blue") ## Laplace distribution


[Package RandomFields version 3.3.7 Index]