Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Import Statements Run the cell below to import the NumPy, Matplotlib, and math packages. [ ] import numpy as np import matplotilib.pyplot as plt import
Import Statements Run the cell below to import the NumPy, Matplotlib, and math packages. [ ] import numpy as np import matplotilib.pyplot as plt import math Four arrays have been created to store the datasets that you will be working with in this lab. Running the cell below will import those arrays into your workspace. We will describe the imported arrays later in this notebook. The cell will also import some functions that will be used to test your code in Problem 7. Run that cell now. fron MATH_599.1ab_08 import x1,y1,x2,y2 fron MATH_599.1ab_68 import unit_test_1, unit_test_2, unit_test_3 A commonly used model for predicting stock prices assumes that yield rates for the stock over some period of time follow a normal distribution. As an example of this, let R be a random variable representing the annual yield rate for a certain stock over the coruse of the next year. We will assume that: RN(=0.1,2=0.09) Suppose that the current price of a share of the stock is 100. Let S denote the price of a share of the stock at the end the year. Then S and R are related as follows: S=100eR We will use Monte Carlo simulation to explore the distribution of the price of the stock. Part 1.A Use the cell below to complete the following tasks. 1. Use NumPy to set a seed of 1. 2. Generate a sample of 10,000 observations of R. 3. Use the sample of R values to generate a sample of S values. 4. Calculate and print the following values, each rounded to 4 decimal places. - The mean of the sample of S. - The standard deviation of the sample of S. - The minimum of the sample of S. - The maximum of the sample of S. [ ] Start coding or generate with AI. Part 1.B Replace the blank in the cell below with the name of the variable representing the sample of S and then run the cell. [ ] plt.figure(figsize= [6,3]) plt.hist bins=49, color='cadetblue', edgecolor='k') p1t. show() Part 1.C Use your sample to estimate the following probabilities. Then print each probability estimate. - P[S>100] - P[S>150] - P[S>200] A call option is a financial instrument that pays its holder if the price of a certain stock is higher than a preset threshold on a specified date. The threshold is called the strike price of the call. If the price of the stock is higher than the strike price on the expiration date for the call, then the call pays its owner the difference between the two prices. If the stock price is lower than the strike price, then the call pays nothing. Suppose a call on the stock in Problem 1 has a strike price of 120 and expires one year from today. Then the payout of the stock will be: Payout={0S120ifS
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