posteriorPredictiveLoss: Posterior-Predictive Loss of a Multi-scale Occupancy Model

View source: R/posteriorPredictiveLoss.R

posteriorPredictiveLossR Documentation

Posterior-Predictive Loss of a Multi-scale Occupancy Model

Description

Computes the posterior-predictive loss criterion for a fitted multi-scale occupancy model.

Usage

posteriorPredictiveLoss(fit, burnin = 1)

Arguments

fit

object of class occModel that contains data and previous state of the model's Markov chain

burnin

initial no. iterations of Markov chain to be omitted from calculations

Details

This function computes the posterior-predictive loss criterion used in model-selection once a multi-scale occupancy model has been fitted using occModel.

Value

Posterior-predictive loss criterion and its goodness-of-fit and predictive-variance components.

Examples


data(gobyDetectionData)
detections = occData(gobyDetectionData, "site", "sample")
data(gobySurveyData)
gobySurveyData = scaleData(gobySurveyData)  # center and scale numeric covariates

fit1 = occModel(formulaSite          = ~ veg,
                formulaSiteAndSample = ~ sal + twg,
                formulaReplicate     = ~ sal + fish,
                detectionMats        = detections,
                siteData             = gobySurveyData,
                niter                = 1100,
                niterInterval        = 100,
                siteColName = 'site',
                )

posteriorPredictiveLoss(fit1, burnin=100)

RobertDorazio/eDNAoccupancy documentation built on Sept. 5, 2023, 9:57 a.m.