Session Ready
Exercise

Plotting moving standard deviations

Having plotted pre-computed moving averages of AAPL stock prices on distinct subplots in the previous exercise, you will now plot pre-computed moving standard deviations of the same stock prices, this time together on common axes.

  • The time series aapl is not plotted in this case; it is of a different length scale than the standard deviations.
  • The time series std_30, std_75, stdn_125, & std_250 have been computed for you (containing the windowed standard deviations of the series aapl computed over windows of width 30 days, 75 days, 125 days, & 250 days respectively).
Instructions
100 XP
  • Produce a single plot with four curves overlayed:
  • the series std_30 in 'red' (with corresponding label '30d').
  • the series std_75 in 'cyan' (with corresponding label '75d').
  • the series std_125 in 'green' (with corresponding label '125d').
  • the series std_250 in 'magenta' (with corresponding label '250d').
  • Add a legend to the 'upper left' corner of the plot.