This code can be ran to estimate climate sensitivity by using the tropical temperature of the models participating in the Paleoclimate Modelling Intercomparison Project (PMIP) and simulating either the Last Glacial Maximum or the mid-Pliocene Warm Period.
Any climate properties can replace the variables x or y, following the theory of emergent constraints.
A detailed description of each method can be found in: M. Renoult, J.D. Annan, J.C. Hargreaves, N. Sagoo, C. Flynn, M.-L. Kapsch, Q. Li, G. Lohmann, U. Mikolajewicz, R. Ohgaito, X. Shi, Q. Zhang, T. Mauritsen, In Review. A Bayesian framework for emergent constraints: case studies of climate sensitivity with PMIP. Climate of the Past.
The Bayesian method is using the package PyMC3: Salvatier J., Wiecki T.V., Fonnesbeck C. (2016) Probabilistic programming in Python using PyMC3. PeerJ Computer Science 2:e55 DOI: 10.7717/peerj-cs.55. See https://docs.pymc.io for installation.
The code is using the package adjustText for esthetic plots. Please refer to https://github.com/Phlya/adjustText for installation.
The conjugate prior approach is using the package spBayes. Please refer to the package description by Finley and Banerjee (2020) https://cran.r-project.org/web/packages/spBayes/spBayes.pdf
Other used packages are included in the standard Anaconda Distribution.
For any inquiries or technical questions, please contact Martin Renoult (Stockholm University, Bolin Centre for Climate Research and Department of Meteorology) martin.renoult@misu.su.se
21/05/2020: - Corrected a mistake in the computation of the variance L80 of the Kalman Filter - Updated the Bayesian approach with more annotations, removed some useless stuff - Removed the previous OLS python script - Added a more efficient OLS and prediction intervals script in R - Added a conjugate prior approach in R for the mPWP problem
23/12/2019: for macOS Catalina (10.15) users: There could be an issue coming from PyMC3 3.8 and Theano (code is running but performances are extremely reduced, the right c++ compiler is not found). It seems installing new command lines tools through Xcode might solve the issue. The code has been updated to the new PyMC3 3.8!