Local lattice dynamics and negative thermal expansion in crystals