As we have seen, any two runs generated from the same set of parameters might vary...
Fantastic news! We've Found the answer you've been seeking!
Question:
![](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2023/09/64facab79abe0_1694157495855.jpg)
Transcribed Image Text:
As we have seen, any two runs generated from the same set of parameters might vary considerably from one-another. 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. As we have seen, any two runs generated from the same set of parameters might vary considerably from one-another. 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)
Lets break down the instructions step by step and create the required Python code and Markdown cells to perform a Monte Carlo simulation and analyze t... View the full answer
Related Book For
Posted Date:
Students also viewed these programming questions
-
Sam received a Section 1245 asset (heavy truck) that his grandfather used and depreciated in connection with a trade or business. At the time Sam received the truck, the FMV was $12,000, original...
-
When creating a project schedule, which question should you ask to determine the resources that will impact the schedule? a.) b.) c.) d.) Which equipment and materials are needed? What sequence must...
-
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...
-
In 2022, XYZ issued, at par, 75 1,000 K.D, 10% bonds, each convertible into 100 ordinary shares. The liability component of convertible bonds was 950 K.D per bond. XYZ had revenues of 24,800 K.D and...
-
Two firms compete by choosing price. Their demand functions are Q 1 = 20 - P 1 + P 2 and Q 2 = 20 + P 1 - P 2 where P 1 and P 2 are the prices charged by each firm, respectively, and Q 1 and Q 2 are...
-
The U.S. Department of Housing and Urban Development (HUD) uses the median to report the average price of a home in the United States. Why do you think HUD uses the median?
-
1. Let ui U(0, 1). Draw 1000 random ui and construct a histogram of the results. What are the mean and standard deviation?
-
A firm reported comprehensive income of $376 million for 2009, consisting of $500 million in operating income (after tax) less $124 million of net financial expenses (after tax). It also reported the...
-
Using Control Limits to Determine when to Investigate a Variance Kavallia Company set a standard cost for one item at $328,000; allowable deviation is = $14,500. Actual costs for the past six months...
-
The production manager at a factory manufacturing four types of light fittings (A, B, C and D) on an automated machine is fixing the schedule for the next week on this machine. HEIJUNKA SCHEDULING OF...
-
D Question 15 3 pts After a survey of its employees, a car manufacturing company in Michigan discovers that 1,801 of its employees own American model vehicles, 615 own Japanese made vehicles, and 376...
-
7. Chicago Corp. obtained the following information from the Raw Materials Inventory account and purchasing records for the first quarter of the current year: Beginning Raw Materials Ending Raw...
-
Suppose that i t =6% (n=1), and that future short term interest rates (n=1) for the next 3 years (starting next year) are expected to be: 4%, 2%, 2%. Suppose that the liquidity premium is zero for...
-
Mechanical Vibrations HW Use the modal analysis and numerical integration to compute and plot the time response of the system, which has the equations of motion [8 0 01 (1) 48 -12 01(x1 0 0 8 02-12...
-
Submit excel file with graph and exchange rate analysis. FOREIGN EXCHANGE RATESTHE YEN FOR DOLLARS. The Federal Reserve System Web site, www.federalreserve.gov/releases/H10/hist , provides historical...
-
Part 1: There are many types of communication styles used in the workplace. Choose what you think is your leadership style: north, south, east, or west. Click The Leadership Compass Self-Assessment...
-
Which of the following situations would require an increase in the coupon rate for a bond selling at par? The addition of a call provision The addition of a convertibility option The increase in the...
-
Refer to the table to answer the following questions. Year Nominal GDP (in billions) Total Federal Spending (in billions) Real GDP (in billions) Real Federal Spending (in billions) 2000 9,817 578...
-
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 year-end 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....
-
E19.6. Credit Scoring for a Firm with a Ratings Downgrade: Maytag Corporation (Medium) Maytag Corporation is the established manufacturer of washing machines, dryers, dish- washers, and other home...
-
E19.4. Z-Scoring (Easy) Below are ratios for some of the firms that have appeared in this book, for their 1998 fiscal year. Working Retained Capital Earnings Earnings before Interest and Taxes Market...
-
Fruit of the Loom Ltd. fared poorly from 1997 to 1999. Between April 1997 and October. 1999, its stock price dropped from $38 to $3, a 92 percent loss in market value. Fruit of the Loom manufactures...
![Mobile App Logo](https://dsd5zvtm8ll6.cloudfront.net/includes/images/mobile/finalLogo.png)
Study smarter with the SolutionInn App