calcCondProbs1: Calculate conditional probabilities

View source: R/GcClusterFunctions.R

calcCondProbs1R Documentation

Calculate conditional probabilities

Description

Calculate, for each field sample, Monte Carlo samples of the conditional probability that the field sample is associated with the first probability density function in the finite mixture model.

Usage

calcCondProbs1(transData, nPCs, combinedChains)

Arguments

transData

List containing the transformed geochemical concentrations and related information. This list is return by function transformGcData, for which the documentation includes a complete description of container transData.

nPCs

Number of principal components that were used in the finite mixture model.

combinedChains

A stanfit object containing multiple Monte Carlo chains. This object is return by function combineChains, for which the documentation includes a complete description of container combinedChains.

Details

The conditional probabilities are calculated using the formula in Gelman et al. (2014, p. 540 bottom).

Value

A matrix containing the Monte Carlo samples of the conditional probabilites. The number of matrix columns equals the number of field samples, and the number of matrix rows equals the number of Monte Carlo samples in combinedChains. That is, column j of the matrix contains Monte Carlo samples of the conditional probability that field sample j is associated with the first probability density function in the finite mixture model.

References

Gelman, A., Carlin, J.B., Stern, H.S., Dunson, D.B., Vehtari, A., and Rubin, D.B., 2014, Bayesian data analysis (3rd ed.), CRC Press.

Examples

## Not run: 
condProbs1 <- calcCondProbs1(transData, nPCs, combinedChains)

## End(Not run)



USGS-R/GcClust documentation built on April 17, 2023, 8:08 p.m.