# report | security | Machine learning | assignment | Finance代写 – Machine learning in Finance (ACCFIN5246)

### Machine learning in Finance (ACCFIN5246)

report | security | Machine learning | assignment | Finance – 本题是一个利用Machine learning进行Finance 的代做, 对Machine learning的流程进行训练解析, 是有一定代表意义的report/security/Machine learning等代写方向, 这个项目是assignment代写的代写题目 ``````University of Glasgow
Data Science &  Machine learning in Finance (ACCFIN5246)
assignment 1  Spring 2022
``````
``````Instruction
This is an individual assessment.
Submission to be made electronically via the course Moodle page. This includes a written
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{x 1 ,x 2 ,x 3 }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 assetrtrf,twhererf,tis the risk-free rate, to
the market real return denoted byrm,t:
rtrf,t

``````
``````= w+w( rM,trf,t

``````
``````) +ut (1)
``````
``````note that the object of interest is the time-varying feature of the coefficientswandw. In
particular,wsummarizes the conditional relationship, given a rolling window incorporating a
consecutive but limited span of data, between the market risk premiumrM,trf,tand 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 2011/01-2022/01,
on a daily basis further described as below:
``````
``````Data Science & Machine Learning in Finance (ACCFIN5246), Hormoz Ramian, 2022  Assignment 1
``````
``````Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec Jan Feb Mar ...

w=1
w=2
w=3
w=
``````
``````..
.
``````
``````..
..
..
``````
``````..
..
..
..
.
``````
``````..
.
``````
``````..
..
..
``````
``````..
..
..
..
.
``````
`````` 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 athttps://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 returnrtrf,tand real market excess returns rM,trf,t. Construct average returns over the indicated time span in the table below.(10%)

``````Average Nominal Returns Average Real Excess Returns
``````

### A rt rM,t rf,t rtrf,t rM,trf,t

``````2000/01-2014/
2015/01-2019/
2020/01-2021/
``````
``````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 regressionsR^2 w-statistic.
``````

(2.2) Construct three diagrams: (i) estimatedwper window over time, (ii) estimatedwper window over time, and regressionsR^2 wper window over time.(10%) (2.3) Construct the following two indicators:

``````I
``````

#### (

``````w
``````

#### {

``````0 if p-value(w)5%
1 if p-value(w)>5%
``````
``````I
``````

#### (

``````w
``````

#### {

``````0 if p-value(w)5%
1 if p-value(w)>5%
``````
``````DepictI
``````

#### (

``````w
``````

#### )

``````andI
``````

#### (

``````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 forwandwaggregated across all windows, and aggregated
values
``````
``````wI
``````

#### (

``````w
``````

#### )

``````and
``````
``````wI
``````

#### (

``````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

#### 2

``````Data Science & Machine Learning in Finance (ACCFIN5246), Hormoz Ramian, 2022  Assignment 1
``````
``````#Windows w w
Nw w=
``````

#### 1

``````Nw
``````
``````ww w=
``````

#### 1

``````Nw
``````
``````ww
``````
``````
wI
``````

#### (

``````w
``````

#### )

``````wI
``````

#### (

``````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 assetA denoted byqdi = 0 + 1 pi+uiwherepi= lnPi,Piis the actual price, andqdi = lnQdi with Qdidenoting the quantity of shares demanded by investors, and that eachi= 1,…,Nrepresents a quantity-price pair (qdi,pi). Note that the quantities demandedqdi characterise willingness to purchase, given all possible pricespi, which is not directly observable in financial market datasets. The termuirepresents other factors besides price that affect demand, such as investors wealth, personal valuation, etc. The markets existing outstanding supply of shares equation is in the same form, and is given byqsi = 0 + 1 pi+viwhere the termvirepresents the factors that affect supply, such as underlying companys performance, sales, access to financing, union status, etc. Assume first, that the two error terms are uncorrelated, and second that the equilibrium conditionqid=qsi=qiholds indicating that observed quantities collect both demand and supply sides characteristics, then: (3.1) Derive the the reduce form system in terms ofpiandqi. This indicates settingqdi=qsi=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) forpiandqi, 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 ofqionpiis biased for both structural parameters 1 and 1 .(15%)