pcPriorRange: PC prior for range parameter

Description Usage Arguments Details Value Examples

View source: R/pcPriorRange.R

Description

Creates a penalized complexity prior for the range parameter

Usage

1
pcPriorRange(q, p=0.5, cellSize=1)

Arguments

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.

Details

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.

Value

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

Examples

1
2
3
4
5
6
# 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)

geostatsp documentation built on July 14, 2018, 9:01 a.m.