pcPriorRange | R Documentation |
Creates a penalized complexity prior for the range parameter
pcPriorRange(q, p=0.5, cellSize=1)
q |
Lower quantile for the range parameter |
p |
probability that the range is below this quantile, defaults to the median |
cellSize |
size of grid cells, can be a raster. |
q is the quantile in spatial units, usually meters, and the scale parameter follows an exponential distribution. A prior PC prior distribution for the range parameter in units of grid cells, which INLA requires, is computed.
A list with
lambda |
parameter for the exponential distribution (for scale in units of cells), in the same parametrization as dexp |
priorScale |
matrix with x and y columns with prior of scale parameter |
priorRange |
matris with x and y columns with prior of range parameter, in meters (or original spatial units) |
inla |
character string specifying this prior in inla's format |
# pr(range < 100km) = 0.1, 200m grid cells
x = pcPriorRange(q=100*1000, p=0.1, cellSize = 200)
rangeSeq = seq(0, 1000, len=1001)
plot(rangeSeq, x$dprior$range(rangeSeq*1000)*1000,
type='l', xlab="range, 1000's km", ylab='dens')
cat(x$inla)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.