LoslegenKostenlos loslegen

Sensitivity analysis using hexbin plot

The simulation results you generated in the previous exercise are saved in the DataFrame df_sa which has been loaded for you.

Recall that df_sa has three columns: Inflation contains the mean inflation rates used in the simulations, Volume contains the mean sales volumes used in the simulations, and Profit contains forecasted profits based on your simulation.

You'll now use a hexbin plot to perform sensitivity analysis and understand the impact of these parameters!

The following libraries have been imported for you: pandas as pd, numpy as np, scipy.stats as st, and matplotlib.pyplot as plt.

Diese Übung ist Teil des Kurses

Monte Carlo Simulations in Python

Kurs anzeigen

Anleitung zur Übung

  • Complete the hexbin plot code to visualize the sensitivity analysis results; use Inflation as the x-axis, Volume as the y-axis, and the mean values of Profits as the basis for the color of the hexbins.

Interaktive Übung

Versuche dich an dieser Übung, indem du diesen Beispielcode vervollständigst.

# Complete the hexbin to visualize sensitivity analysis results
____(x=____,
     y=____,
     C=____,
     reduce_C_function=____,
     gridsize=10,
     cmap="viridis",
     sharex=False)
plt.show()
Code bearbeiten und ausführen