Added function for calculating influence diagnostics