THD measurement using ADE9153A

Hi,

I am using ADE9153A IC and I am able to measure VRMS, IRMS and PF.

Can you please guide me how to measure THD using ADE9153A energy meter IC and how to find the calibration factor for active and reactive power. 

Thanks