Calculate statistics ‘stat’ according to configuration in ‘stat_config’. This function calls the respective stat function (defined in _stats).