IPD_stat_factory function

Factory function for creating calc_IPD_stats methods