matlab-FA21

Take Test: Practice Final ExamBU.232.610.W2.FA21 Computational Finance Assignments Take Test: Practice Final Exam Test Information Description Instructions Multiple Attempts This test allows multiple attempts. Force Completion This test can be saved and resumed later. This
practice final exam contains 6 short questions covering materials from
Weeks 6 and 7 and two long coding questions Q7 and Q8. The answer to the
short questions is available instantly after you submit. The answers to
the coding questions will be provided a few days before the final exam.
This is so that you have at least a few days to try these questions on your own without looking at the solution. The
format of the actual final exam will contain 10 short questions
covering material from ALL weeks of the class with a focus on the last
two weeks. It will also contain two long coding questions of a similar type to the practice questions provided here. a. b. c. d. e. QUESTION 1 You wrote a program to approximate E[sin(x)], where x ~ Normal(0, pi). Which of the following is NOT a step in your process Compute the mean of a vector All of the above are steps in the process Solve for the integral of sin(x) Find the sine of a vector Generate normally distributed random numbers with a mean of 0 and a standard deviation of pi 2 points Save Answer a. b. c. d. e. QUESTION 2 You wrote a for loop with 10 iterations. In each iteration i, you generate N numbers from the uniform distribution and store their mean in the i’th element of a vector X. For which value of N would std(X) most likely be smallest Assume that you do not fix the seed inside the for loop. 1,000 100 10 10,000 It’s impossible to tell. 2 points Save Answer a. b. c. d. e. QUESTION 3 Suppose that I provided you with two MATLAB functions F() and G() and asked you to use them to simulate random numbers from a particular distribution. F(x) computes the probability that a random variable from your desired distribution is less than or equal to x. The only thing you know about G is that for any number a, G(F(a)) == a is true. Which of the following commands generates N samples of the desired random variable rand(N,1) randn(N,1) G(rand(N,1)) F(rand(N,1)) None of the above 2 points Save Answer Question Completion Status: My Institution Courses Community Content Collection Library Research Carey Student Resource Evaluation Support Click Save and Submit to save and submit. Click Save All Answers to save all answers. LogoutXU ZHAO 69 QUESTION 4 You have sampled 10 numbers using rand(). The first 9 are all above 0.3. What is the probability that the 10th is also above 0.3 2 points Save Answer QUESTION 5 What is the value of a share of stock in 25 trading days if its mean daily log return is 0.5% and its current value is $23 Report your answer to the nearest cent. 2 points Save Answer a. b. c. d. e. QUESTION 6 Here is code defining a function: And here is the contents of a script file: Which variables exist in the workspace after you run the script file number number, absval x, y number, absval, x, y y 2 points Save Answer QUESTION 7 1. Merge the QCOM and TXN data into one table with the longest common sample, then calculate the daily log return for each stock and add these two columns to your table. 2. Add a column to your table called group_10day, where the first 10 days (days 0 through 9) are in group 0, the next 10 days (days 10 through 19) are in group 1, and so on. 3. Calculate the cumulated 10-day log return for each group and put them in a new table with the groups in one column and the 10-day log return for each stock in two other columns (it’s okay if you have more columns than just those three). 4. Estimate expected 10-day log return volatilities of each stock from this new table, as well as the correlation between them. Report your findings using disp(). 5. You are a portfolio manager for a fund. You expect both stocks to grow daily by 0.04% on average and buy 100 shares of QCOM and 75 shares of TXN. However, your fund has a loss limit policy. If after 10 days your portfolio loses more than $2,000, you must immediately sell your positions and invest the proceeds in a risk-free bond instead for the remaining period. The risk-free bond earns an interest rate of 0%. Simulate the value of your portfolio 10 days after your initial investment. 6. Use disp() to report (1) the average return (in percent), (2) the probability that the loss limit forces to you to sell your positions, and (3) the average loss (in dollars) that you realize when selling your positions because of the loss limit. 7. You find the loss limit of $2,000 frustratingly low and ask your fund’s risk management department to revise it, such that it is triggered only in worst 1% of cases. What do you want the new loss limit to be, in dollars Use disp() to report your answer. The attached files QCOM.xlsx and TXN.xlsx contain many years of daily stock prices for Qualcomm and Texas Instruments, two semiconductor manufacturers. Attach File Browse Content Collection 15 points Save Answer Question Completion Status: Browse My Computer Click Save and Submit to save and submit. Click Save All Answers to save all answers. QUESTION 8 1. The mean simulated BTC price 200 days from now, and 2. The average number of days that will experience price drops bigger than 10%. On May 10, 2021, Bitcoin was trading for $57,628.30, having gone up from 32,149.90 on January 1. The daily volatility has been 3.51%. Assume that for the foreseeable future 90 out of 100 days will continue to exhibit this kind of performance. Model returns on those days as lognormally distributed with daily volatility as given and daily mean log return implied by the change in prices so far this year. However, the other 10 out of 100 days (let’s call them “disaster days”) can exhibit big Pareto distributed drops. On those days, the negative of the log return is drawn from a Pareto distribution whose CDF is given by: Assuming all three random variables – type of day (normal vs. disaster), returns on normal days, and returns on disaster days – are independent, simulate 10,000 200-day paths of Bitcoin prices. Use disp() to report Attach File Browse Content Collection 10 points Save Answer Question Completion Status: Browse My Computer Click Save and Submit to save and submit. Click Save All Answers to save all answers.