ECOS3020 Special Topic in Economics
Special Topic in Economics
Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: THEend8_
ECOS3020
Special Topic in Economics
Lecture 1. Understanding financial data
• Understanding financial data
• Basic statistical and mathematical concepts
• Textbook: Chapter 1 and 2 in Brooks, C., 2019, Introductory
econometrics for finance, Cambridge university press, 4th edition
Examples of the kind of problems that may be solved
1. Testing whether financial markets are weak-form informationally
efficient.
2. Testing whether the CAPM or APT represent superior models for the
determination of returns on risky assets.
3. Measuring and forecasting the volatility of bond returns.
4. Explaining the determinants of bond credit ratings used by the ratings
agencies.
5. Modelling long-term relationships between prices and exchange rates.
6. Determining the optimal hedge ratio for a spot position in oil.
7. Testing technical trading rules to determine which makes the most
money.
8. Testing the hypothesis that earnings or dividend announcements have
no effect on stock prices.
9. Testing whether spot or futures markets react more rapidly to news.
10. Forecasting the correlation between the returns to the stock indices of
two countries.
Examples of the kind of problems that may be solved
What are the Special Characteristics of Financial Data?
• Frequency & quantity of data
‐ Stock market prices are measured every time there is a trade or
somebody posts a new quote
• Quality
‐ Recorded asset prices are usually those at which the transaction took
place
‐ No possibility for measurement error but financial data are “noisy”.
Steps involved in the formulation of economic models
Basic statistical and mathematical concepts:
Functions
• A function is a mapping or relationship between an input (or set of inputs)
and an output
• We write that y (the output) is a function f of x (the input). y = f (x)
• y could be a linear function of x where the relationship can be expressed
on a straight line
• Or it could be non-linear where it would be expressed graphically as a
curve
• If the equation is linear, we would write the relationship as
y = a + bx
where y and x are called variables. a and b are parameters
• a = the intercept and b = the slope or gradient
Straight Lines
• The intercept is the point at which the line crosses the y-axis
• Example: suppose that we were modelling the relationship between a
student’s average mark, y (in percent), and the number of hours studied
per year, x
• Suppose that the relationship can be written as a linear function
y = 25 + 0.05x
Plot of Hours Studied Against Mark Obtained
Straight Lines
• In the graph above, the slope is positive
• i.e. the line slopes upwards from left to right
• But in other examples the gradient could be zero or negative
• For a straight line, the slope is constant – i.e. the same along the whole
line
• In general, we can calculate the slope of a straight line by taking any two
points on the line and dividing the change in y by the change in x
• (Delta) denotes the change in a variable
• For example, take two points x=100, y=30 and x=1000, y=75
• We can write these using coordinate notation (x,y) as (100,30) and
(1000,75)
• We would calculate the slope as
Roots
• The root is the point at which a line crosses the x-axis
• A straight line will have one root (except for a horizontal line such as y=4
which has no roots)
• To find the root of an equation set y to zero and rearrange
0 = 25 + 0.05x
• So, the root is x = −500
• In this case it does not have a sensible interpretation: the number of hours
of study required to obtain a mark of zero!
Quadratic Functions
• A linear function is often not sufficiently flexible to accurately describe
the relationship between two series
• We could use a quadratic function instead:
y = a + bx + cx2
where a, b, c are the parameters that describe the shape of the function
• Quadratics have an additional parameter compared with linear functions
• The linear function is a special case of a quadratic where c=0
• a still represents the intercept where the function crosses the y-axis
• As x becomes very large, the x2 term will come to dominate
• If c is positive, the function will be -shaped, while if c is negative it will
be -shaped.
The Roots of Quadratic Functions
• The roots may be
‐ distinct (i.e., different from one another) or the same (repeated roots);
‐ real numbers (e.g., 1.7, -2.357, 4, etc.) or complex numbers
• The roots can be obtained either by factorising the equation (contracting it
into parentheses), by ‘completing the square’, or by using the formula:
The Roots of Quadratic Functions (Cont’d)
• If b2 > 4ac, the function will have two unique roots and it will cross the x-
axis in two separate places
• If b2 = 4ac, the function will have two equal roots and it will only cross
the x-axis in one place
• If b2 < 4ac, the function will have no real roots (only complex roots), it
will not cross the x-axis at all and thus the function will always be above
the x-axis
Calculating the Roots of Quadratics - Examples
Determine the roots of the following quadratic equations:
1. y = x2 + x − 6
2. y = 9x2 + 6x + 1
3. y = x2 − 3x + 1
4. y = x2 − 4x
Calculating the Roots of Quadratics - Solutions
• We solve these equations by setting them in turn to zero
• We could use the quadratic formula in each case, although it is usually
quicker to determine first whether they factorise
1. x2 + x − 6 = 0 factorises to (x − 2)(x + 3) = 0 and thus the roots are 2 and
−3, which are the values of x that set the function to zero. In other words,
the function will cross the x-axis at x = 2 and x = −3
2.9x2 + 6x + 1 = 0 factorises to (3x + 1)(3x + 1) = 0 and thus the roots are
−1/3 and −1/3. This is known as repeated roots – since this is a quadratic
equation there will always be two roots but in this case they are both the
same.
Calculating the Roots of Quadratics – Solutions (Cont’d)
3. x2 − 3x + 1 = 0 does not factorise and so the formula must be used
with a = 1, b = −3, c = 1 and the roots are 0.38 and 2.62 to two decimal
places
4. x2 − 4x = 0 factorises to x(x − 4) = 0 and so the roots are 0 and 4.
• All of these equations have two real roots
• But if we had an equation such as y = 3x2 − 2x + 4, this would not
factorise and would have complex roots since b2 − 4ac < 0 in the
quadratic formula.
Powers of Number or of Variables
• A number or variable raised to a power (or index) is simply a way of
writing repeated multiplication
• For example, raising x to the power 2 means squaring it (i.e., x2 = x × x)
• Raising x to the power 3 means cubing it (x3 = x × x × x), and so on
Manipulating Powers and their Indices
• Any number or variable raised to the power one is simply that number or
variable
• Any number or variable raised to the power zero is one
‐ except that 00 is not defined (i.e., it does not exist)
• If the index is a negative number, this means that we divide one by that
number
• If we want to multiply together a given number raised to more than one
power, we would add the corresponding indices together
• If we want to calculate the power of a variable raised to a power (i.e., the
power of a power), we would multiply the indices together
Manipulating Powers and their Indices (cont’d)
• If we want to divide a variable raised to a power by the same variable
raised to another power, we subtract the second index from the first
• If we want to divide a variable raised to a power by a different variable
raised to the same power, (x / y)n = xn / yn
• The power of a product is equal to each component raised to that power
• The indices for powers do not have to be integers
• Other, non-integer powers are also possible, but are harder to calculate by
hand (e.g. x0:76, x−0:27, etc.)
• In general, x1/n = n√x
The Exponential Function, e
• When a variable grows (or reduces) at a rate in proportion to its current
value, we would write y = ex
• e is a simply number: 2.71828. . .
• It is also useful for capturing the increase in value of an amount of money
that is subject to compound interest
• The exponential function can never be negative
- when x is negative, y is close to zero but positive
• It crosses the y-axis at one and the slope increases at an increasing rate
from left to right
A Plot of the Exponential Function
Logarithms
• Logarithms is the inverse function to exponentiation
• Why do we use a log transformation?
1. Taking a logarithm can often help to rescale the data so that their
variance is more constant, which overcomes a common statistical
problem known as heteroscedasticity
2. Logarithmic transforms can help to make a positively skewed
distribution closer to a normal distribution
How do Logs Work?
• Consider the power relationship 23 = 8
• Using logarithms, we would write this as log28 = 3, or ‘the log to the base
2 of 8 is 3’
• More generally, if ab = c, logac = b
How do Logs Work? (cont’d)
• Natural logarithms, also known as logs to base e, are more commonly
used and more useful mathematically than logs to any other base
• denoted interchangeably by ln(y) or log(y)
• The log of a number less than one will be negative, e.g. ln(0.5) ≈ −0.69
• We cannot take the log of a negative number
• for example, ln(−0.6) does not exist
• If we plot a log function, y = ln(x), it would cross the x-axis at one – see
the following slide
• As x increases, y increases at a slower rate, which is the opposite to an
exponential function where y increases at a faster rate as x increases
A Graph of a Log Function
The Laws of Logs
For variables x and y:
• ln (x y) = ln (x) + ln (y)
• ln (x/y) = ln (x) − ln (y)
• ln (yc) = c ln (y)
• ln (1) = 0
• ln (1/y) = ln (1) − ln (y) = −ln (y)
• ln(ex) = x
Sigma Notation
• Σ means ‘add up all of the following elements’
• Σ(1 + 2 + 3) = 6
•
where the i subscript is an index, 1 is the lower limit and 4 is the upper limit
of the sum. This would mean adding all of the values of x from x1 to x4
Properties of the Sigma Operator
Pi Notation
• Similar to the use of sigma to denote sums, the pi operator (Π) is used to
denote repeated multiplications.
• For example,
means ‘multiply together all of the xi for each value of i between the lower
and upper limits’
• It also follows that
Differential Calculus
• The effect of the rate of change of one variable on the rate of change of
another is measured by a mathematical derivative
• The gradient of a curve show the relationship between the two variables
• y = f (x): the derivative of y with respect to x is written
or sometimes f ′(x)
• This term measures the instantaneous rate of change of y with respect to x
Differentiation: The Basics
1. The derivative of a constant is zero – e.g. if y = 10, dy/dx = 0
This is because y = 10 would be a horizontal straight line on a graph of y
against x, and therefore the gradient of this function is zero
2. The derivative of a linear function is simply its slope
e.g. if y = 3x + 2, dy/dx = 3
3. But non-linear functions will have different gradients at each point along
the curve
• The gradient will be zero at the point where the curve changes direction
from positive to negative or from negative to positive – this is known as a
turning point
The Derivative of a Power Function or of a Sum
• The derivative of a power function n of x:
➢ if y = cxn , dy/dx = cnxn−1
• The derivative of a sum is equal to the sum of the derivatives of the
individual parts:
➢ if y = f (x) + g (x) , dy/dx = f ′(x) + g′(x)
• The derivative of a difference is equal to the difference of the
derivatives of the individual parts:
➢ if y = f (x) − g (x) , dy/dx = f ′(x) − g′(x)
The Derivatives of Logs and Exponentials
• The derivative of the log of x is given by 1/x
➢ i.e. d(log(x))/dx = 1/x
• The derivative of the log of a function of x is the derivative of the
function divided by the function
➢ i.e. d(log(f (x)))/dx = f ′(x)/f (x)
• The derivative of ex is ex
• The derivative of e f (x) is given by f ′(x)e f (x)
Higher Order Derivatives
• It is possible to differentiate a function more than once to calculate the
second order, third order, . . ., nth order derivatives
• The notation for the second order derivative, which is usually just
termed the second derivative, is
• To calculate second order derivatives, differentiate the function with
respect to x and then differentiate it again
• For example, suppose that we have the function y = 4x5 + 3x3 + 2x + 6,
the first order derivative is
Higher Order Derivatives (Cont’d)
• The second order derivative is
• The second order derivative can be interpreted as the gradient of the
gradient of a function – i.e., the rate of change of the gradient
• How can we tell whether a particular turning point is a maximum or a
minimum?
• The answer is that we would look at the second derivative
• When a function reaches a maximum, its second derivative is negative,
while it is positive for a minimum.