Question
Part E: Effects of Volatility In this part, we will explore the effect of volatility on simulated stock prices. We will do this by performing
Part E: Effects of Volatility
In this part, we will explore the effect of volatility on simulated stock prices. We will do this by performing two Monte Carlo simulations. The two simulations will use different volatilities, but will otherwise use the same parameters.
Create a markdown cell that displays a level 2 header that reads: "Part E: Effects of Volatility". Also add some text briefly describing the purpose of your code in this part.
Set a seed of 1 and then run Monte Carlo simulations for two stocks (Stock A and Stock B), each with 10,000 runs lasting over a period of 150 days. Both stocks being simulated have a current price of 100, and an expected annual yield of 12%. However, the Stock A has a volatility of 0.3, and Stock B has a volatility of 0.7.
Calculate the average of the simulated annual yields for each stock, rounded to four decimal places. Print the results in the following format:
Average Annual Yield for A over 10000 runs: _____ Average Annual Yield for B over 10000 runs: _____
Create a markdown cell to explain that we will visually inspect the results of the two Monte Carlo simulations by plotting histograms of the final prices. Use plt.hist to create a figure with two histograms on the same axes. Each histogram should display the distribution of final prices for each stock over the 10,000 simulated runs in one of the two Monte Carlo simulations. Set a figure size of [10,5]. Set an alpha level of 0.6 and use np.arange(0,600, 10) for the bins in each plot. Set the edgecolor to black. Display a legend indicating which histogram is for which stock. Finally, set the title of the figure to be "Histogram of Final Prices over 10,000 Runs".
You should see that the histogram for Stock A is tightly clustered with a peak near 120. The histogram for Stock B should have a shorter peak near 80, and a large tail trailing off to the right. This shows that the stock with the higher volatility (Stock B) has a much wider range of likely outcomes.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started