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
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.
You can install the released version of BayesMassBal from CRAN with:
After loading the package
Functions are available to aid in Bayesian data reconciliation.
importObservations()function can be used to import mass flow rate data from a
Rand organize it for use with the
twonodeSim()function for educational purposes, or for comparing the performance of Bayesian data reconciliation methods to other methods.
constrainProcess()function, one can specify linear constraints in
Ror import them from a
BMB(), then can be used to generate samples from target distributions and approximate the log marginal likelihood for a specified model.
"BayesMassBal"object, which can be fed to
plot.BayesMassBal()to easily plot the results.
"BayesMassBal"object can also be used with the
mainEff()to inspect how the main effect of a random variable and uncertainty in process performance are related.
An overview of a suggested workflow, including importing data into
R, specifying model constraints, using the
function, and making a main effects plot, is available as a vignette: