Law of iterated expectations: geometric aspect

There will be a separate post on projectors. In the meantime, we'll have a look at simple examples that explain a lot about conditional expectations.

Examples of projectors

The name "projector" is almost self-explanatory. Imagine a point and a plane in the three-dimensional space. Draw a perpendicular from the point to the plane. The intersection of the perpendicular with the plane is the points's projection onto that plane. Note that if the point already belongs to the plane, its projection equals the point itself. Besides, instead of projecting onto a plane we can project onto a straight line.

The above description translates into the following equations. For any define

(1) and

projects onto the plane (which is two-dimensional) and projects onto the straight line (which is one-dimensional).

Property 1. Double application of a projector amounts to single application.

Proof. We do this just for one of the projectors. Using (1) three times we get

(1)

Property 2. A successive application of two projectors yields the projection onto a subspace of a smaller dimension.

The simple truth about conditional expectation

In the time series setup, we have a sequence of information sets (it's natural to assume that with time the amount of available information increases). Denote

the expectation of conditional on . For each ,

is a projector onto the space of random functions that depend only on the information set .

Property 1. Double application of conditional expectation gives the same result as single application:

(4)

( is already a function of , so conditioning it on doesn't change it).

Property 2. A successive conditioning on two different information sets is the same as conditioning on the smaller one:

(5)

(6)

Property 3. Conditional expectation is a linear operator: for any variables and numbers

It's easy to see that (4)-(6) are similar to (1)-(3), respectively, but I prefer to use different names for (4)-(6). I call (4) a projector property. (5) is known as the Law of Iterated Expectations, see my post on the informational aspect for more intuition. (6) holds simply because at time the expectation is known and behaves like a constant.

Summary. (4)-(6) are easy to remember as one property. The smaller information set wins:

Law of iterated expectations: informational aspect

The notion of Brownian motion will help us. Suppose we observe a particle that moves back and forth randomly along a straight line. The particle starts at zero at time zero. The movement can be visualized by plotting on the horizontal axis time and on the vertical axis - the position of the particle. denotes the random position of the particle at time .

Figure 1. Unconditional expectation

In Figure 1, various paths starting at the origin are shown in different colors. The intersections of the paths with vertical lines at times 0.5, 1 and 1.5 show the positions of the particle at these times. The deviations of those positions from to the upside and downside are assumed to be equally likely (more precisely, they are normal variables with mean zero and variance ).

Unconditional expectation

“In the beginning there was nothing, which exploded.” ― Terry Pratchett, Lords and Ladies

If we are at the origin (like the Big Bang), nothing has happened yet and is the best prediction for any moment we can make (shown by the blue horizontal line in Figure 1). The usual, unconditional expectation corresponds to the empty information set.

Conditional expectation

Figure 2. Conditional expectation

In Figure 2, suppose we are at The dark blue path between and has been realized. We know that the particle has reached the point at that time. With this knowledge, we see that the paths starting at this point will have the average

(1)

This is because the particle will continue moving randomly, with the up and down moves being equally likely. Prediction (1) is shown by the horizontal light blue line between and In general, this prediction is better than .

Note that for different realized paths, takes different values. Therefore , for , is a random variable. It is a function of the event we condition the expectation on.

Law of iterated expectations

Figure 3. Law of iterated expectations

Suppose you are at time (see Figure 3). You send many agents to the future to fetch the information about what will happen. They bring you the data on the means they see (shown by horizontal lines between and Since there are many possible future realizations, you have to average the future means. For this, you will use the distributional belief you have at time The result is Since the up and down moves are equally likely, your distribution at time is symmetric around Therefore the above average will be equal to This is the Law of Iterated Expectations, also called the tower property:

(2)

The knowledge of all of the future predictions , upon averaging, does not improve or change our current prediction .

For a full mathematical treatment of conditional expectation see Lecture 10 by Gordan Zitkovic.

Portfolio analysis: return on portfolio

Exercise 1. Suppose a portfolio contains shares of stock 1 whose price is and shares of stock 2 whose price is . Stock prices fluctuate and are random variables. Numbers of shares are assumed fixed and are deterministic. What is the expected value of the portfolio?

Solution. The portfolio value is its market price . Since this is a linear combination, the expected value is .

In fact, the portfolio analysis is a little bit different than suggested by Exercise 1. To explain the difference, we start with fixing two points of view.

View 1. I hold a portfolio of stocks. I may have inherited it, and it does not matter how much it cost at the moment it was formed. If I want to sell it, I am interested in knowing its market value. In this situation the numbers of shares in my portfolio, which are constant, and the market prices of stocks, which are random, determine the market value of the portfolio, defined in Exercise 1. The value of the portfolio is a linear combination of stock prices.

View 2. I have a certain amount of money to invest. Being a gambler, I am not interested in holding a portfolio forever. I am thinking about buying a portfolio of stocks now and selling it, say, in a year at price . In this case I am interested in the rate of return defined by is considered deterministic (current prices are certain) and is random (future prices are unpredictable). Thus the rate of return is random.

We pursue the second view (prevalent in finance). As it often happens in economics and finance, the result depends on how one understands the things. Suppose the initial amount is invested in assets. Denoting the amount invested in asset , we have . Denoting the share (percentage) of in the total investment , we have

(1)

The initial shares are deterministic.

Let be what becomes of in one year and let be the total value of the investment at the end of the year. Since different assets grow at different rates, generally it is not true that . Denote the rate of return on asset . Then

(2)

Exercise 2. The rate of return on the portfolio is a linear combination of the rates of return on separate assets, the coefficients being the initial shares of investment.

Solution. Using Equations (1) and (2) we get

(3)

Once you know this equation you can find the mean and variance of the rate of return on the portfolio in terms of investment shares and rates of return on assets.

Applications of the diagonal representation IV

Principal component analysis is a general method based on diagonalization of the variance matrix. We consider it in a financial context. The variance matrix measures riskiness of the portfolio. We want to see which stocks contribute most to the portfolio risk. The surprise is that the answer is given not in terms of the vector of returns but in terms of its linear transformation.

8. Principal component analysis (PCA)

With such a matrix, instead of we can consider its transformation for which

We know that has variances on the main diagonal. It follows that for all Variance is a measure of riskiness. Thus, the transformed variables are put in the order of declining risk. What follows is the realization of this idea using sample data.

In a sampling context, all population means shoud be replaced by their sample counterparts. Let be a vector of observations on at time These observations are put side by side into a matrix where is the number of moments in time. The population mean is estimated by the sample mean

In general, the eigenvalues in are not ordered. Ordering them and at the same time changing places of the rows of correspondingly we get a new orthogonal matrix (this requires a small proof) such that the eigenvalues in will be ordered. There is a lot more to say about the method and its applications.

Efficient market hypothesis is subject to interpretation

The efficient market hypothesis (EMH) is an investment theory that states it is impossible to "beat the market" because stock market efficiency causes existing share prices to always incorporate and reflect all relevant information. According to the EMH, stocks always trade at their fair value on stock exchanges, making it impossible for investors to either purchase undervalued stocks or sell stocks for inflated prices. As such, it should be impossible to outperform the overall market through expert stock selection or market timing, and the only way an investor can possibly obtain higher returns is by purchasing riskier investments.

This is not Math, and the EMH interpretation is subjective. My purpose is not to discuss the advantages and drawbacks of various versions of the EMH but indicate some errors students make on exams.

Best(?) way to answer questions related to EMH

Since there is a lot of talking, the best is to use the appropriate key words.

Start with "The EMH states that it is impossible to make economic profit".

Then explain why: The stock market is efficient in the sense that stocks trade at their fair value, so that undervalued or overvalued stocks don't exist.

Then specify that "to obtain economic profits, from the revenues we subtract opportunity (hidden) costs, in addition to direct costs, such as transaction fees". What on the surface seems to be a profitable activity may in fact be balancing at break-even.

Next is to address the specification by Malkiel that the EMH depends on the information set available at time .

Weak form of EMH. The information set contains only historical values of asset prices, dividends (and possibly volume) up until time . This is basically what an investor sees on a stock price chart. Many students say "historical information" but fail to mention that it is about prices of financial assets. The birthdays of celebrities are also historical information but they are not in this info set.

Semi-strong form of EMH. The info set is all publicly available information. Some students don't realize that it includes . The risk-free rate is in but not in because 1) it is publicly known and 2) it is not traded (it is fixed by the central bank for extended periods of time).

Strong form of EMH. The info set includes all publicly available info plus private company information. Firstly, this info set includes the previous two: . Secondly, whether a certain piece of information belongs to or depends on time. For example, the number of shares Warren Buffett purchased today of the stock is in but over time it becomes a part of because large holdings must be reported within 45 days of the end of a calendar quarter. If there are nuances like this you have to explain them.

Implications for time series analysis

Conditional expectation is a relatively complex mathematical construct. The simplest definition is accessible to basic statistics students. The mid-level definition in case of conditioning on a set of positive probability already raises questions about practical calculation. The most general definition is based on Radon-Nikodym derivatives. Moreover, nobody knows exactly any of those . So how do you apply time series models which depend so heavily on conditioning? The answer is simple: since by the EMH the stock price "reflects all relevant information", that price is already conditioned on that information, and you don't need to worry about theoretical complexities of conditioning in applications.

The Newey-West estimator: uncorrelated and correlated data

I hate long posts but here we by necessity have to go through all ideas and calculations, to understand what is going on. One page of formulas in A. Patton's guide to FN3142 Quantitative Finance in my rendition becomes three posts.

Preliminaries and autocovariance function

With the help of this matrix we derived two expressions for variance of a linear combination:

(2)

for uncorrelated variables and

(3)

when there is autocorrelation.

In a time series context are observations along time. stand for moments in time and the sequence is called a time series. We need to recall the definition of a stationary process. Of that definition, we will use only the part about covariances: depends only on the distance between the time moments For example, in the top right corner of (1) we have which depends only on

Preamble. Let be a stationary times series. Firstly, depends only on Secondly, for all integer denoting we have

(4)

Definition. The autocovariance function is defined by

(5) for all integer

In particular,

(6) for all

The preamble shows that definition (5) is correct (the right side in (5) depends only on and not on ). Because of (4) we have symmetry so negative can be excluded from consideration.

With (5) and (6) for a stationary series (1) becomes

(7)

Estimating variance of a sample mean

Uncorrelated observations. Suppose are uncorrelated observations from the same population with variance From (2)
we get

(8)

This is a theoretical relationship. To actually obtain an estimator of the sample variance, we need to replace by some estimator. It is known that

(9)

consistently estimates Plugging it in (8) we see that variance of the sample mean is consistently estimated by

This is the estimator derived on p.151 of Patton's guide.

Correlated observations. In this case we use (3):

.

Here visualization comes in handy. The sums in the square brackets include all terms on the main diagonal of (7) and above it. That is, we have copies of copies of ,..., 2 copies of and 1 copy of The sum in the brackets is

Thus we obtain the first equation on p.152 of Patton's guide (it's up to you to match the notation):

(10)

As above, this is just a theoretical relationship. is estimated by (9). Ideally, the estimator of is obtained by replacing all population means by sample means:

(11)

There are two problems with this estimator, though. The first problem is that when runs from to runs from to To exclude out-of-sample values, the summation in (11) is reduced:

(12)

The second problem is that the sum in (12) becomes too small when is close to For example, for (12) contains just one term (there is no averaging). Therefore the upper limit of summation in (10) is replaced by some function that tends to infinity slower than The result is the estimator

where is given by (9) and is given by (12). This is almost the Newey-West estimator from p.152. The only difference is that instead of they use, and I have no idea why. One explanation is that for low , can be zero, so they just wanted to avoid division by zero.

Question 4. Note that the matrix (1) is symmetric (elements above the main diagonal equal their mirror siblings below that diagonal). This means that some terms in the second sum on the right of (5) are repeated twice. If you group equal terms in (5), what do you get?

Answer 4. The idea is to write

that is, to join equal elements above and below the main diagonal in (1). For this, you need to figure out how to write a sum of the elements that are above the main diagonal. Make a bigger version of (1) (with more off-diagonal elements) to see that the elements that are above the main diagonal are listed in the sum This sum can also be written as Hence, (5) is the same as

(7)

Unlike (6), this equation is applicable when there is autocorrelation.

Variance of a vector: motivation and visualization

I always show my students the definition of the variance of a vector, and they usually don't pay attention. You need to know what it is, already at the level of simple regression (to understand the derivation of the slope estimator variance), and even more so when you deal with time series. Since I know exactly where students usually stumble, this post is structured as a series of questions and answers.

Think about ideas: how would you define variance of a vector?

be a vector with components, each of which is a random variable. How would you define its variance?

The answer is not straightforward because we don't know how to square a vector. Let denote the transposed vector. There are two ways to multiply a vector by itself: and

Question 2. Find the dimensions of and and their expressions in terms of coordinates of

Answer 2. For a product of matrices there is a compatibility rule that I write in the form

(2)

Recall that in the notation means that the matrix has rows and columns. For example, is of size Verbally, the above rule says that the number of columns of should be equal to the number of rows of In the product that common number disappears and the unique numbers ( and ) give, respectively, the number of rows and columns of Isn't the the formula
easier to remember than the verbal statement? From (2) we see that is of dimension 1 (it is a scalar) and is an matrix.

For actual multiplication of matrices I use the visualization

(3)

Short formulation. Multiply rows from the first matrix by columns from the second one.

Long Formulation. To find the element of we find a scalar product of the th row of and th column of To find all elements in the th row of we fix the th row in and move right the columns in Alternatively, to find all elements in the th column of we fix the th column in and move down the rows in . Using this rule, we have

(4)

Usually students have problems with the second equation.

Based on (1) and (4), we have two candidates to define variance:

(5)

and

(6)

Answer 1. The second definition contains more information, in the sense to be explained below, so we define variance of a vector by (6).

Question 3. Find the elements of this matrix.

Answer 3. Variance of a vector has variances of its components on the main diagonal and covariances outside it:

(7)

If you can't get this on your own, go back to Answer 2.

There is a matrix operation called trace and denoted . It is defined only for square matrices and gives the sum of diagonal elements of a matrix.

Exercise 1. Show that In this sense definition (6) is more informative than (5).

Solution to Question 2 from UoL exam 2016, Zone A (FN3142)

This is another difficult question, and I don't think it will appear again in its entirety. However, the ideas applied here and here are worth repeating and will surely be on future UoL exams in some form.

Problem statement

You hold two different corporate bonds (bond A and bond B), each with a face value of $1 mln. The issuing firms have a 2% probability of defaulting on the bonds, and both the default events and the recovery values are independent of each other. Without default, the notional value is repaid, while in case of default, the recovery value is uniformly distributed between 0 and the notional value.
(a1) (20 points) Find the 1% VaR for bond A or bond B and report your calculations. (HINT: you will need the definition and properties of a uniform distribution on .)
(a2) (60 points) Taking into account the formula for the distribution function of the sum of two independent uniformly distributed random variables on explain how you would find the 1% VaR for a portfolio combining the two bonds (A + B). Report your calculations without finding the actual value.
(b) (20 points) The 1% expected shortfall is defined as the expected loss given that the loss exceeds the 1% VaR. Find the 1% expected shortfall for bond A and report your calculations.

I made the statement shorter by referencing my post on the uniform distribution. The formulas for the triangular distribution given in the exam and examiner's comments are both wrong.

Solution

As with previous solutions related to VaR, I emphasize general methods that reduce the amount of guessing to a minimum. Besides, I work with the definition that gives a negative VaR in percents (that is, I work with returns) and then translate that value to positive dollar amounts. Translating the problem statement to returns: without default, the return on each bond is zero, while in case of default the loss is uniformly distributed between -1 and 0 (-1 corresponds to -100%). The recovery value is the notional value minus the dollar loss.

The method consists of two steps. Step 1. Derive the distribution function. Step 2. Use the usual or generalized inverse to find the VaR.

(a1) denotes the return on A, is the event that A defaults and is the complement event of no default. Similar notation is employed for B. By the law of total probability for any real

(1)

We want to show that for our purposes the second term can be made zero. We know that without default, return is zero. This means that conditionally we deal with a random variable that takes value 0 with probability 1. Hence, conditional on no default, by additivity of conditional probability for

(2)

because the middle term on the right is 1 and the other two are zero. It follows that for the second term in (1) is

(3)

To find the VaR, we need the whole expression in (1) to be 0.01, so we have to consider only , in which case the second term on the right of (1) is zero.

As this should be equal to 0.01, we obtain . The loss is $1 mln times 50% and the recovery value is half a million.

(a2) Denote . This allows us to use the formula for the convolution of two independent uniform distributions. We should remember that this is not a return on the total portfolio because it takes values between -2 and 0. By the law of total probability for any real

(4)

.

As above, we can show that the last term in (4) is large if . Indeed, if no company defaults, the return is zero and, as in (2), for such

.

Therefore, as in (3)

.

It follows that we can restrict our attention to , in which case the last term on the right of (4) is zero, the second and third terms are the same and we get

(5) .

In case of two defaults, are independent and distributed as . Hence, has a triangular distribution. Denoting its density , we have

(6) .

The integral here is

(7)

In case of one default, we use the uniform distribution to find

(8) .

Plugging (6), (7), (8) in (5) and equating the result to 0.01, we get

(9)

and

(10) .

Mathematica gives two solutions for (9), none of which is in the interval (-2,-1). Of the two solutions of (10), the one which belongs to (-1,0) is -0.75. This is 37.5% of -2 and the loss is $750,000 out of $2 mln. The exam question doesn't require you to give numerical values.

Law of total probability - you could have invented this

A knight wants to kill (event ) a dragon. There are two ways to do this: by fighting (event ) the dragon or by outwitting () it. The choice of the way ( or ) is random, and in each case the outcome ( or not ) is also random. For the probability of killing there is a simple, intuitive formula:

This is easy to generalize to the case of many conditioning events. Suppose are mutually exclusive (that is, disjoint) and collectively exhaustive (that is, cover the whole sample space). Then for any event one has

.

This equation is call the law of total probability.

Application to a sum of continuous and discrete random variables

Let be independent random variables. Suppose that is continuous, with a distribution function, and suppose is discrete, with values . Then for the distribution function of the sum we have