Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: THEend8_
ECMT3150: Assignment
1. [Total: 24 marks]
Note: Please append your R codes (as a separate .R
le) for part (g) while you submit the
assignment.
Let Xi denote the log-price of Nvidia (code: NVDA), by the end of trading day i, and let
Xi := Xi Xi1; thus Xi is the log-return on trading day i (i.e., over period (i 1; i]).
Assume fXig_i0 follows the AR(1) model:
Xi = 0 + 1Xi1 + ui: (1)
where ui iid normal with mean 0 and variance 2.
Let fFigi0 be the natural
ltration generated by fuigi0.
(a) [2 marks] Express Xi in terms of Xi1 and ui.
(b) [2 marks] Compute E(XijFi1).
(c) [2 marks] Compute V ar(XijFi1).
(d) [2 marks] What is the condition on 0 and 1 such that fXigi1 is a martingale
di¤erence sequence?
A trading strategy is de
ned by figi0, where i is measurable with respect to Fi.
The log-return associated with the trading strategy over period (0; T ] is given by
rT =
TX
i=1
i1Xi.
Speci
cally, i1 represents the number of NVDA shares a trader buys at the start of day i.
(e) [4 marks] Alice invested in a share of NVDA using a buy-and-hold strategy, with i 1
for all i. Compute E(rT ) and V ar(rT ) with 0 = 0 and 1 = 1.
(f) [4 marks] Bob suggested another strategy, with i Xi for i > 0 and 0 = 1. Compute
E(rT ) and V ar(rT ) with 0 = 0 and 1 = 1.
1
(g) [8 marks] Carol suggested yet another strategy, with i 1fXi > 0g and 0 = 1.
We want to evaluate the risk-return tradeo¤ of the proposed strategies using computer
simulation.
Start an R session, and set a random seed equal to the last 4 digits of your student ID.1
Then generate B sample values of rT (name them as r
(1)
T ; r
(2)
T ; : : : ; r
(B)
T ), and compute
the sample mean and standard error of rT as follows:
rT =
1
B
BX
b=1
r
(b)
T ;
se(rT ) =
vuut 1
B 1
BX
b=1
(r
(b)
T rT )2:
For the purpose of your simulations, set T = 63, 2 = 0:1, B = 1000, and X0 = 0.
The Sharpe ratio, de
ned as SR = rTse(rT ) , is a common measure of the risk-return
tradeo¤. Trading strategies with higher SR are more preferred by investors.
Complete the following table with SR values. Comment on the performance of the
trading strategies under di¤erent scenarios.
0 1 Alice Bob Carol
0 1
0:01 1
0:01 1
0 0:9
0 1:1
2. [Total: 16 marks]
Note: Correct all numerical answers to two decimal places.
Let M denote the mood of Mimi (h: happy; a: angry), and let W denote the weather (s:
sunny; r: rainy). The joint probability distribution of M and W is given in the table below.
The row and column sums are displayed in the last column and in the last row, respectively.
p(m;w) M = h M = a
W = s 0:4 0:1
W = r 0:2 0:3
A good day occurs when Mimi is happy and the weather is sunny; otherwise, a bad day
occurs. Let D denote the type of a day (g: good; b: bad). Then we have fD = gg = fM =
hg \ fW = sg and fD = bg = fM = ag [ fW = rg.
(a) [2 marks] Compute the probability that today is a bad day, i.e., compute P (D = b).
1This is to ensure that your answers are replicable but di¤erent from those of other students.
2
(b) [2 marks] Derive the conditional distribution of W given M = a.
Assume that, given m and w, your test score S follows a normal distribution with mean
(m;w) := E(SjM = m;W = w) and standard deviation 10. The conditional mean function
(m;w) is given in the table below:
(m;w) m = h m = a
w = s 70 50
w = r 60 40
The passing score is 50 or above.
(c) [3 marks] Compute the mean score E(S).
(d) [3 marks] Given that it was a bad day when you took the test, what is the mean score
you would get?
(e) [3 marks] Compute the probability of failing the test.
(f) [3 marks] Given that you failed the test, what is the probability that it was a bad day?
3. [Total: 20 marks]
Note: Please append your R codes (as a separate .R
le) while you submit the assignment.
Correct all numerical answers to three decimal places.
Mimi, an amateur economist, proposes the following time series model for ination rate:
yt =
1
10
+
1
2
yt1 1
4
yt2 + "t; (2)
where "t iid N(0; 0:012) (normal distribution with mean 0 and variance 0:012). The time
period is measured in number of quarters.
(a) [3 marks] Show that the time series fytg generated by model (2) is stationary.
(b) [3 marks] There is a stochastic cycle in the time series generated by model (2). Find its
periodity in number of quarters.
(c) [4 marks] Compute the ACF for the
rst 3 lags, i.e., (1), (2) and (3).
(d) [2 marks] Write an R program to simulate a sample path of fytg over 30 years. Set the
initial values y0 and y1 to be y0 = 0:1 and y1 = 0:12. While simulating the random
numbers for "t, set the random seed to be your last 4 digits of your student ID.
(e) [2 marks] Plot the sample ACF and record its value for the
rst 3 lags (the values can be
retrieved from the acf command output stored as a list). Why are they di¤erent from
your answers in part (c)?
3
(f) [3 marks] Using the simulated sample path in part (d), estimate an AR(2) model using
the R command arima. Write down the estimated model with the parameter estimates
and their standard error. Also record the estimated variance of the innovations.
(g) [3 marks] Using the simulated sample path in part (d) and the R package forecast,
plot the point forecast and the con
dence interval for each period over the next 5 years.
Describe the short-run and long-run behaviour of the point forecast and the con
dence
interval.