As we have seen, any two runs generated from the same set of parameters might vary...
Fantastic news! We've located the answer you've been seeking!
Question:
Transcribed Image Text:
As we have seen, any two runs generated from the same set of parameters might vary considerably from oneanother. You might be asking how simulation is useful if I get very different results every time we run a simulation. The answer is that we do not expect simulation to be able to tell us exactly what will occur, we use it to get an idea of the range of possible outcomes that might occur. In order to perform that sort of analysis, we need to perform many simulations, and then look at the range of outcomes occurring in this simulations. The process of performing several simulations to estimate probabilities relating to the outcome of a certain event is called Monte Carlo Simulation. Create a markdown cell that displays a level 2 header that reads: "Part D: Monte Carlo Simulation". Also add some text briefly describing the purpose of your code in this part. Write a function named monte_carlo. The function should accept five parameters: start, rate, vol, days, and num_runs. The function should use a loop to generate a number of simulated stock runs equal to num_runs. The characteristics of the runs are provided by the parameters start, rate, vol, and days. A detailed description of this function is provided below. Each time you loop executes, the following steps should be performed: 1. Simulate a run using the supplied parameters. Store the resulting array in a variable. 2. Determine the final simulated price of the stock and append it into a list called final_prices. 3. Determine the annual yield for the simulated run and append it into a list called annual_yields. When the loop is done executing, convert the two lists you have constructed to numpy arrays and return both of them. Create a markdown cell to explain that you are about to test the function by running a Monte Carlo simulation with a specific seed. Set a seed of 1, and run a Monte Carlo simulation consisting of 10,000 simulated runs for a stock with a current price of 200, an expected annual return of 10 %, and a volatility of 0.4. Each run should be over a period of 500 days. Create a histogram of the final prices. Use bins=np.arange(0, 1600, 50), and set the edgecolor to black. Set the size of the figure to be [10,5]. If your code is correct, your histogram should have a peak around 200 and should have a long tail trailing off to the right. This shows that the majority of the simulated final prices are near 200, but there are some very large outliers. Create a markdown cell to explain that you are about to display the 10th, 25th, 50th, 75th, and 90th percentiles of the simulated final prices. Use np. percentile to calculate the 10th, 25th, 50th, 75th, and 90th percentiles for the final prices in the simulated runs generated for the stock. Display the results by creating five lines of output, with each line using the following format: __th percentile: Round the display percentiles to 2 decimal places. If done correctly, you should get a 10th percentile of 118.05 and a 90th percentile of 505.91.
Expert Answer:
Answer rating: 100% (QA)
Let s break down the instructions step by step and create the required Python code and Markdown cells to perform a Monte Carlo simulation and analyze View the full answer
Related Book For
Posted Date:
Students also viewed these programming questions

Planning is one of the most important management functions in any business. A front office managers first step in planning should involve determine the departments goals. Planning also includes...

A 1200kg car has a maximum power output of 120hp. How steep a hill can it climb at a constant speed of 75km/h if the frictional forces add up to 650 N?

Does government follow or create public opinion?

From where does geothermal power derive its energy?

A NAND gate with eight inputs is required. For each of the following cases, minimize the number of gates used in the multiplelevel result: (a) Design the 8input NAND gate using 2input NAND gates...

Santos Company currently manufactures one of its crucial parts at a cost of $3.40 per unit. This cost is based on a normal production rate of 50,000 units per year. Variable costs are $1.50 per unit,...

Discuss why processes must be repeatable and measurable in order to improve them? Do you think consistency in care and services could help in improving processes? 2. Russ Alonzo Takes Stock of His...

Activitybased budgeting, Balanced Scorecard, and strategy Sippican Corporation (B)12 Refer to Case 536, the Sippican Corporation (A) case, which required timedriven ABC analysis. Sippican's senior...

An investor buys a face amount $1 million of a sixmonth (182 days) Treasury bill at a discount yield of 9.25 percent. What is the cost of purchasing these bills? Calculate the bond equivalent yield?

In Problem a fair coin is tossed four times. What is the probability of obtaining Exactly one head?

A binomial experiment consists of 500 trials. The probability of success for each trial is .4. What is the probability of obtaining the number of successes indicated in Problem? Approximate these...

In Problem a coin is loaded so that the probability of a head occurring on a single toss is 3/4. In five tosses of the coin, what is the probability of getting All heads or all tails?

A binomial experiment consists of 500 trials. The probability of success for each trial is .4. What is the probability of obtaining the number of successes indicated in Problem? Approximate these...

A fair die is rolled five times. What is the probability of rolling (A) Exactly three 6s? (B) At least three 6s?

1. An infinitely long and thin metal strip of width w lies in the r  y plane, and is carrying uniform current I along its length in the rdirection. (a) Find B at a point P in the ry plane, located...

On 1 July 2018, Parent Ltd acquired all the shares of Son Ltd, on a cumdiv. basis, for $2,057,000. At this date, the equity of Son Ltd consisted of: $ 1,000,000 Share capital 500 000 shares...

The Royal Elbonian Yacht Club (REYC) is an association of members that offers a number of services: community and friendship among members, sailing courses for its members, meals in its restaurant,...

Oculus is a proprietorship that produces a specialized type of round window. It is after the fiscal yearend for 2019, and the owner has drafted the financial statements for the business for...

Liz Hicks Accounting Ltd.s (LHA) policy is to report all cash flows arising from interest and dividends in the operating section. LHA owns a 30% interest in an associated company, LH Bookkeeping Inc....

An investment offers a total return of 11.5 percent over the coming year. Janice Yellen thinks the total real return on this investment will be only 9 percent. What does Janice believe the inflation...

Even though most corporate bonds in the United States make coupon payments semiannually, bonds issued elsewhere often have annual coupon payments. Suppose a German company issues a bond with a par...

This is a classic retirement problem. A friend is celebrating her birthday and wants to start saving for her anticipated retirement. She has the following years to retirement and retirement spending...
Question Categories