Abstract The atomic mean square displacement of aluminium and noble metals are calculated as a function of temperature. The anharmonic contributions are taken into account by relating the atomic displacements to the lineshifts and linewidths of phonon modes. A force constant model potential is used to parametrize the harmonic and anharmonic interatomic forces. It is shown that the inclusion of the anharmonic effects in the phonon spectral function allows results to be obtained that are in good agreement with the experimental data.