bc-stan provides code for:
- Bayesian calibration of Building Energy Models using the Stan modeling language
- Parameter screening with Morris method
- Detailed description of this code can be found in Chong and Menberg (2018)
- Application case study of Bayesian calibration Chong et. al (2017)
The stan code for Bayesian calibration is based on Kennedy and O'Hagan's (2001) Bayesian calibration framework and follows the statistical approach described in Higdon et. al. (2004).
Stan is portable across many computing environments. Two interfaces, R (main.R) and Python (main.py) are provided here to interface with the stan models in this repository.
Install Stan and its required dependencies.
- RStan (R interface to stan): https://github.com/stan-dev/rstan/wiki/RStan-Getting-Started
- PyStan (Python interface to stan): http://pystan.readthedocs.io/en/latest/installation_beginner.html
Main files
- main.R: R interface for running Stan model
- main.py: Python interface for running Stan model
- bcWithPred.stan: Stan model for Bayesian calibration of building energy models with predictive inferences.
- bcWithoutPred.stan: Stan model for Bayesian calibration of building energy models without predictive inferences.
To run Bayesian calibration with predictive inference in Stan, run main.R or main.py as is.
To run Bayesian calibration with predictive inference outside of Stan, comment lines 60-63 and line 85 and uncomment lines 65-68 and line 86 in main.R.
The Python code for parameter screening is based on Morris (1991) and implemented using the SALib python library.
Main files
- sensitivity.py: Python class for Morris method with E+ idf
- idf_functions.py: Python class containing functions to modify E+ idf
Install eppy and SALib and their respective dependencies.
- eppy (scripting language for E+ idf files): https://pythonhosted.org/eppy/index.html
- SALib (Python library containing commonly used sensitivity analysis methods): https://salib.readthedocs.io
If you need to get in touch for information about the code or its usage, you may drop us an email.