Free Essay

Dgwre

In:

Submitted By sachinrullllz
Words 1400
Pages 6
Computational
Finance
 Fall
2012
 Daniel
Egger
 
 Handout
No.
2
 Basic
Statistics


! !


 2.1
Topics
Covered
 
 2.2
Mean
and
Median
of
a
Data
Set
 2.3
Variance
and
Standard
Deviation
of
a
Data
Set
 2.4
Covariance
and
Correlation
of
two
Data
Sets

 2.5
Standard
Units
(Z‐Scores)
and
their
use
for
Calculating
Correlation

 2.6
Slope
(Beta)
and
Y‐Intercept
(Alpha)
of
the
regression
line
of
one
stocks’s
annual
 returns
against
annual
market
return
 2.7
Calculating
the
Expected
Return,
and
Volatility,
of
a
Combination
of
Assets
 2.8
Graphing
the
Efficient
Frontier
for
Risk‐Averse,
Profit‐Maximizing
Investors
 
 2.2
Mean
and
Median
of
a
Data
Set
 
 The
Mean
is
the
average
of
a
set
of
n
known
values
X
=
 {x1 , x2 ,..., xn } .

 A
sample
mean
can
be
written:

 
 1 n x 
=

 " xi 
 ! n i=1 
 (Note
that
if
a
“sample
mean”
and
a
“population
mean”
need
to
be
distinguished,
 x 
 is
conventionally
used
for
the
sample
mean,
and
 µ 
for
the
population
mean.
This
 distinction
will
not
concern
us
in
Introductory
Computational
Finance).
 
 ! The
mean
may
be
calculated
using
the
Excel
function
AVERAGE.
 ! 
 The
Median
is
the
number
in
the
middle
of
an
ordered
set
of
values;
half
of
all
values
 are
greater,
and
half
less.
When
the
total
number
of
values
is
even,
the
median
is
the
 average

of
the
two
numbers
in
the
middle.
 
 The
median
may
be
calculated
using
the
Excel
function
MEDIAN.
 
 
 


1


!

2.3
Variance
and
Standard
Deviation
of
a
Data
Set
 
 2 The
population
Variance
of
a
data
set,
 " 
(lower
case
Greek
“sigma”
squared)

 
 1 n " 2 
=
 # (xi " x)2 
 n i=1 ! 
 Can
be
read
as
“the
average
of
the
squared
differences
from
the
mean
of
the
data
 set.”
Population
Variance
may
be
calculated
using
the
Excel
function
VARP.

 ! 
 Population
Standard
Deviation
of
a
data
set,
 " 
(lower
case
Greek
“sigma”)
 

1 n "= $ (xi # x)2 
 ! n i=1 
 Standard
deviation
is
the
square
root
of
the
Variance.

 Note
that
 " is
always
 " 
0.
Population
Standard
Deviation
may
be
calculated
using
 the
Excel
STDEVP
function.

 
 2.4
Covariance
and
Correlation
of
two
Data
Sets

 ! ! 
 Covariance,
Cov
 
 A
property
of
two
ordered
sets
with
the
same
number
of
elements
n.

 
 Given
two
sets
X,Y
where
X
=
{ x1 , x2 ,...xn }
and
Y
=
{ y1 , y2 ,...yn }
 1 n the
“Covariance”

of
X
and
Y,
written
Cov(X,Y)
= # (xi " x )(yi " y) .
 n i=1 
 ! ! Note
that
Covariance
is
symmetric.

Cov(X,Y)
=
Cov(Y,X).

 
 ! When
two
sets
of
values
tend
to
go
up
together
or
down
together,
the
covariance
 will
be
positive.
Two
large
unrelated
sets
with
normal
distribution
around
their
 means
should
have
a
covariance
near
0.


 
 Covariance
may
be
calculated
using
the
Excel
COVAR
function.

 
 Correlation
Coefficient,
 R 
 
 The
