File: RRmcmc.Rd

package info (click to toggle)
r-cran-randomfields 3.3.14-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 4,916 kB
  • sloc: cpp: 52,159; ansic: 3,015; makefile: 2; sh: 1
file content (77 lines) | stat: -rw-r--r-- 2,091 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
\name{RRmcmc}
\alias{RRmcmc}
\title{Random Sample From The Modulus Of A Function}
\description{
  \command{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{
  \item{phi}{an arbitrary integrable function
  }
  \item{mcmc_n}{
    positive integer. Every \code{mcmc_n}th element of the MCMC chain
    is returned.
  }
  \item{sigma}{positive real number.
    The MCMC update is done by adding a normal variable with
    standard deviation \code{sigma}.
  }
  
  \item{normed}{logical.
    Only used if the value of the density is calculated.
    If \code{FALSE} the unnormed value given by \code{phi} is returned.

    Default: \code{FALSE}.
  }
  \item{maxdensity}{positive real number.
    The given density is truncated at \code{maxdensity}.

    Default: 1000.
  }
  
  \item{rand.loc}{logical. Internal. Do not change the value.
    
   Default: \code{FALSE}.
   }
 \item{gibbs}{logical. If \code{TRUE} only one component is updated at a
   time.
   
   Default: \code{FALSE}.
  }
}


\value{
 \command{\link{RRmcmc}} returns an object of class \code{\link[=RMmodel-class]{RMmodel}}.
}
\note{
 The use of \command{RRmcmc} is completely on the risk of the user. There is no
 way to check whether the integral of the modulus is finite.
}

\me
\seealso{
  \command{\link{RMmodel}},
  \link{RR},
  \command{\link{RRdistr}},
   \command{\link{RMuser}}.
}

\examples{\dontshow{StartExample()}
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

\dontshow{FinalizeExample()}}

\keyword{spatial}
\keyword{models}