CS计算机代考程序代写 Problem Set 1
Problem Set 1
Robert Kohn
UNSW School of Business University of New South Wales ECON 2021
March 1, 2021
Please work by yourself on the problem set. The problem set should be handed in by midnight, March 8. Please attempt all the questions. We will mark three of them, picked at random.
Please generate 9 observations y1, . . . , y9 from a normal distribution with mean μ = 1.0 and standard deviation σ = 0.6. You will use these observa- tions as the data. We will refer to these observations as returns on a stock.
You can use rnorm(m) to generate m standard normal random numbers. Now if x is standard normal, then z = μ + σx is normal with mean μ and standard deviation σ. To be able to reproduce these m random numbers again, you can use set.seed(i), where i is an integer, e.g. i=5. (Try it) . Please use set.seed(20) when you generate the random numbers.
Q1. We now wish to predict the 10th return y10, and obtain a 90% prediction interval for it assuming that we know μ and σ.
(a) Predict y10 and obtain 80% and a 90% PI’s for it. (b) Find the Bias and variance of the predictor.
(c) Find the RMSE of the prediction.
Q2. Here we pretend that we do not know μ and σ.
(a) Use the data to estimate the mean μ and the standard deviation σ and report your results.
1
(b) Please estimate and report the standard error of the estimate μ = y.
(c) Please obtain and report the 90% confidence interval for μ.
Q3. In this question we have the same situation as in Q2. We now wish to
again predict y10 as in Q1, but now we do not know μ and σ.
(a) Predict y10 and obtain 80% and a 90% PI’s for it. (b) Find the Bias and variance of the predictor.
(c) Find the RMSE of the prediction.
(d) Compare the results you obtained in Q1, Q2 and Q3.
Q4. What do you think will happen if the number of observations (the data) you had was n = 100 instead of n = 9.
Suppose now that we consider w0,…,wn as n + 1 prices of a stock. Suppose that w0 = 1.0. Define
yt = logwt −logwt−1
as the returns on the stock in periods 1,2,…,n.
Q5. Consider the 9 returns y1, . . . , y9 above.
(a) With w0 = 1.0, please compute w1, . . . , w9.
(b) Please predict w10 and obtain 80% and 90% prediction intervals (PI)
Q6. Obtain the daily closing share price for CBA shares from 25/1/2021 to 1/3/2021. Call these w0,w2,…. Let yt = logwt − logwt−1 be the returns. Please compute the daily returns for CBA. You can use the diff command in R.
(a) Please predict the stock price for 2/3/2021 and obtain 80% and 95% PIs.
(b) Describe how you would go about predicting the stock price for 3/3/2021 and 4/3/2021.
Q6. Consider the daily prices in Q5. 2
(a) Do the daily prices look stationary? Explain your answer. (b) Do the daily returns look stationary? How can you tell.
(c) Are the daily returns approximately white noise. Please look at the first 15 autocorrelations.
3