0% found this document useful (0 votes)
22 views

Python for Finance Exam 2023 (1)

The document is an examination paper for a course titled 'Python for Finance' for the academic year 2022-2023. It consists of two sections: Section A with open-ended questions covering topics such as pairs trading, supervised machine learning, and the Capital Asset Pricing Model, and Section B with code-based questions requiring error identification and explanation of code functionality. Students are permitted to use Python IDEs for coding, but calculators and dictionaries are not allowed.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
22 views

Python for Finance Exam 2023 (1)

The document is an examination paper for a course titled 'Python for Finance' for the academic year 2022-2023. It consists of two sections: Section A with open-ended questions covering topics such as pairs trading, supervised machine learning, and the Capital Asset Pricing Model, and Section B with code-based questions requiring error identification and explanation of code functionality. Students are permitted to use Python IDEs for coding, but calculators and dictionaries are not allowed.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

Examination Paper

Examination Session: Year: Exam Code:

January 2022-2023 ECON40N15-WE01

Title: Python for Finance

Time Allowed: 2 hours

Additional Material provided: None

Materials Permitted: Students can use Python (any IDE such as Spyder, Jupyter
Notebook, etc.) to test their code.
Calculators Permitted: No

Visiting Students may use dictionaries: No

Instructions to Candidates: Answer ALL questions.


The exam consists of 2 sections. Section A (60%) contains
open-ended questions and Section B (40%) contains code-
based questions.
Individual marks for questions and sub-questions are specified
in the question text itself.
Partial credit will be given for incomplete answers.

Revision:
Page 2 of 3 ECON40N15-WE01

Section A. Open-ended questions.

Question 1.

Explain in your own words how the pairs trading strategy works. Describe in detail (without writing
code) how it is implemented. Discuss the main risks associated with this strategy. [20 marks]

Question 2.

What is supervised machine learning? Give examples of supervised machine learning applications
to finance-related classification problems. What is meant by the bias-variance trade-off? [20
marks]

Question 3.

Explain the Capital Asset Pricing Model (CAPM), including the model intuition and the main
criticisms. How does Fama-French three-factor (FF-3) model improve upon CAPM? List all three
factors in FF-3 model and explain their meaning. [20 marks]

Section B. Code-based questions.

Question 4.

Consider the following block of code.

A) This code will NOT run due to several syntax errors in it. Find the errors and fix them. Type
below the entire block of code but with the errors fixed. [5 marks]
B) Describe in words what this code does. Be specific. [5 marks]
C) There is another issue with this code besides the syntax errors. What is it? [4 marks]
Page 3 of 3 ECON40N15-WE01
Question 5.

Consider the following block of code.

A) Above is an extract from a script that backtests a trading strategy. What is the trading strategy?
What are the formation and trading period lengths? Explain precisely, line-by-line, what this
block of code does. [10 marks]
B) How should the code be modified to compute a value-weighted average portfolio return rather
than an equally weighted one? (Explain in words without writing code, but be specific). [10
marks]
C) How does the logic of the algorithm change if you in line 5, 5 is replaced by 10 and in line 8, 4 is
replaced by 9? [6 marks]

You might also like