# Bayesian phonons¶

This example demonstrates sensitivity analysis for force constants using Bayesian parameter estimation or bagging. The source code for this example is available in the form of a jupyter notebook in the hiphive-examples repository, see here.

Bayesian parameter optimization allows one to find the joint probability distributions $$P(\boldsymbol{x})$$ of the parameters $$\boldsymbol{x}$$ given some training data and priors. Here, we consider a simple harmonic force constant model for FCC Ni. Uniform priors are used and 200 parameter vectors are drawn from $$P(\boldsymbol{x})$$ using Markov chain Monte Carlo sampling. These 200 models are used to predict the harmonic phonon dispersion shown in the figure below.

This type of sensitivity analysis can also be carried out via the EnsembleOptimizer using bagging, which is also demonstrated in the jupyter notebook.

Sensitivity analysis can equally be employed for other properties such ase, e.g., the free energy or the thermal conducitvity. It also allows one to identify regions of the configurational space for which the model sensitivity is poor and thus guide the selection of additional training structures.