lopodRaster: Crate raster object for a parameter estimated in a LopodModel

Description Usage Arguments Value Examples

View source: R/lopodRaster.R

Description

Crate raster object for a parameter estimated in a LopodModel

Usage

1
2
lopodRaster(LopodModel, param, extrapolate = T, metric = NULL,
  quant = 0.5)

Arguments

LopodModel

A LopodModel object

param

Unit-level model parameter to be mapped. Values "psi_Sampled" can be mapped for models without CAR analyses, "psi_i" for LopodModels with CAR analysis and "pp","cellpres_i", "pCorr","sim_y","sim_true_y","sim_false_y" for both.

extrapolate

Boolean. If True, parameters are mapped for cells that have not been sampled, this can only be done in LopodModels with CAR analysis. Only plotted for "psi_i", "pp" and, "cellpres_i".

metric

"mean" or "sd". Plots the mean or standard deviation of the posterior distribution. If NULL, the value in quant is used.

quant

Returns the raster for a given quantile of the posterior distribution. Default is 0.5 (the median of the posterior distribution). Not used if metric is other than NULL

Value

A Raster object.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
## Not run: 
data("simSpRecords", package = "bayesLopod")
data("simSpSamplingEffort", package = "bayesLopod")
simSpRasters = xyToRaster(xyRecords = simSpRecords,xySamplingEffort = simSpSamplingEffort,
basemap = NULL, nrows = 50, extentExpansion = 0)
ld_Raster_adMatrix = rasterLopodData(rasterN = simSpRasters[["samplingEffort"]],
rasterY = simSpRasters[["spDetections"]], Adjacency = TRUE )
mLopodRaster = modelLopod(LopodData = ld_Raster_adMatrix, varP = TRUE, q = NULL,
pmin = 0.1, CAR = FALSE, nChains = 4,warmup = 500,sampling = 100,nCores = 4)

psiRaster = lopodRaster(mLopodRaster, param = "psi_i", extrapolate = TRUE, quant = 0.5)
ppRaster = lopodRaster(mLopodRaster, param = "pp", extrapolate = FALSE, metric = "mean")

Visualize results
sp::spplot(psiRaster)
sp::spplot(ppRaster)

## End(Not run)

bayesLopod documentation built on Jan. 4, 2018, 5:08 p.m.