Main Examination Period 2020
ECOM135 Machine Learning with Applications in Finance Duration: 3 hours
ANSWER FOUR QUESTIONS
The first four questions that you submit will be marked. Cross out or
delete any answers that you do not wish to be marked.
COMPLETED PAPERS SHOULD BE SUBMITTED VIA QMPLUS AND ALSO E-MAILED TO
ECOM135-exam@qmul.ac.uk.
THIS IS AN OPEN BOOK EXAMINATION TO BE CONDUCTED ONLINE. YOU MAY REFER TO
ANY OF THE COURSE MATERIALS, OR ANY OTHER SOURCE OF INFORMATION. YOU MAY
ALSO USE A SPREADSHEET OR CALCULATOR.
THE SHARING OF THIS EXAMINATION PAPER IS AN EXAMINATION OFFENCE.
YOU ARE REQUIRED TO TYPE YOUR ANSWERS, HANDWRITTEN ANSWERS ARE NOT
PERMITTED.
PLEASE ENSURE THAT YOUR WORKING IS CLEARLY SHOWN WITH ALL STEPS OF YOUR
CALCULATION INCLUDED IN YOUR ANSWER DOCUMENT, INCLUDING ANY FORMULA USED.
When writing formulas, please note the following:
· It is acceptable to use the standard alphabet in place of Greek letters. The following are
recommended: a for , b for , d for , D for , l (lowercase l) for , m for μ, v for (to avoid
confusion with n), s for , S for .
· Use + for addition, – for subtraction, * for multiplication and / for division.
· Where appropriate use an underscore to indicate a subscript, e.g. x i for xi.
· Use the character for power, e.g. x^2 for x2, x^0.5 for px.
· When referring to the following functions use log(x) or ln(x) for loge x, logb(x) for logb x,
exp(x) for ex, cos(x) for cos x.
· Use infty for 1.
· Use Sum to denote summation of terms, e.g. Sum (i=1)^n x i for Pni=1 xi.
· Use Prod to denote product of terms, e.g. Prod (i=1)^n x i for Qni=1 xi.
Guidance continued on the next page
Page 2 ECOM135 (2020)
· Use D for derivative, e.g. D(x^2) = 2x.
· Use Int for integral, e.g. Int a^b (x) dx for R ba x dx.
· Use cap for and cup for [ when referring to sets.
· Where it is not obvious that an estimate is implied then state this in full, e.g. ‘a suitable
estimate of b is 0.125’ or more simply (and equally acceptable) ‘est.b = 0.125’.
· Use brackets as necessary. To make your answer clearer use di erent types of bracket pairs where
appropriate, e.g. (), [], {}.
Use obvious choices for any other mathematical symbols not listed above that you may require.
Examiner: Dr R.A. Saldanha
c Queen Mary University of London, 2020
ECOM135 (2020) Page 3
Question 1
a) What is a na¨ ve Bayes classifier Explain the probability model and the decision rule.
[10 marks]
b) Consider the following training dataset which gives selected firm type, size, UK domicile and
whether or not the firm has been granted a margin trading account.
Type Size UK Margin
Hedge Fund Medium no yes
Asset Manager Large yes yes
Investment Bank Medium no no
Asset Manager Small yes yes
Investment Bank Medium no no
How would a na¨ ve Bayes classifier determine whether a new hedge fund that is small in size and
domiciled in the UK would be given a margin trading account
[8 marks]
c) You work in the credit risk department of a prime broker. A potential hedge fund client appears to
have a poor credit score. However, such a score is quite prevalent, around four out of five hedge
funds have much the same score. You also know that historically the probability of such a score
given observed defaults is also high at around 40%. The actual probability of hedge fund default is,
however, much lower around 7%. Your firm only accepts clients who have less than a 5% risk of
default. Based on the available evidence, do you recommend giving this client a trading account
[7 marks]
Turn over
Page 4 ECOM135 (2020)
Question 2
The Poisson distribution with parameter has density
P (X = x) =
xe
x!
for x = 0, 1, . . .
a) Explain generally how this particular statistical distribution arises.
[4 marks]
b) i. Under what conditions does the Poisson distribution serve as an approximation to the
binomial distribution
ii. Under what conditions does the normal distribution serve as an approximation to the Poisson
distribution
[4 marks]
c) High-frequency algorithmic trading errors for a particular hedge fund occur on only two trading
desks. The first desk experiences an average of one error every five weeks. The second desk
experiences an average of one error every eight weeks.
i. What would be a suitable combined probability model for these data
ii. Calculate the probability of three or more high-frequency algorithmic trading errors occurring
for the hedge fund during a particular week.
[8 marks]
d) A particular stock exchange experiences the following monthly main hardware computer failures
over a period of 20 years:
Number of Number of
failures months
0 169
1 62
2 7
3 2
4+ 0
Do these computer failures appear to occur randomly in time Explain your assumptions,
calculations and conclusion carefully.
[9 marks]
ECOM135 (2020) Page 5
Question 3
a) Why is Principal Component Analysis (PCA) sometimes described as an unsupervised machine
learning technique
[2 marks]
b) For what reasons might you apply PCA
[3 marks]
c) The following sample variance-covariance matrix S has been calculated using the daily log returns
( 100%) for four stocks from the Nasdaq 100 index over one year:
AAPL CSCO GOOGL NVDA
AAPL 2.75
CSCO 1.36 2.41
GOOGL 1.39 0.93 2.23
NVDA 2.49 1.95 1.75 6.62
What is the corresponding sample correlation matrix R What conclusions (if any) do you draw
from R
[7 marks]
d) A PCA analysis was carried out using exactly the same data used to compute S. The following
computer output was obtained:
Loadings:
Comp.1 Comp.2 Comp.3 Comp.4
AAPL 0.421 0.456 0.153 0.769
CSCO 0.337 0.415 -0.800 -0.272
GOOGL 0.312 0.487 0.580 -0.574
NVDA 0.782 -0.618 0.032 -0.068
Importance of components:
Comp.1 Comp.2 Comp.3 Comp.4
Standard deviation 3.077 1.443 1.182 1.007
Proportion of Variance 0.678 0.149 0.100 0.073
How valid is this analysis What are your conclusions
[9 marks]
e) How might you use the results from PCA in other analyses
[4 marks]
Turn over
Page 6 ECOM135 (2020)
Question 4
a) Why is it often necessary to use numerical optimization to estimate the parameters of a machine
learning model Give two examples to support your answer.
[3 marks]
b) The following fictitious ordinal integer credit score data y is displayed as a histogram in Figure 1
below. The higher the score (max 999) the better the credit quality. A reasonable credit score is
considered to be a score higher than 721. What do you observe about these data What type of
model for these data would you consider fitting
[7 marks]
Figure 1: Credit score data (350 observations).
c) The following log-likelihood function was chosen as a suitable model for the data displayed above in
Part b):
l(p, μ1,1, μ2,2; y) =
nX
i=1
log