Learn R Programming

RandomFields (version 3.1.36)

RRmcmc: RRmcmc

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
positve 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 the 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

Details

RRmcmc returns an object of class RMmodel.

See Also

RMmodel, RR, RRdistr RMuser

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
## here a model with random scale parameter

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


Run the code above in your browser using DataLab