The mean variance model calculates the expected growth rate and volatility based on the past data of the allocation target. Use Monte Carlo method to find the allocation ratio with the highest expected growth rate under a given volatility or the allocation ratio with the lowest volatility under a given expected growth rate.