关键词 > EMET3007/8012

EMET3007/8012 - Week 6 Lab

发布时间:2022-09-27

Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: daixieit

EMET3007/8012 - Week 6 Lab

Instructions Exercises 1-9 should be nished by now, and have not been included. Exercises 10-13 are function problems.  These should also mostly have been n- ished by now, but have been included for completeness.  Exercises 14 and 15 are proper forecasting problems that deal with seasonality.

Exercise 10.  Create a function which can be used to evaluate the standard

normal density

φ(x) =  exp -

What is value of φ(2) for the standard normal?

Exercise 11. Create a function which can be used to evaluate the log t density

log f(x | ν, µ, σ2 ) = log Γ -log Γ -  log(νπσ2 )-  log 1 +  2 \

[Hint: Use the gammaln function; learn about this function with help  gammaln]

Exercise 12. Using your function from Exercise 11, with ν = 5, µ = -2, σ = 1, use Matlab to nd the value of x which maximises the log t density. Optional: Argue mathematically why the maximiser was -2.

Exercise 13. Create the matrix

)-0(1) .4

H =    0

)  0

using the sparse function.

(

-0.5      1         0      0

0      -0.5      1      0 (

Exercise 14. Download the Australian Retail Sales from FRED for 2009 Q1 to 2022 Q1. (Make sure to get the quarterly non-seasonally adjusted data). Sani- tise the data (remove headings, change dates to quarter numbers, anything you think needs to be done) in Excel or otherwise. Load up the data into Matlab and perform a 1-step ahead pseudo-out-of-sample forecasting exercise for the model with one seasonal parameter as discussed in lecture. You may use the code from lecture (with appropriate modifications) or construct your own code for this task.

Report the MSFE for this specification.

Exercise 14a.  Based on your graph in Exercise 14, you should see that the given specification underestimates the size of the seasonal variation in later peri- ods. Create a new specification with an additional explanatory term of D4 × t, the dummy variable at quarter 4 times time.  Perform a 1-step ahead pseudo-out-of- sample forecasting exercise and report the MSFE for this specification. Compare the efficacy of this specification with the model from Exercise 14.

Exercise  15.  Use the Australian retail data from Question 14.   Construct a Holt-Winters 1-step ahead pseudo-out-of-sample forecasting approximation for using the seasonal Holt-Winters model. You may use the code from lecture (with appropriate modifications) or construct your own code for this task.  Report the MSFE for this specification. Graph your estimates against the true data.

Exercise 15a.  Based on your graph in Exercise 15, you should see that the Holt-Winters method underestimates the size of the seasonal variation in later periods. This is because the Holt-Winters model assumes that seasonal variation is a random walk process, when actually it has an upward trend in the fourth quarter.   Modify your code from Exercise  15 so that seasonal variation in the fourth quarter increases gradually over time.  That is, use an extra parameter a, and have

St  = 

Find an appropriate value of a (by experimentation). Report the MSFE.

Exercise 15b.  [Challenging] Based on the code from Exercise 15a, construct a new Matlab function which takes as input the parameter a, and outputs the MSFE of the Holt-Winters method with drift from Exercise 15a. Use this function to find the value of a which minimises the MSFE.