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.
Questo esercizio fa parte del corso
Monte Carlo Simulations in Python
Istruzioni dell'esercizio
- Complete the hexbin plot code to visualize the sensitivity analysis results; use
Inflationas the x-axis,Volumeas the y-axis, and the mean values ofProfitsas the basis for the color of the hexbins.
Esercizio pratico interattivo
Prova a risolvere questo esercizio completando il codice di esempio.
# Complete the hexbin to visualize sensitivity analysis results
____(x=____,
y=____,
C=____,
reduce_C_function=____,
gridsize=10,
cmap="viridis",
sharex=False)
plt.show()