BayesMassBal

Travis build status AppVeyor build status Codecov test coverage

The goal of BayesMassBal is to allow users to easily conduct Bayesian data reconciliation for a linearly constrained chemical or particulate process at steady state.

Samples taken from a chemical process are always observed with noise. Using data reconciliation, or mass balance methods, it is possible to use the principle of conservation of mass to filter the noise. This technique is common in chemical engineering and mineral processing engineering applications.

Typically, a mass balance produces point estimates of true mass flow rates. However, using Bayesian methods one can obtain a more granular view of process uncertainty. The BayesMassBal package provides functions allowing the user to easily specify conservation of mass constraints, organize collected data, conduct a Bayesian mass balance using various error structures, and select the best model for their data using Bayes Factors.

The Bayesian mass balance uses Markov chain Monte Carlo methods to obtain random samples from the distributions of constrained mass flow rates. These samples can be used to generate plots, or for other applications where sampling from such a distribution is useful.

Installation

You can install the released version of BayesMassBal from CRAN with:

install.packages("BayesMassBal")

Using BayesMassBal

After loading the package

library(BayesMassBal)

Functions are available to aid in Bayesian data reconciliation.

An overview of a suggested workflow, including importing data into R, specifying model constraints, using the BMB function, and making a main effects plot, is available as a vignette: vignette("Two_Node_Process").