msf afts kp 2014 lectures 2 stud
TRANSCRIPT
-
8/10/2019 MSF AFTS KP 2014 Lectures 2 Stud
1/52
Krzysztof Piontek
Department of Financial Investments and Risk Management
1
Analysis of Financial Time Series
statistics - revision
-
8/10/2019 MSF AFTS KP 2014 Lectures 2 Stud
2/52
Krzysztof Piontek
Department of Financial Investments and Risk Management
2
Course Requirements
The basic knowledge of:
financial markets,
financial instruments,
risk management,portfolio management,
mathematics,
statistics,
probability calculus,
econometrics.
-
8/10/2019 MSF AFTS KP 2014 Lectures 2 Stud
3/52
Krzysztof Piontek
Department of Financial Investments and Risk Management
3
Two main tasks in financial data modeling:
- Modeling dynamics (econometrics)
- Modeling statistical distributions (statistics)
the order of the observations over the time
-
8/10/2019 MSF AFTS KP 2014 Lectures 2 Stud
4/52
Krzysztof Piontek
Department of Financial Investments and Risk Management
4
Analysis of financial time seriesis main part of the
discipline called financial econometrics
Two main objectives of financial econometrics:
1) Verification of different models developed in theory of finance
(financial economics) by using financial time series models
2) Analysis of financial data to identify main characteristics
(for example risk characteristics)
-
8/10/2019 MSF AFTS KP 2014 Lectures 2 Stud
5/52
Krzysztof Piontek
Department of Financial Investments and Risk Management
5
Time series:
A sequence of random variables measuring certain quantity of
interest over time
Financial Time Series:
collection of a financial measurement over time.
Example: log return r
t
Data: {r
1
, r
2
, ..., r
T
} (t data pints)
Futures prices or returns are random variables since we do not
know their values until we observe theirs.
A random variable can be thought of as an unknown value that may
change every time it is inspected.
-
8/10/2019 MSF AFTS KP 2014 Lectures 2 Stud
6/52
Krzysztof Piontek
Department of Financial Investments and Risk Management
6
Name, Date, Open, High, Low, Close, Volume
KGHM, 20090904, 83.45, 85.70, 83.00, 83.00, 661561
KGHM, 20090907, 84.50, 85.95, 84.40, 85.95, 389379
KGHM, 20090908, 87.00, 89.60, 87.00, 88.90, 1251472
KGHM, 20090909, 87.70, 89.30, 87.70, 88.90, 701582
KGHM, 20090910, 89.90, 90.40, 86.15, 88.00, 970480
KGHM, 20090911, 88.00, 88.00, 85.00, 85.20, 865165KGHM, 20090914, 84.00, 84.65, 82.50, 83.60, 401915
KGHM, 20090915, 84.60, 85.40, 82.90, 84.00, 495518
KGHM, 20090916, 85.00, 86.95, 84.95, 86.95, 722730
KGHM, 20090917, 88.30, 88.85, 86.10, 87.00, 454126
KGHM, 20090918, 86.00, 86.90, 84.20, 84.60, 1359126
KGHM, 20090921, 85.10, 85.80, 84.00, 84.00, 448032KGHM, 20090922, 85.50, 90.50, 85.50, 90.50, 2367387
KGHM, 20090923, 90.50, 92.40, 89.40, 91.00, 1273626
KGHM, 20090924, 89.50, 92.25, 88.00, 88.00, 950405
KGHM, 20090925, 88.00, 88.45, 85.20, 86.50, 1388713
-
8/10/2019 MSF AFTS KP 2014 Lectures 2 Stud
7/52
-
8/10/2019 MSF AFTS KP 2014 Lectures 2 Stud
8/52
Krzysztof Piontek
Department of Financial Investments and Risk Management
8
Main index of Warsaw Stock Exchange - WIG
A graph of daily levels
-
8/10/2019 MSF AFTS KP 2014 Lectures 2 Stud
9/52
Krzysztof Piontek
Department of Financial Investments and Risk Management
9
Characteristics of financial time series
usually we think about
returns
-
8/10/2019 MSF AFTS KP 2014 Lectures 2 Stud
10/52
Krzysztof Piontek
Department of Financial Investments and Risk Management
10
Rates of return
(clusteringof variance)
Quantile-quantile plot
(normal quantiles)
Autocorrelation of squared returns
(lags)
Autocorrelation of returns
(lags)
-
8/10/2019 MSF AFTS KP 2014 Lectures 2 Stud
11/52
Krzysztof Piontek
Department of Financial Investments and Risk Management
11
1 0,2264b
Skewness: 30.10.9519.08.04
2200 observations
Histogram of COMPUTERLAND rates of return vs. normal density
Compute the intervals x + s, x + 2s, x + 3s and compare the percentage of
data in these intervals to the Empirical Rule (68%, 95%, 99.7%)
-
8/10/2019 MSF AFTS KP 2014 Lectures 2 Stud
12/52
Krzysztof Piontek
Department of Financial Investments and Risk Management
12
Statistics
short revision
Descriptive Statistics
Provides numerical and
graphic procedures to
summarize theinformation of the data in
a clear and
understandable way
Inferential Statistics Provides
procedures to
draw inferences
about a populationfrom a sample
-
8/10/2019 MSF AFTS KP 2014 Lectures 2 Stud
13/52
Krzysztof Piontek
Department of Financial Investments and Risk Management
13
Numerical Data Properties
Central Tendency
(Location)
Variation
(Dispersion)
Shape
-
8/10/2019 MSF AFTS KP 2014 Lectures 2 Stud
14/52
-
8/10/2019 MSF AFTS KP 2014 Lectures 2 Stud
15/52
Krzysztof Piontek
Department of Financial Investments and Risk Management
15
Bell-shaped
Bimodal
(Multimodal)
Uniform
(Unimodal)
Right-skewed Left-skewed
Truncated
a histogramis a graphical display of
tabulated frequencies, shown as bars.
-
8/10/2019 MSF AFTS KP 2014 Lectures 2 Stud
16/52
Krzysztof Piontek
Department of Financial Investments and Risk Management
16
Percentiles and Quartiles
The pth percentile is the value of a givendistribution such that p% of the
distribution is less than or equal to that
value.
-
8/10/2019 MSF AFTS KP 2014 Lectures 2 Stud
17/52
Krzysztof Piontek
Department of Financial Investments and Risk Management
17
Quantile
Some quantiles have special names:
The 2-quantile is called the median
The 4-quantiles are called quartilesThe 10-quantiles are called deciles
The 100-quantiles are called percentiles
Quantiles provide information about the shape of data as well as its
location and spread.
-
8/10/2019 MSF AFTS KP 2014 Lectures 2 Stud
18/52
Krzysztof Piontek
Department of Financial Investments and Risk Management
18
0.00
0.10
0.20
0.30
0.40
0.50
0.60
-5 -4 -3 -2 -1 0 1 2 3 4 5
10th
percentile=-1.2816
10 percent under curve
(shaded red)
-
8/10/2019 MSF AFTS KP 2014 Lectures 2 Stud
19/52
Krzysztof Piontek
Department of Financial Investments and Risk Management
19
a Q-Q plot( Q stands for quantile) is a probability plot, a kind
of graphical method for comparing two probability
distributions, by plotting their quantiles against each other.
If the data sets agree or the observed set matches the
theoretical, the plot will be on a straight line.
If the plot is not on a straight line, then the model is a poor fit.
Quantile-quantile plots are used to determine whether two samples come from the same
distribution family. They are scatter plots of quantiles computed from each sample, with a
line drawn between the first and third quartiles. If the data falls near the line, it is
reasonable to assume that the two samples come from the same distribution. The method
is robust with respect to changes in the location and scale of either distribution.
-
8/10/2019 MSF AFTS KP 2014 Lectures 2 Stud
20/52
Krzysztof Piontek
Department of Financial Investments and Risk Management
20
Normal quantile plot
-2 -1 0 1 2
-2
-1
0
1
2
Normal q-q plot
Theoretical Quantiles
SampleQuantiles
q-q plot 100 sample
observations from a normaldistribution with mean 0 andstandard deviation 1
-
8/10/2019 MSF AFTS KP 2014 Lectures 2 Stud
21/52
Krzysztof Piontek
Department of Financial Investments and Risk Management
21
Normal quantile plot
-2 -1 0 1 2
40
45
50
55
Normal q-q plot of Height of our Sample Data
Theoretical Quantiles
SampleQuantiles
-
8/10/2019 MSF AFTS KP 2014 Lectures 2 Stud
22/52
Krzysztof Piontek
Department of Financial Investments and Risk Management
22
Descriptive statistics
Types of Descriptive Statistics. 1. Measures of Central Tendency
2. Measures of Dispersion of Variability 3. Measures of distribution Shape.
4. Quantiles
-
8/10/2019 MSF AFTS KP 2014 Lectures 2 Stud
23/52
Krzysztof Piontek
Department of Financial Investments and Risk Management
23
Measures of Central Tendency
Mean:
Sum of all measurements in the data divided by
the number of measurements.
the AVERAGE (or the EXPECTED VALUE)
Median (2nd quartile):
A number such that at most half of the
measurements are below it and at most half of themeasurements are above it.
Mode:
The most frequent measurement in the data.
-
8/10/2019 MSF AFTS KP 2014 Lectures 2 Stud
24/52
Krzysztof Piontek
Department of Financial Investments and Risk Management
A car went a certain distance at a speed 60 kilometers perhour) and then the same distance again at a speed 40
kilometers per hour.
What was the car's average speed during the whole journey?
-
8/10/2019 MSF AFTS KP 2014 Lectures 2 Stud
25/52
Krzysztof Piontek
Department of Financial Investments and Risk Management
A car went a certain distance at a speed 60 kilometers per
hour) and then the same distance again at a speed 40
kilometers per hour.
What was the car's average speed during the whole journey?
average speed
-
8/10/2019 MSF AFTS KP 2014 Lectures 2 Stud
26/52
Krzysztof Piontek
Department of Financial Investments and Risk Management
A car travels for a certain amount of timeat a speed 60
km/hand then the same amount of time at a speed
40 km/h
-
8/10/2019 MSF AFTS KP 2014 Lectures 2 Stud
27/52
Krzysztof Piontek
Department of Financial Investments and Risk Management
A car travels for a certain amount of timeat a speed 60
km/hand then the same amount of time at a speed
40 km/h
average speed..
-
8/10/2019 MSF AFTS KP 2014 Lectures 2 Stud
28/52
Krzysztof Piontek
-
8/10/2019 MSF AFTS KP 2014 Lectures 2 Stud
29/52
Department of Financial Investments and Risk Management
29
Measures of dispersion or variability
Measures how spread out around the center are
the data.
The simplest measure of variability is the RANGE.
This is simply the maximum value minus the
minimum value.
INTER-QUARTILE RANGE (IQR) which is defined as
the value at 75% minus the value at 25% of the
distribution. Thus the central 50 % of the
observations fall between these two values.
Krzysztof Piontek
-
8/10/2019 MSF AFTS KP 2014 Lectures 2 Stud
30/52
Department of Financial Investments and Risk Management
30
Measures of dispersion or variability.
The most common measures of variability
are the STANDARD DEVIATIONand the
VARIANCE. The variance is the standard
deviation squared, or the standarddeviation is the square root of the variance.
2 2
1
1
( ) ( )1
N
iiS x x xN
2( ) ( )S x S x
Krzysztof Piontek
-
8/10/2019 MSF AFTS KP 2014 Lectures 2 Stud
31/52
Department of Financial Investments and Risk Management
31
Measures of Shape
The two most common measures of shape are
SKEWNESS and KURTOSIS.
Skewness is a measure of the lack of symmetry in a
distribution, or whether the distribution is skewed
to the left or the right.
Positive skewness: Values clustered toward lower
range with a long tail extending to upper ranges.
Negative skewness: Values clustered toward
upper range with long tail extending to lower
ranges.
Krzysztof Piontek
-
8/10/2019 MSF AFTS KP 2014 Lectures 2 Stud
32/52
Department of Financial Investments and Risk Management
32
Shape
Right-SkewedLeft-Skewed Symmetric
Mean = MedianMean Median Median Mean
Krzysztof Piontek
-
8/10/2019 MSF AFTS KP 2014 Lectures 2 Stud
33/52
Department of Financial Investments and Risk Management
33
Skewness
Measures of asymmetry of data
Positive or right skewed: Longer right tail
Negative or left skewed: Longer left tail
2/3
1
2
1
3
21
)(
)(
Skewness
Then,ns.observatiobe,...,Let
n
i
i
n
i
i
n
xx
xxn
nxxx
Krzysztof Piontek
-
8/10/2019 MSF AFTS KP 2014 Lectures 2 Stud
34/52
Department of Financial Investments and Risk Management
34
1 2
4
1
2
2
1
Let , ,... be observations. Then,
( )
Kurtosis
(
3
)
n
n
i
i
n
i
i
x x x n
n x x
x x
Kurtosismeasures the thickness of the tails.Higher values of kurtosis indicate more extreme
values or heavier tails. Negative kurtosis is thinnertails. Heavier or thinner than the normal curve.
Why subtract 3? Because a normal curve has a kurtosis of 3: if wesubtract three then it is zero and thus kurtosis is expressed subject tocomparisons with the normal curve.
excess
kurtosis
Krzysztof Piontek
-
8/10/2019 MSF AFTS KP 2014 Lectures 2 Stud
35/52
Department of Financial Investments and Risk Management
35
leptokurtic
platykurtic
mesokurtic
Kurtosis > 3
excesskurtosis >0fat tails (typical feature)
Kurtosis = 3excesskurtosis = 0
Kurtosis < 3
excesskurtosis < 0
Krzysztof Piontek
-
8/10/2019 MSF AFTS KP 2014 Lectures 2 Stud
36/52
Department of Financial Investments and Risk Management
36
Expected value
risk
(measured as volatility)
Krzysztof Piontek
-
8/10/2019 MSF AFTS KP 2014 Lectures 2 Stud
37/52
Department of Financial Investments and Risk Management
37
Normal Distribution
2
2
1( )
21
( ) ,2
x
f x e x
A density curvedescribes the overall pattern of a distribution.The total area under the curve is always 1.
The normaldistribution is symmetric, single-peaked and bell-shaped.
Mean, Median, and mode are same for a normal distribution
A normal distribution can be described if we know their mean andstandard deviation.(If we know and , we know every thing about thenormal distribution.)
The probability density function of a normal variable with mean and
standard deviation can be expressed as,
Krzysztof Piontek
-
8/10/2019 MSF AFTS KP 2014 Lectures 2 Stud
38/52
Department of Financial Investments and Risk Management
38
Normal Distribution
.
x
z
2
21
( ) ,2
z
f z e z
Standardizing and z-Scores
If x is an observation from a distribution that has mean and
standard deviation , the standardized valueof x is
A standardized value is often called a z-score. If x is normal distribution
with mean and standard deviation , then z is a standard normal
variable with mean 0 and standard deviation 1.
Krzysztof Piontek
-
8/10/2019 MSF AFTS KP 2014 Lectures 2 Stud
39/52
Department of Financial Investments and Risk Management
39
Normal Distribution
Approximately 68% of the
measurements lie in the
interval to +
Approximately 95% of the
measurements lie in the
interval 2to + 2
Approximately 99.7% of the
measurements lie in the
interval 3to + 3
Krzysztof Piontek
-
8/10/2019 MSF AFTS KP 2014 Lectures 2 Stud
40/52
Department of Financial Investments and Risk Management
40
Raw (crude) moment (moment about zero)
1
1x
N
k
k i
i
mN
k
km E X
For a sample of N observations the sample moment is
Moments: values (statistics, quantities) used to
characterize the probability distributions of
random variables.
Krzysztof Piontek
-
8/10/2019 MSF AFTS KP 2014 Lectures 2 Stud
41/52
Department of Financial Investments and Risk Management
41
Central moment (moment about its mean)
11
1 x
N
kk i
i
mN
k
k E X E X
Sample moment
Krzysztof Piontek
-
8/10/2019 MSF AFTS KP 2014 Lectures 2 Stud
42/52
Department of Financial Investments and Risk Management
42
1
2
2
31 3 2
2
42 2
2
m
mean
variance
skewness
kurtosis
Raw (crude) moment (moment about zero)
Central moment (moment about its mean)
Krzysztof Piontek
-
8/10/2019 MSF AFTS KP 2014 Lectures 2 Stud
43/52
Department of Financial Investments and Risk Management
43
Outliers
Outliers are cases that have data values very
different from the data values for the majority of
cases in the data set.
Outliers are important because they can change the
results of our data analysis.
Whether we include or exclude outliers from a data
analysis depends on the reason why the case is an
outlier and the purpose of the analysis.
Krzysztof Piontek
-
8/10/2019 MSF AFTS KP 2014 Lectures 2 Stud
44/52
Department of Financial Investments and Risk Management
44
The higher moment (raw or central) the more
senitive to outliers.
outlier
1
observation
1000 observations
skewness not zero but e.g. 0.4
kurtosis not 3 but e.g. 4.5
Krzysztof Piontek
-
8/10/2019 MSF AFTS KP 2014 Lectures 2 Stud
45/52
Department of Financial Investments and Risk Management
45
Expected value
risk
(measured as volatility)
Krzysztof Piontek
-
8/10/2019 MSF AFTS KP 2014 Lectures 2 Stud
46/52
Department of Financial Investments and Risk Management
46
The simplest model
The world is a big gaming machine (lottery).
Each day the rate of return is drown from the same
distribution which is constant over time.
(all moments of the daily return distributions areconstant over time)
Krzysztof Piontek
-
8/10/2019 MSF AFTS KP 2014 Lectures 2 Stud
47/52
Department of Financial Investments and Risk Management
47
Discrete time model (simple rates of return)
tt
t
tt
t z
P
PPr
1
1
),N(~ 2tr
)1,0N(~t
z
The return is decomposed into two parts as
rt= predictable part + not predic. part
Krzysztof Piontek
-
8/10/2019 MSF AFTS KP 2014 Lectures 2 Stud
48/52
Department of Financial Investments and Risk Management
48
VALUE AT RISK
Rq
np. 5 %,
1 %
R
(R)
Krzysztof Piontek
-
8/10/2019 MSF AFTS KP 2014 Lectures 2 Stud
49/52
Department of Financial Investments and Risk Management
49
VALUE AT RISK
an approach to VaR estimation under the assumption
of NORMAL return distribution:
mean of the distribution of returns,
standard deviation of returns
constant dependent on the tolerance level,
e.g.:
if q = 0.05, then c = -1.65
if q = 0.01, then c = -2.33
, - constant in time
cRq
Krzysztof Piontek
-
8/10/2019 MSF AFTS KP 2014 Lectures 2 Stud
50/52
Department of Financial Investments and Risk Management
50
0 t
Krzysztof Piontek
-
8/10/2019 MSF AFTS KP 2014 Lectures 2 Stud
51/52
Department of Financial Investments and Risk Management
51
The Black-Scholes model of the market for an equity
makes the following explicit assumptions:
It is possible to borrow and lend cash at a known
constant risk-free interest rate.
The price follows a geometric Brownian motion with
constant drift and volatility.
There are no transaction costs.
The stock does not pay a dividend (see below for
extensions to handle dividend payments).
All securities are perfectly divisible (i.e.it is possibleto buy any fraction of a share).
There are no restrictions on short selling.
Krzysztof Piontek
-
8/10/2019 MSF AFTS KP 2014 Lectures 2 Stud
52/52
Department of Financial Investments and Risk Management
1 2
( ) ( )r T
c S d X e N d N2
1
2
ln r
dX
TS
T
2
2
2
ln S
r TX
d
T
N(x) denotes the standard normal cumulative distribution function
the Black-Scholes formula