Someone might have the exact formula. I don't, though. I believe it's just the average of the materials used softcapped by the geometric mean of Psy and MM: sqrt (Psy * MM).
Opinions expressed in this statement are the authors alone and in no way reflect on the game development values of the actual developers.