correlation
coefficient
 RXY 
of
two
ordered
sets
X
and
Y,
more
commonly
 referred
to
as
the
“Correlation
between
X
and
Y.”

 ! 
 !

!

2


!

Correlation
equals
the
Covariance
of
X
and
Y,
Cov(X,Y),
divided
by
the
product
of
the
 Standard
Deviation
of
X,
 " X ,
and
the
Standard
Deviation
of
Y,
 " Y .

 
 Cov(X,Y ) 
 RXY =
 " X" Y ! ! 
 Correlation
is
always
a
value
between
‐1
and
1.

The
absolute
value
of
the
 correlation
is
a
measure
of
how
closely
related
the
two
sets
are.
 ! 
 Because
Covariance
is
symmetric,
Correlation
is
symmetric:
 RXY 
=
 RYX .

 
 Correlation
may
be
calculated
using
the
Excel
CORREL
function.

 
 ! ! 2.5
Standard
Units
(Z‐Scores)
and
their
use
for
Calculating
Correlation
 
 Values
 xi 
 " 
X
will
be
in
units
such
as
miles
per
hour,
yards,
pounds,
dollars,
etc.
It
is
 often
convenient
to
standardize
units
by
converting
each
value xi 
into
“Standard
 Units.”
Standard
Units
are
expressed
in
“Standard
Deviations
from
the
mean
of
X.”
 
 ! ! A
data
point
represented
in
Standard
Units
is
also
known
as
a
Z‐Score.
To
convert
a
 ! data
point
into
its
corresponding
Z‐score,
subtract
the
mean
of
the
data
set
from
the
 individual
value,
then
divide
by
the
standard
deviation
of
the
data
set.


 
 x "x In
other
words,
the
Z‐score
of

 xi 
=
 i 
 #x 
 Note
that
individual
values
larger
than
the
mean
will
be
positive,
and
values
less
 ! than
the
mean
negative.

The
mean
has
a
Z‐score
of
0.

 ! 
 Note
also
that
when
a
set
of
values
X
=
{ x1 , x2 ,...xn }
is
expressed
in
Standard
Units
as
 Z‐scores,
so
long
as
the
mean
 x 
and
standard
deviation
 " X 
are
known,
all
 information
about
the
original
values
is
preserved,
and
can
be
recovered
at
any
 time.

 ! 
 ! ! A
data
set
can
be
converted
into
Standard
Units
by
using
the
Excel
function
 Standardize.

 
 
 


3


!

!

!

Calculating
Correlation
from
Z‐scores
 
 First
convert
X
and
Y
into
“Standard
Units.”
Second,
calculate
the
mean
of
the
 product
of
all
ordered
pairs
of
Z‐scores
 (xi , yi ) 
.
The
result
equals
the
Correlation
R
 between
X
and
Y.

 
 1 n ! RXY 
=
 " xi yi 
 n i=1 
 Galton
Method
for
Graphing
Correlation
 
 ! Convert
each
ordered
pair
(x,
y)
into
Standard
Units.

Identify
the
best‐fit
regression
 line
on
the
scatter
plot
of
pairs
of
Z‐scores
 (xi , yi ) 
using
ordinary
least
squares
 (OLS).
The
resulting
line
will
have
slope
=
R.

 
 To
calculate
the
best
fit
line
OLS
in
Excel,
use
the
function
LINEST.

 ! 
 2.6
Slope
(Beta)
and
Y‐Intercept
(Alpha)
of
the
regression
line
of
one
stock’s
 annual
returns
against
annual
market
return
 
 Beta,
 " 
 
 Volatility
of
one
stock
often
measured
relative
to
the
volatility
of
an
index
or
 benchmark.


Comparing
the
volatility
of
an
individual
stock
X
to
the
volatility
of
the
 ! market
Y
of
which
it
is
part
is
done
by
calculating
a
value
known
as
“Beta.”

Beta
is
 the
