Dynamics and statics of the ferroelectric phase transition in PbHPO4