RFoptions(seed=0)
## here, the scale is given by an exponential variable:
model <- RMgauss(scale=exp())
for (i in 1:4) {
# 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 simulation have same (but random) scale:
plot(RFsimulate(model, x=seq(0,10,0.1), n=4))
\dontrun{
## 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)))
}
RFoptions(seed=NA)
Run the code above in your browser using DataLab