Session Ready
Exercise

Monte Carlo simulations

Monte-Carlo simulations are used to model a wide range of possibilities.

Monte-Carlos can be constructed in many different ways, but all of them involve generating a large number of random variants of a given model, allowing a wide distribution of possible paths to be analyzed. This can allow you to build a comprehensive forecast of possibilities to sample from without a large amount of historical data.

Generate 100 Monte-Carlo simulations for the USO oil ETF.

The parameters mu, vol, T, and S0 are available from the previous exercise.

Instructions
100 XP
  • Loop from 0 to 100 (not including 100) using the range() function.
  • Call the plotting function for each iteration using the plt.plot() function, passing the range of values T (range(T)) as the first argument and the forecasted_values as the second argument.