ComputePostPredDist: Computing the posterior predictive distribution of total area...

Description Usage Arguments Value

View source: R/BasicFunctions.R

Description

Computes the posterior predictive distribution of total area counts based on a set of samples from the posterior field. The function first splits the samples into several sublists and saves them to disk. Then computes the eta for each point in each grid along with the sd and so on. Finally computes the dist of the mean of the Poisson counts corresponding to the posterior predictive dist of total area counts.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
ComputePostPredDist(
  samp,
  spatial,
  parallelize.noSplits = parallelize.numCores,
  parallelize.numCores,
  tempFolder,
  use.covariates,
  additional.iid.term,
  covariate.fitting,
  gridList,
  covGridList,
  nxy,
  poisson.maxEvals,
  noMeshPoints,
  extraNonlinear.covGridList,
  delete.samp = T
)

Arguments

samp

List with all posterior samples, one sample in each sublist (as obtained from inla.posterior.sample)

spatial

Logical, indicating whether the model fitted includes a spatial spde term

parallelize.noSplits

Numeric, deciding how many sublists samp should be splitted into. Should be a multiple of parallelize.numCores for the highest efficiency. The larger number the less memory is used (and longer time)

parallelize.numCores

Numeric, corresponding to the number of cores any parallelization should be run at

tempFolder

Path to the folder where temporary files (samp subfiles and gridded eta subfiles)

use.covariates

Logical, indicating whether covariates are used or not (see description!)

additional.iid.term

Logical, indicating whether to include an additional iid (Gaussian) term in the latent field specification. FALSE is default

covariate.fitting

String, indicating how to model covariates. "linear", quadratic (default) or "linAndLog", or FALSE for no covariates

gridList

List containing information about the grid, being the output of the function GridCreation

covGridList

List containing information about the covariates at the grid (also when use.covariates = FALSE), being the output of the function covAtNewGrid

nxy

Numberic vector of size 2, giving the dimension in x- and y-direction for the grid

poisson.maxEvals

Numeric, corresponding to maximum number of points the Poisson distribution should be evaluated at (a much smaller number is typically used)

noMeshPoints

Numeric, corresponding to the number of points in the mesh being used

extraNonlinear.covGridList

List of additional projection objects related to the nonlinear covariate effect when applicable

Value

List containing the resulting posterior predicitve distribution for all evaluation points (also returned) in addition to the mean field and sd field computed from the samples)


PointProcess/SealPupProduction-JRSSC-code documentation built on Jan. 27, 2020, 10:06 p.m.