r studio代写-ECON 2021

Problem Set 1
Robert Kohn
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
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)
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
{"found_math": false, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0}