R: RRmcmc

RRmcmc {RandomFields} | R Documentation

## 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_n`th 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`.

### 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/de/publications/software

### 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 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

[Package RandomFields version 3.1.50 Index]