Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: THEend8_
QBUS6840
Predictive Analytics
Mid-term Exam Practice Questions
The purpose of these practice questions is to give you sample questions to practise for the mid-
term exam, and to give you some ideas about the details and format of the exam questions. Please
note that the set of questions below is not meant to cover all the topics tested in the midterm
exam.
Question 1
The file beer.txt contains two named columns ’Time’ (month) and ’Sales’ (numerical). Read
the following Python program:
[ 1 ] import pandas as pd
[ 2 ] import matp lo t l i b . pyplot as p l t
[ 3 ] import numpy as np
[ 4 ] beer = pd . r ead c sv ( ’ beer . txt ’ )
[ 5 ] s a l e s = beer [ ’ Sa les ’ ]
[ 6 ] s a l e s v = s a l e s . va lue s
[ 7 ] p l t . f i g u r e ( )
[ 7 ] p l t . p l o t ( s a l e s )
[ 8 ] p l t . t i t l e ( ’ Beer Sa les ’ )
[ 9 ] p l t . x l ab e l ( ’Month ’ )
[ 1 0 ] p l t . y l ab e l ( ’ Sa les ’ )
[ 1 1 ] myT = s a l e s v . r o l l i n g (12 , c en t e r=True ) . mean ( )
[ 1 2 ] T = s a l e s . r o l l i n g (2 , c en t e r=True ) . mean ( )
[ 1 3 ] T1 = T. r o l l i n g (12 , c en t e r = True ) . mean ( ) ;
[ 1 4 ] What i s th i s = beer [ ’ Sa les ’ ] . ewm( alpha =0.05 , ad jus t=True ) . mean ( )
[ 1 5 ] p l t . f i g u r e ( )
[ 1 6 ] p l t . p l o t ( s a l e s )
[ 1 7 ] p l t . p l o t (T1)
[ 1 8 ] p l t . p l o t ( What i s th i s )
[ 1 9 ] p l t . t i t l e ( ’ Beer Sa les ’ )
[ 2 0 ] p l t . x l ab e l ( ’Month ’ )
[ 2 1 ] p l t . y l ab e l ( ’ Sa les ’ )
Please answer the following questions:
(a) Explain the meaning of statement [4] in the program. What is the data type for variable
beer?
(b) What is the data type of the variable sales in statement [5]? What is the difference
between sales and sales v from statement [6]
(c) Do you have any concerns about this program? At which line would you expect an error
message when running this program or not? Why?
(d) How to handle the issue you identified in (c)?
(e) Write out the mathematical formula to replicate T from sales in statement [12].
(f) Explain the meaning of T1 in statement [13]. How many number of values/data have we
lost on the both ends of T1. Explain the reason for this.
(g) Explain the meaning of statement [14].
(h) Roughly sketch the figure given by statements [15]-[21]? You may assume a monthly
seasonal plot for the beer sales
Question 2
What is a scenario based forecast? What is an ex-ante forecast and an ex-post forecast? Give
an example where ex-post forecasts can be used.
Question 3
Which forecasting method forms a forecast by weighting the most recent data (in time) more
highly than less recent data and how?
Question 4
Describe/List the main differences between qualitative and quantitative forecasting methods.
Question 5
Which measure of forecast accuracy should be used in the following situations? Give their
definition in formulas.
(a) A small number of large forecast errors may be allowed
(b) Errors need to be measured in percentage terms.
(c) Whether a model’s forecasts are biased or not is more important than the magnitude of
errors.
Page 2
Question 6
Consider the following time series plot showing annual labour force data in Australia.
(a) Describe the main features or components apparent in the data
(b) List three quantitative forecast models that might be tried for this data, with brief
motivation for each choice.
Question 7
Describe the multiplicative decomposition method by showing each major step.
Question 8
Describe the additive decomposition method by showing each major step.
Question 9
(a) Find the weights for the smoother Centred MA-6
(b) Indicate how many missing observations there will be at the start and end of the smoothed
series in (a).
(c) Identify the smoothing method in (a) as a Weighted MA-k. What are k and the weights?
(d) Devise a symmetric smoother that is an WMA-5 so that the weight on time t is 1.5 times
the weight at times t− 1 and t+ 1, and double the weight at times t− 2, t+ 2.
Question 10
The trend corrected exponential smoothing model is given by the equations:
lt = αyt + (1− α)(lt−1 + bt−1), 0 ≤ α ≤ 1 (1)
bt = γ(lt − lt−1) + (1− γ)bt−1 0 ≤ γ ≤ 1 (2)
yt+1 = lt + bt + ϵt+1, with ϵt+1 ∼ N (0, σ2) (3)
Page 3
(a) Put this model in the error correction form.
(b) Derive the 1, 2 and 3 step-ahead forecasts from this model. Explain briefly why this
model is called the ’local-linear’ forecasting model.
(c) Discuss exactly how the model in (b) is different to simple applying a linear trend (with
normal errors) as follows:
yt = β0 + β1t+ ϵt
(d) The h-step ahead forecast and forecast variances from the model in (b) are:
Yˆt+h = lt + h× bt (4)
V ar(Yt+h|y1:t) = σ2
(
1 + α2
h−1∑
k=1
(1 + γk)2
)
(5)
Prove the above formulas when h = 2.
What happens to the forecasts and forecast intervals as h gets larger? What happens as
h tends to infinity? Explain how and why this behaviour can reasonable in a statistical
model
Question 11
Consider the damped Holt’ s linear model:
yt+1 = lt + ϕbt + ϵt+1
lt = αyt + (1− α) (lt−1 + ϕbt−1)
bt = γ (lt − lt−1) + (1− γ)ϕbt−1
Figure 1
(a) Explain the meaning of lt and bt.
Page 4
(b) How do you choose the optimal α and γ?
(c) How would we modify the model to get the estimations on the blue line?
(d) Write down the expression for the h-step-ahead forecast. What is the h-step-ahead
forecasting value when h becomes large enough? explain the reason.