Functions for calculating the CreditMetrics risk model