Skip to contents

Function that evaluates relevant quantities from a posterior sample of the parameters of an eDITH model

Usage

eval_posterior_eDITH(x, river, quant = 0.5)

Arguments

x

List as produced by run_eDITH_BT.

river

A river object generated via aggregate_river.

quant

Vector of quantiles.

Value

The output list copies all objects of the input x list. The following objects are added:

param_quantile

Selected quantiles (along rows) of the posterior distribution of model parameters.

p_quantile

Selected quantiles (along rows) of the posterior distribution of production rates.

C_quantile

Selected quantiles (along rows) of the posterior distribution of eDNA values (concentrations or read numbers).

probDet_quantile

Selected quantiles (along rows) of the posterior distribution of detection probability.

param_mean

Mean of the posterior distribution of model parameters.

p_mean

Mean of the posterior distribution of production rates.

C_mean

Mean of the posterior distribution of eDNA values (concentrations or read numbers).

probDet_mean

Mean of the posterior distribution of detection probability.

All of these objects are vectors of length river$AG$nNodes. However, if a custom likelihood was used in run_eDITH_BT, then probDet_quantile and probDet_mean are not evaluated, and are replaced by a vector of zero length.

Examples

library(rivnet)
data(wigger)
data(outSample)
out <- eval_posterior_eDITH(outSample, wigger)
plot(wigger, out$p_mean)