calcAvgRiskAndProfile function

Calculation of the average risks and profiles