Excel
02 Dec 2008
Learn Finance with the pros. Better articles, resources and screencasts for easier learning.
Episode #2 is called Quant B. This is a review of the first four assigned chapters (chapters one to four) in Essentials of Econometrics. As usual, members can access on the premium page; non-members can sample the first 15 minutes here.
I would like to highlight a few key themes for this episode (Gujarati's first four chapters):
The deterministic linear regression model is Y = mX + b. But this model is limited: it does not imply causality (it may be "merely predictive"). And it does not recognize a non-linear relationship. Worse, in the real world, the dependent variable (Y) is almost certainly a function of more than one independent variable (X). Adding the error term is therefore important and changes a deterministic model into a statistical or econometric model: Y = mX + b + error. The error contains everything we don't know about impacts on the dependent variable, which is a lot!
It is good to be clear on these terms because they are used a lot. If you would like a really concrete example, I uploaded Gujarati's example (PC versus printer sales) to a spreadsheet that calculates all possibilities (see spreadsheets below).
To further illustrate the difference, consider a simple basket of two bonds, bond G and bond H. Then ask three questions:
On a superficial level, all distributions have the same job. A mathematical function describes the behavior of a random variable, giving shape to a distribution. The area under the distribution's curve (or step function) equals 1.0. We produce a sample statistic. We use the distribution to judge the statistic: is this a likely outcome (are we near the mean) or unlikely (are we out in the tail?). Why are some distributions complex? Often because we are trying to give more realistic shape to a distribution; e.g., fatter tail, more skew. A lot of the operational risk distributions are complex specifically because they are trying to capture the special fatness of the operational loss tail, so they have parameter complexity.
Note Gujarati's classic distinction between two types of distributions and then, as a different matter, two functional questions about distributions:
Note that discrete versus continuous is not a choice, it is a feature of the random variable. The normal, for example, is always continuous; a coin flip is always discrete. On the other hand, regardless of the distribution (discrete or continuous), we can ask either the density/mass question or the cumulative question: what is the probability P(X=x) or what is the probability P(X<=x)?
| P [X=x] or P[x1 <= X <= x2] | P[X<=x] | |
| Discrete | PMF | CDF (step) |
| Continuous | CDF (continuous) |
You need to memorize several formulas in Chapter 3 of Gujarati. These fall into three buckets:
In my opinion, these below you should know cold as they are used often:
I don't have a shortcut for the sample moments (sample mean, sample variance, sample skew and sample kurtosis. Plus sample covariance and sample correlation). You'll note they all tend to divide by (n-1) because (n-1) is degrees of freedom (d.f.). Degrees of freedom are notoriously hard to explain (note confusion behind the wikipedia entry!). Gujarati's explanation on page 93 is the best I've seen.
In regard to the sample statistic, I think of this as taking an "almost average." As in, the population variance is the expected square of deviations (deviations from the average). To get an expected value, we take an average: we sum (the deviations squared) and divide by n. But for a sample, we take an "almost average:" sum the deviations squared and divide by (n-1) instead of (n). Intuitively, we admit our uncertainty with a slightly larger variance.
You have four distributions to learn but a single shared pattern:
Note that both the normal and the student's t distribution are used to test the sample mean against a hypothetical population mean. But we use the student's t when the variance is unknown and the sample is small (if the sample is large, the student's t approximates the normal anyway).
| Portfolio Asset | Test | Test statistic |
| Standard Normal | Sample mean versus (hypothetical) population mean and we know the population variance or large sample | (value - mean) / [standard deviation/SQRT(n)] |
| Student's t | Sample mean versus (hypothetical) population mean but we don't know the population variance | (value - mean)/ [standard deviation/SQRT(n)] |
| Chi-square | Sample variance versus (hypothetical) population variance | [sample variance / hypothetical population variance]*(n-1) |
| F distribution | Ratio of two sample variances: are they from populations with the same variance? | (larger variance)/ (smaller variance) |
I uploaded several new EditGrid spreadsheets to the member area. These "learning worksheets" that can be accessed in three ways:
For this episode #2, I uploaded the following spreadsheets:
But, as I wrote last time, the spreadsheets are not required study. Nor I do not recommend them for your "first pass" if you are just getting your feet wet in the FRM. As I mentioned in the Episode, I hope they may be helpful in some cases, where you seek a concrete clarifications.
Paid member access the screencast in the member section. In addition to the viewable screencast:
Non-members can sample the start of the screencast tutorial here.
I wrote the following (new) questions to engage you in this episode. My answers are located here in the forum. These are not really exam-types questions as exam-type quesitons tend to be very specific (except the Bayes' Formula question. That's typical). Instead, I hope these may provoke you to think about the episode and, in some cases, draw connections to other areas of the FRM curriculum.
In the Wilmott reading (Chapter 22 VaR), the Generalized Pareto distribution (GPD) is used to approximate losses that exceed some threshold (peaks over threshold).
Is the GPD a PMF, PDF or CDF?
A priori, assume the odds of a recession next year are 25% (and 75% that there will be no recession, so only two outcomes). If the economy does NOT go into a recession, the likelihood that bond XYZ will default is only 1.0% (therefore, there is a 99% probability of no default). If on the other hand the economy DOES descend into recession, the likelihood bond XYZ will default increases to fully 9.0%. At the end of the year, we observe the bond defaulted.
What is the POSTERIOR probability that the economy went into recession? (Using Bayes Theorem)
In Operational Risk, we consider the Loss Distribution Approach (LDA) which generates a total loss distribution by combining (compounding) two different distributions: a distribution that characterizes the FREQUENCY of operational losses (e.g., how many times do we exceed some loss level during a certain period) and another distribution that characterizes the SEVERITY of operational losses (what is the amount of the loss?). Are these distributions likely to be discrete or continuous?
Assume a portfolio with only two bonds. The probability that obligor A will default is F(x) = u. Separately, the probability that obligor B will default is F(y) = v. Further, assume the two credits are INDEPENDENT; i.e., they have a default correlation of zero?
Assume we manage to characterize a portfolio as a linear combination of risk factors that are each normally distributed. For example, our portfolio return = aX1 + bX2 + cX3 ... where X1, X2, etc are normally distributed random variables.
Let's say we find a good non-normal, fat-tailed distribution that characterizes an asset's returns.
Say we draw a sample of Google's daily periodic stock returns. We also draw a sample of Yahoo's daily periodic price returns. In regard to Google's historical sample, let Gm, Gv, Gn be the sample mean(Gm), the sample variance (Gv) and the sample size (Gn). In regard to Yahoo, let Ym, Yv, and Yn refer to Yahoo's sample mean (Ym), sample variance (Yv) and sample size(Yn).
For each scenario below, what is the correct distribution and what is the test statistic?
Among the student's t, the chi-squared and the F distributions:
Assume we run a Monte Carlo simulation (Willmott reading) to simulate the price path of a single stock. Our algorithm assumes the stock's returns are normally distributed (we will use Geometric Brownian Motion, GBM) and we will run a single simulation of 100 trials. The simulation will produce a distribution of final outcomes: simulated stock price levels at a future date. Must this simulated distribution (of future price levels) match any distribution, and if so, which?
In the FRM, we are repeatedly reminded that asset returns are likely to exhibit "fat-tails" (kurtosis > 3. In addition to being skewed and unstable).
If fat-tails are true, it is dangerous to depend on the normal distribution to model returns (see Taleb's Black Swan). Several remedies (or solutions or compensations) are suggested in the curriculum.
In short, as Linda Allen writes, normality cannot be salvaged. Cite a few solutions to this fat-tail problem that we've already seen in the curriculum.
Thanks very much. I will write again in two weeks with another newsletter.
David Harper, CFA, FRM, CIPM
Founder
www.bionicturtle.com
P.S. I don't want to spam you! Please click here to unsubscribe and we won't bug you...
Comments
I forgot to answer my own question about the variance of a coin toss, where Heads = 1, Tails = 0.
That means X = {0,1} and X^2 = {0,1}
E[X^2] = average {0,1} = 0.5
E[X] = 0.5
So, E(X^2) - [E(X)]^2 = 0.5 - [0.5]^2 = 0.25
Thankfully, Excel agrees: =VARP(0,1) = 0.25. Because it’s a population variance. The sample variance is =VAR(0,1) = 0.5
I want to appreciate David Harper on his efforts to educate us and I would say kept up
Leave a Comment