Learn R Programming

geostatsp (version 2.0.6)

pcPriorRange: PC prior for range parameter

Description

Creates a penalized complexity prior for the range parameter

Usage

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

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

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.

Examples

Run this code
# 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)

Run the code above in your browser using DataLab