程序代写案例-M524
时间:2021-12-17
Exam 2
M524 Financial Econometrics, Fall 2021
9:30AM, December 14th ∼ 9:30AM, December 15th
Instructions: This is an open-book, take-home exam. Attach the Matlab code(s) of your work
to the submission on Canvas. They should be reasonably easy-to-read and should be able to run
from my work station without any difficulty. If I cannot read them, I cannot grade them. Do not
include any irrelevant codes or texts. Partial credits can be given based on your work so I advice
to try the best you can and not leave any questions blank.
You must also attach a ‘readme your first name.txt’ to describe your codes and how to run it
in order to see results, if it involves elaboration. For example, you need to tell me how to set the
directory for your code and how to utilize certain Matlab Toolboxes if you plan to use any. You
must also describe the important variables you used in Matlab including their name and their role
in your code. It should be easy to read and understand. You must also reference the names of the
codes in any Matlab Toolbox you choose to use.
Getting help or using work from others to solve your exam is academic misconduct. Please read
the template uploaded on canvas titled readme MJ example instructions.txt for more details.
◦ Good Luck! Email me at myonshin@iu.edu for any issues, clarifications, or questions regarding
the exam.
1
1. data1945 2015.mat(for question 1)
(a) data: The raw dataset.
(b) date: Years from 1945 to 2015.
(c) dividend: Dividend.
(d) price: Price data from S&P500 index.
2. Q2.mat(for question 2)
(a) data: The raw dataset.
(b) date: Quarters from 1947Q1 to 2017Q4.
(c) sp: S&P500 return.
(d) crsp: CRSP value-weighted return
(e) cons: Real consumption expenditures per capita nondurables plus services.
(f) cc: Cyclical consumption from the full sample.
(g) log excess crsp: log CRSP value-weighted excess return.
(h) log excess sp: log S&P500 excess return.
(i) log crsp: log CRSP value-weighted market return.
(j) log sp: log S&P500 market return.
(k) rf: Risk-free rate.
(l) infl: Inflation.
3. GW predictors m524.mat
(a) GW predictors m524: The macro dataset of Goyal and Welch from 1947Q1 to 2017Q4.
(b) log DP: Log dividend-price ratio.
(c) log DY: Log dividend yield.
(d) log EP: Log earnings-price ratio.
(e) Svar: Stock Variance.
(f) BM: Book-to-market ratio.
(g) NTIS: Net equity issuance.
(h) TBL: Treasury bill rate(annualized).
(i) LTY: Long-term yield(annualized).
(j) LTR: Long-term return.
(k) DFY: Default yield spread(annualized).
(l) DFR: Default return spread.
2
1. Suppose you want to estimate β using OLS from the following model finite sample t =
1, 2, · · · , T , with assumed joint normality of the error terms as shown below. Estimator is βˆ.
rt =α+ βxt−1 + ut (1)
xt =θ + ρxt−1 + vt (2)
where,
(
ut
vt
)
iid∼ N(0,Σ) (3)
Σ =
(
σ2u σuv
σvu σ
2
v
)
, δ =
σuv
σuσv
(4)
We already know from lectures on Stambaugh’s estimator that the model creates a bias in
the estimation of the slope coefficient(also for intercept) when the data has high ρ and δ.
E(βˆ − β) = E(ρˆ− ρ)σuv
σ2v
Consider another predictive regression bias-corrected slope estimator by Lewellen(2004, JFE).
The main idea behind it is that the largest possible bias(worst case scenario) occurs when ρ
is equal to one, as xt is considered to be not explosive so it is a good choice for maximum
value. Therefor, he proposes a conservative estimate of the bias-corrected slope conditional
on ρ = 1, βˆadj = βˆ − βˆuv(ρˆ− 1).
We want to test the hypothesis using the test statistic given below and the standard normal
critical values(two-sided, 5%) under the null of no predictability H0 : β0 = 0. For the given
annual dataset data1945 2015.mat, use them to define the continuously compounded return
rt, as discussed in class, and the log of dividend-price ratio and use it as xt. Its one-period
lag is xt−1 and its average x¯t−1.
Qtest =
βˆ − βˆuv(ρˆ− 1)
σˆu(1− δˆ2)0.5(
∑T
t=1 x
u2
t−1)−0.5
(5)
βuv =
σuv
σ2v
xut−1 = xt−1 − x¯t−1
(a) Write the code to calculate βˆadj = βˆ−βˆuv(ρˆ−1). The correct answer is 0.02646(rounded).
(b) Write the code to calculate Qtest. The correct answer is 1.4352(rounded). Can you
reject the null? What about when we choose 10% significance level?
3
2. Consider a paper by Atanasov, Møller, Priestly(2020, JOF). Read the paper uploaded on
Canvas up to p.1703 before answering the questions below.
Let’s run the following horizon-h regression where cct is the proposed predictor called cyclical
consumption forcasting for log excess return or log market return on the stock market:
rt,t+h = α+ βcct + ϵt,t+h (6)
The quarterly data for the exercises below inside Q2.mat is described as follows. First, crsp
is the return on the Center for Research in Security Prices (CRSP) value-weighted index of
U.S. stocks listed on the NYSE, NASDAQ, and Amex. sp is the return on Standard and
Poor’s composite stock price index. They are both simple net return Rt. In order to calculate
log market return for each index, to the following.
ˆ rt,t+1 = log(Pt+1/Pt) = log(1+Rt+1). For example, rt,t+1 at 1947Q1 is log(1−0.01497)).
ˆ rt,t+h =
∑h−1
j=0 rt+j,t+1+j
rf is the return on the 30-day Treasury bill. In order to calculate log excess return, you need
to subtract its log return from the log market return. Do the following.
ˆ rft,t+1 = log(1 +RFt+1,T-bill). For example, rft,t+1 at 1947Q1 is log(1 + 0.00082).
ˆ r∗t,t+h =
∑h−1
j=0 (rt+j,t+1+j − rft+j,t+1+j)
cons is the adjusted real per capita consumption expenditures on nondurables and services
and log of it is denoted ct.
The predictor cyclical consumption is calculated as follows, First estimate a least squares
regression of ct on its four lagged terms plus a constant, where the first term is lagged 24
periods from ct(this is not AR4).
ct = β0 + β1ct−24 + β2ct−25 + β3ct−26 + β4ct−27 + ωt
With estimated βˆ’s, define cyclical consumption, cct, as the residual of the above regression.
cct = ct − βˆ0 + βˆ1ct−24 + βˆ2ct−25 + βˆ3ct−26 + βˆ4ct−27
In order to help you, I have calculated rt,t+1 for both log market return and log excess return
using CRSP and S&P500 data respectively(h=1). For reference, I also included cyclical
consumption, cc, extracted from the full sample of cons. Notice that we miss the first 27
observations at the beginning due to the definition of cct and lags required for its estimation.
4
(a) Replicate the results for the slope estimate βˆ, Newey-West corrected(meaning using
NW estimator for lrv) t-statistics, and adjusted-R2 in percentages, in Panel A and
Panel C of Table I, p.1684 in the paper, for both types of returns and for all h’s; h =
1, 4, 8, 12, 16, 20. The NW estimator used in the paper is of this form; ˆLRV NW (Zt) =
γˆ0 + 2
∑h
j=1(1− jh+1)γˆj . I advice to use nwest.m on Canvas and use the corresponding
h value for the input argument nlag . You do not need to report significance levels.
(b) Using a portion of alternative predictors used in the paper p.1701∼p.1702, report the
slope estimates when augmenting the regression with their first two principal compo-
nents and running (7). In particular, their data is from Goyal and Welch dataset and
it is stored in GW predictors m524.mat which spans 1947:Q1∼2017:Q4. When loading
you will see a matrix GWs m524 and each column is a predictor data. A total of 11
predictors’ data is given and its label is as follows. Refer to their paper for more details.
ˆ GWs=[log DP log DY log EP Svar BM NTIS TBL LTY LTR DFY DFR];
rt,t+h = α+ βcct + γ1PC1 + γ2PC2 + ϵt,t+h (7)
You need to use NW for standard errors so I again advice to use nwest.m in the same
way as before. Answer below by just using log excess return using CRSP, for rt,t+h.
1. Estimate β, γ1, and γ2 respectively for h = 1, 4, 8, 12, 16, 20.
2. Calculate β, γ1, and γ2’s t-statistic respectively using NW standard errors for h =
1, 4, 8, 12, 16, 20.
3. Get adjusted-R2 for h = 1, 4, 8, 12, 16, 20.
(c) Replicate the results in Table VI using out-of-sample recursive estimation window for
h = 1, 4, 8, 12, 16, 20. You do not need to report significance levels and also do not report
‘ENC-NEW’ test results. For the MSE-F test from McCracken(2007, JOE), below is
the formula for the test statistic where model 1 is the historical mean and the model
2 is (6) and MSE is the mean squared error respectively. The order matters unlike
Diebold-Mariano and Giacomini-White tests as this is a one-sided test.
MSEF = (n2 − h+ 1) ∗ MSE1 −MSE2
MSE2
(n2 − h+ 1) is the number of forecasts made in the evaluation sample. Be careful that
according to the definition cyclical consumption, its value is dependent on the sample
size so each recursive out-of-sample estimation window will need a different cct.
5




essay、essay代写