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

Data Science & Machine Learning in Finance (ACCFIN5246)

Assignment 1 – Spring 2022


Instruction

—  Please answer all questions.

—  This is an individual assessment.

—  Submission to be made electronically via the course Moodle page.  This includes a written

report including analytical steps taken, numerical answers, diagrams, tables and comments. Please submit only the main report  (no additional spreadsheet, software routine, etc.   is required), however you can include additional tables or developed routines as appendixes (clearly explain the reason to include any additional appendix).

—  Clearly number each question and sub-question. Each part in the assignment carries a weight

described below:

Question      Weight   

1              25%

2              40%

3              35%

— You can use a calculator or a software to carry out computations.

—  Creating clear and effective diagrams and tables is an important feature to convey information

as a part of any written report.  These must be self-explanatory with descriptions, variable units and axes’ labels. Clarity of each of these components carries a weight in the assessment.

Question 1   Propose a real-world financial scenario that can be formulated and examined with a linear regression specification.

(1.1)  Briefly explain the setting. Create a table to define the financial outcome of interest (y) and

three explanatory variables {x1 , x2 , x3 } that drive the outcome variable.  (5%)

(1.2)  State the specification and explain why this formulation you propose is appropriate to this

setting.  (5%)

(1.3)  Provide a complete financial interpretation for each parameter.  (5%)

(1.4)  Propose an empirical set-up where the relationship from one of the three aforementioned

explanatory variables in (1.1) to the outcome is one-directional.  (10%)

Question 2   Consider the capital asset pricing model characterised by the following specification used to interrelate real excess return, on a given asset rt  _ rf,t  where rf,t  is the risk-free rate, to the market real return denoted by rm,t :

rt _ rf,t

=

αw + βw (  rM,t _ rf,t    ) +  ut

(1)

       .

 

           .

 

risk premium

 

market premium

 

note that the object of interest is the time-varying feature of the coefficients  w   and w .   In particular, w   summarizes the conditional relationship, given a rolling window incorporating a consecutive but limited span of data, between the market risk premium rM,t _ rf,t  and the excess return.  The diagram below provides a visual illustration to describe overlapping windows that include 12-consecutive monthly data. You are required to obtain data for the variables needed to

construct and estimate the model, in particular, the data should cover the period 3bbbyb)-3b33yb), on a daily basis further described as below:


Jan    Feb    Mar    Apr    May    Jun     Jul    Aug    Sep    Oct    Nov    Dec    Jan    Feb    Mar     . . . 

 

        ...        ......                             1      2      3                                             .        .       .        

w=4

— You can use the US consumer price index to transform nominal data into real terms.  This

data can be acquired from several sources, including the Federal Reserve Economic Data (FRED) at (https://fred.stlouisfed.org/).

—  (rt ) real returns, associated Apple stock which can be acquired from several sources.  The  Wharton Research platform (WRDS) provides this price data at https://wrds-www.wharton . upenn.edu/.1

—  (rM,t ) real returns, associated with US equity market described by the S&P500 composite

market index.  You can use either the price or return data according to your setting (i.e. locally transform prices to returns).

—  (rf,t ) real returns, associated with US treasuries (10-years maturities) — this can be acquired from WRDS or FRED (https://fred.stlouisfed.org/).

Based on the data you acquire and the specification above, complete parts (2.1)-(2.4):

(2.1)  Briefly explain how you construct real excess return rt _ rf,t  and real market excess returns rM,t _rf,t . Construct average returns over the indicated time span in the table below.  (10%)

 

Average Nominal Returns

Average Real Excess Returns

A

7t

7M,t

7f,t

7t   7f,t

7M,t   7f,t

2000/01-2014/12

 

 

 

 

 

2015/01-2019/12

 

 

 

 

 

2020/01-2021/12

 

 

 

 

 

Implement a code to estimate specification (1), as a rolling window.  Store all values obtained for αw , βw , their standard errors, their associated p-values and each regression’s Rw(2)-statistic.

(2.2)  Construct three diagrams:  (i) estimated w  per window over time,  (ii) estimated w  per

window over time, and regressions Rw(2)  per window over time.  (10%)

(2.3)  Construct the following two indicators:

Ⅱ ╱w    =    

Ⅱ ╱w    =    

Depict Ⅱ╱w and Ⅱ╱w on two separate diagrams.  Comment how these indicators inform about interpretability of the estimation results.  (10%)

(2.4)  Construct a table to summarise the following five components: the number of windows you obtained, the average values for w  and w  aggregated across all windows, and aggregated values     w Ⅱ ╱wand     w Ⅱ ╱w.  (10%)

All constructed diagrams must be clearly labelled (each axis to show the variable represented and

its unit).

1 Home,  Get  Data,  CRSP,  Annual  Update,  Stock  /  Security  Files,  Daily  Stock  File

 

#Windows  

Nw

 

w Ⅱ ╱w

Question 3   The notion of liquidity in finance is defined by an asset price response to traded quantities.   More specifically,  a liquid asset price exhibits minor changes as a result of major traded quantities, whereas an illiquid asset price exhibits major changes to minor-moderate trade quantities.  Consider estimating the elasticity of demand for a particular publicly traded asset A denoted by qi(d)  = α0  + α 1pi  + ui  where pi  = ln Pi , Pi  is the actual price, and qi(d)  = ln Qi(d)  with Qi(d)  denoting the quantity of shares demanded by investors, and that each i = 1, . . . , N represents a quantity-price pair (qi(d), pi ).  Note that the quantities demanded qi(d)  characterise willingness to purchase, given all possible prices pi , which is not directly observable in financial market datasets. The term ui  represents other factors besides price that affect demand, such as investors wealth, personal valuation, etc.   The market’s existing outstanding supply of shares equation is in the same form, and is given by qi(s)   = β0  + β 1pi  + vi  where the term vi  represents the factors that affect supply, such as underlying company’s performance, sales, access to financing, union status, etc.   Assume first, that the two error terms are uncorrelated, and second that the equilibrium condition qi(d)  = qi(s)  = qi  holds indicating that observed quantities collect both demand and supply

sides characteristics, then:

(3.1)  Derive the the reduce form system in terms of pi  and qi . This indicates setting qi(d)  = qi(s)  = qi and solving the demand and supply equations for pair (qi , pi ) explicitly as functions of all other parameters included in the two equations (α0 , α 1 , β0 , β 1 , ui , vi ).  (10%)

(3.2) In relation to explicit expressions obtained in (3.1) for pi  and qi , what are the terms var(pi ), var(qi ) and cov(pi , qi ) — simplify as much as possible.  (10%)

(3.3)  Show that the ordinary least squares estimator resulting from the regression of qi  on pi  is

biased for both structural parameters α 1  and β 1 .  (15%)