Covariance
of
the
asset
X
and
the
market
Y,
divided
by
the
Variance
of
the
 market
Y.

 
 Cov(X,Y ) "= 
 2 #Y 
 Recall
that
the
Correlation
between
X
and
Y,
 
 
 
 
 Therefore,
by
substitution,

 
 # " = RXY x 
 #y 
 Beta
is
the
standard
measure
of
the
relative
volatility
of
an
asset
against
the
market.

 Beta
is
equivalent
to
the
slope
of
the
best‐fit
regression
line
that
relates
an
individual
 asset’s
returns
(y
axis)
to
comparable
market
returns
(x
axis).




4


!


 Alpha,
 ! 
 
 The
Y‐intercept
of
the
best‐fit
regression
line
is
known
as
“Alpha.”
It
measures
the
 average
excess
return
of
the
asset
against
the
market
(the
expected
return
of
the
 asset
when
the
market
return
=
0%).

 
 The
formula
of
the
best‐fit
regression
line
is
 
 y = !x +" 
 
 where
x
is
the
market
return
and
y
is
the
expected
return
of
the
one
stock.
 
 2.7
Calculating
the
Expected
Return,
and
Volatility,
of
a
Combination
of
Assets
 
 Portfolio
Expected
Return
 
 The
expected
return
of
two
(2)
assets
is
simply
the
sum
of
the
proportionally
 weighted
expected
returns
of
those
two
assets.
For
example,

the
expected
return
of
 a
portfolio
consisting
of
30%
Asset
A,
and
70%
Asset
B,
is
0.3E( rA )
+
0.7E( rB ).

 
 The
same
is
true
for
portfolios
of
more
than
two
assets.

 
 ! ! Portfolio
Volatility
as
Standard
Deviation
 
 The
volatility
of
a
combination
of
two
or
more
assets,
measured
in
standard
 deviations,
is
usually
not
equal
to
the
sum
of
proportionally
weighted
volatilities.
It
 is
usually
less.
 
 Consider
the
following
example,
based
on
actual
return
data
from
the
bull
market
 1990‐1999.
 
 
 
 
 
 GM
 
 Microsoft
 50/50
Portfolio
 Average
Return:

 
 
 14.25%
 62.72%
 38.48%
 Standard
Deviation
of
Returns:

 25.25%
 37.99
 
 15.6%
 
 For
two
assets,
the
standard
deviation
of
returns
is
the
square
root
of: 2 2 w A" 2 (rA ) + w B" 2 (rB ) + 2w A w BCovAB 
 
 
 
 


5


2.8
Plotting
the
Efficient
Frontier
 
 Graphing
Convention

 
 When
graphing
standard
deviation
of
returns
against
expected
returns,

 
 
 The
X‐axis
is
always
Standard
Deviation
of
Returns
 
 The
Y‐axis
is
always
Expected
Return.
 
 
 Definition
of
Risk‐Averse
Investor
 
 Given
two
alternative
portfolios
with
the
same
expected
return,
risk‐averse
 investors
will
choose
the
one
with
the
lower
volatility
(standard
deviation
of
 returns).

 
 Definition
of
Profit‐Maximizing
Investor
 
 Given
two
alternative
portfolios
with
the
same
volatility
(standard
deviation
of
 returns),
the
profit‐maximizing
investor
will
choose
the
one
with
the
higher
 expected
return.

 
 The
Efficient
Frontier
 
 Given
graphing
conventions,
risk‐averse,
profit‐maximizing
investors
want
to
be
as
 far
to
the
upper
left
corner

‐‐
the
“northwest”
‐‐
of
the
risk/return
graph
as
they
can
 be.

 
 The
line
that
defines
those
portfolio
weightings
that
cannot
be
improved
upon
for
a
 risk‐averse,
profit‐maximizing
investor,
is
known
as
the
Efficient
Frontier.

 
 
 
 
 
 
 
 
 
 
 
 END


6

Similar Documents