If were're talking about rotables (those bits that can be repaired), both Airbus and Boeing have provisioning formulae which can be used to calculate the number of spares needed to support a certain sized fleet. The variables used in the calculation typically include: Fleet Size, Annual Utilization of the aircraft, MTBUR of the equipment, Average repair cycle time (no. of days it takes for the removed equipment to be repaired and back serviceable on the shelf, including shipping, etc), plus the number of line stations that you wish to keep stock at (typically only the no-go items)