Module Code: LUBS5309M01
Module Title: Forecasting and Advanced Business Analytics
Leeds University Business School
Calculator instructions:
© UNIVERSITY OF LEEDS
Semester Two 2018/19
You are allowed to use a nonprogrammable calculator only from the following list of approved models in this exam:
• Casio fx-82, fx-83, fx-85, fx-350 series
• Sharp EL-531 series
Dictionary instructions:
You are not allowed to use your own dictionary in this exam. A basic English language dictionary is available to use if required.
Exam information:
There are 4 pages to this exam.
There will be 2 hours to complete this exam.
There are 2 sections to this exam: Section A and Section B
Section A is worth 30 marks. Answer all questions.
Section B is worth 70 marks. Answer two questions only.
You may use any of the following software on the computer provided: Microsoft Excel,
Microsoft Word, Gephi, R, R Studio and SPSS.
Answer questions in the booklet provided, a single Microsoft Word document and a
single Microsoft Excel file.
Remember to save your Word/Excel files and R code frequently throughout the exam.
Include any code that you used to answer the questions in Section B in the Word
Document.
Data for the questions in Section B will be available on Minerva at the start of the exam.
You should submit your Microsoft Word Document and Microsoft Excel File via Turnitin
submission link on Minerva at the end of the exam.
Be patient when opening applications; constantly re-opening an application when it
hasn’t opened will slow the system down.
Page 1 of 4 Please Turn Over
Module Code: LUBS5309M01 Section A
Answer all questions in Section A.
A1. Using an example, explain how a Naïve Bayes classifier works.
[10 Marks]
A2. Explain how you would give a higher weight to more recent observations when using
exponential smoothing.
[5 Marks]
A3. Explain how Monte Carlo simulations can be used when we know the data we want to
simulate isn’t uniformly distributed.
A4. With regards to text analytics, describe each of the following terms with an example:
Page 2 of 4
Please Turn Over
a. Token
[4Marks] [4 Marks] [4 Marks]
Total 30 Marks
b. c.
Type Lemma
[3 Marks]
Module Code: LUBS5309M01 Section B
Answer two questions only from Section B.
B1. A medical company has approached your consultancy business and asked for help with predicting if pregnant women will give birth to low birth weight babies. They have collected the following data (B1-train.csv) on 150 women:
age: Age of the mother in years
previousweight: Weight in Pounds at the Last Menstrual Period smoke: Smoking Status During Pregnancy (1 = Yes, 0 = No)
low:
Low Birth Weight
(0 = Birth Weight >= 2500g, 1 = Birth Weight < 2500g)
i) Using read.csv and the neuralnet function from the neuralnet package in R, import the data (B1-train.csv) and train a neural network with:
low ~ age + previousweight + smoke.
Use 2 nodes in the hidden layer and set lifesign to full. Provide and explain a plot of the best neural network (with the smallest error) using the plot function.
[20 Marks]
ii) The medical company was able to get data for another 39 women (B1-test.csv). Using your model from answer A, predict the value for low using the data in B1- test.csv. Use the read.csv and the compute functions in R to do this.
How do the predictions from the neural network compare to the real results for low
in B1-test.csv?
[15 Marks] Total 35 Marks
B2. The directors at your company are reviewing a product as its sales have dropped in the last quarter. The company has been collecting quarterly sales data for the product over the last three years from Q2 2015 to Q1 2018 (B2.csv).
Page 3 of 4
i)
Your manager thinks that the product’s sales have decreased in the last quarter due to an irregularity. Using the ts and stl functions in R, use loess decomposition on the data provided to illustrate the trend, seasonal and irregular components of the data. Set the parameter s.window to periodic. Discuss what you think has caused the decrease in sales in the last quarter and include an image of the decomposition in your answer.
[12 Marks] Please Turn Over
Module Code: LUBS5309M01
ii) Explain the advantages of loess decomposition over additive and multiplicative decomposition.
[8 Marks]
iii) Your manager wants to provide the company directors with a forecast of the product sales. Using the ets function in the forecast package in R, use exponential smoothing on the sales data to predict future sales for the next 2 years. Include an image of the forecast in your answer. Also state which variation of exponential smoothing you used and why.
[15 Marks] Total 35 Marks
B3. Your manager has created a function (bfunction) to model a business process and wants to use multi-objective optimisation to identify the maximum solution.
Bfunction <- function(x) {
x <- matrix(x,ncol=2)
a <- 1+(x[,1]+x[,2]+1)^2*(19-14*x[,1]+3*x[,1]^2-14*x[,2]+6*x[,1]*x[,2]+3*x[,2]^2)
b <- 30+(2*x[,1]-3*x[,2])^2*(18-32*x[,1]+12*x[,1]^2+48*x[,2]-36*x[,1]*x[,2]+27*x[,2]^2) f.x <- -a*b
return(f.x)
Page 4 of 4
}
i)
ii)
iii)
(the function is available on Minerva as B3.txt)
Using the ga function in the GA package in R, use a genetic algorithm to solve bfunction. Use c(-10, -10) and c(10, 10) as the minimum and maximum bounds. Include and explain the summary of the results. Include the code used in your answer.
[15 marks]
Using the plot function, plot the fitness values for the GA generations. Include and explain this plot in your answer.
[10 marks]
Your manager tells you that the genetic algorithm has performed well for a global search but not for a local search. He says to use a memetic approach to solve the business process. Explain the terms global search, local search and memetic.
[10 marks]
Total 35 Marks End