Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

RFdistr

Evaluating distribution families


Description

Through RRdistr distribution families can be passed to RandomFields to create distributions available in the RMmodel definitions.

Usage

RFddistr(model, x, params, dim=1, ...)
RFpdistr(model, q, params, dim=1, ...)
RFqdistr(model, p, params, dim=1, ...)
RFrdistr(model, n, params, dim=1, ...)
RFdistr(model, x, q, p, n, params, dim=1, ...)

Arguments

model,params

an RRmodel.

x

the location where the density is evaluated

q

the location where the probability function is evaluated

p

the value where the quantile function is evaluated

n

the number of random values to be drawn

dim

the dimension of the vector to be drawn

...

for advanced use: further options and control arguments for the simulation that are passed to and processed by RFoptions

Details

RFdistr is the generic function for the 4 functions belonging to a distribution.

Value

as described in the arguments

Author(s)

See Also

Examples

RFoptions(seed=0) ## *ANY* simulation will have the random seed 0; set
##                   RFoptions(seed=NA) to make them all random again

## a very toy example to understand the use
model <- RRdistr(norm())
v <- 0.5
Print(RFdistr(model=model, x=v), dnorm(x=v)) 
Print(RFdistr(model=model, q=v), pnorm(q=v))
Print(RFdistr(model=model, p=v), qnorm(p=v))

n <- 10
r <- RFdistr(model=model, n=n, seed=0)
set.seed(0); Print(r, rnorm(n=n))


## note that a conditional covariance function given the
## random parameters is given here:
model <- RMgauss(scale=exp())
for (i in 1:3) {
  RFoptions(seed = i + 10)
  readline(paste("Model no.", i, ": press return", sep=""))
  plot(model)
  readline(paste("Simulation no.", i, ": press return", sep=""))  
  plot(RFsimulate(model, x=seq(0,10,0.1)))
}

RandomFields

Simulation and Analysis of Random Fields

v3.3.10
GPL (>= 3)
Authors
Martin Schlather [aut, cre], Alexander Malinowski [aut], Marco Oesting [aut], Daphne Boecker [aut], Kirstin Strokorb [aut], Sebastian Engelke [aut], Johannes Martini [aut], Felix Ballani [aut], Olga Moreva [aut], Jonas Auel[ctr], Peter Menck [ctr], Sebastian Gross [ctr], Ulrike Ober [ctb], Paulo Ribeiro [ctb], Brian D. Ripley [ctb], Richard Singleton [ctb], Ben Pfaff [ctb], R Core Team [ctb]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.