What's new

# Miller Chapter 3: Basic Statistics - Study Notes

#### Dr. Jayanthi Sankaran

##### Well-Known Member
Hi Brian:

I think I am missing something in David's notes on page 27:

On the very basic variance formula:

E[(Y - mu)^2] = E(Y^2) - [E(Y)]^2, if probability of loan default (PD) = p, then

Variance of PD is

E[PD^2] - (E[PD])^2, As E[PD^2] = p and E[PD] = p,
E[PD^2] - (E[PD])^2 = p - p^2 = p*(1-p)

How is it that E[PD^2] = p? What am I missing here?

Thanks!
Jayanthi

#### brian.field

##### Well-Known Member
Subscriber
Hi Jayanthi! Glad to see you working so hard!

This example is a bit unintuitive at first. The critical thing to realize is that the example is assuming a Bernouli random variable, if I'm not mostaken.

So, that means there are two outcomes, namely, X=1 with probability p and X=0 with probability 1-p = q.

So, E(X) = p*(1) + q*(0) = p + 0 = p and E(X^2) = p*(1^2)+q*(0^2) = p*(1^2) + 0 = p*(1) = p

Make sense?

#### Dr. Jayanthi Sankaran

##### Well-Known Member
Thanks, Brian - yes trying to work as hard as possible - however it is not consistent, day by day! Yes, it makes sense, now.....

I have one more question (Pg 31 of David's study notes, Chapter 3, Miller - Basic Statistics):

We have the following set up:

X Y (X - Xavg)(Y - Yavg)
3 5 0.0
2 4 1.0
4 6 1.0​
Avg = 3 Avg = 5 Avg = sigma(xy) = 0.67
StdDev = SQRT(0.67) StdDev = SQRT(0.67) Correlation = 1.0

Population covariance = [sum of cross-products]/n = 2.0/3 = 0.67
Sample covariance = [sum of cross-products]/(n -1) = 2.0/2 = 1.0

My question is:

We can also compute Covariance(XY) = E(XY) - E(X)E(Y)
From above E(XY) = 15.67
And so Covariance (XY) = 15.67 - (3)(5) = 0.67 (same as above)
While this formula holds true for the population covariance, it does not give us the value of 1.0 (as above) for the sample covariance. Why is this anomaly?

#### ShaktiRathore

##### Well-Known Member
Subscriber
Jayanthi,
I think its because sample cov takes n-1 as denoninator while expected values of x,y and xy takes n as denominator. So difference in denominator shall be responsible for this anamoly.
Thanks
You can see this from my derivation of the formula above,
Cov(X,Y)=E((X-Xavg)(Y-Yavg)) u can see that Cov is avg of Product of deviations takes in n as denominator
Simplify above,Cov(X,Y)=E(XY)-Yavg.E(X)-Xavg.E(Y)+Xavg.Yavg
Cov(X,Y)=E(XY)-E(Y).E(X)-E(X).E(Y)+E(X).E(Y)=E(XY)-E(X).E(Y)
E(Y). All the terms in eqn takes in n as denom is valid for pop. Mean but not sample mean. As sample mean takes n as denom and cov n-1 as denom above relation does not hold true it seems obvious.
Thanks

Last edited:

#### ShaktiRathore

##### Well-Known Member
Subscriber
Hi Brian:

I think I am missing something in David's notes on page 27:

On the very basic variance formula:

E[(Y - mu)^2] = E(Y^2) - [E(Y)]^2, if probability of loan default (PD) = p, then

Variance of PD is

E[PD^2] - (E[PD])^2, As E[PD^2] = p and E[PD] = p,
E[PD^2] - (E[PD])^2 = p - p^2 = p*(1-p)

How is it that E[PD^2] = p? What am I missing here?

Thanks!
Jayanthi
Jayanthi May i give a twist ti soln proposed by brian,
PD iis bernaulli variable assuming two values 1(default) or 0(no default) with resp. Probabilities p and 1-p. E(PD)=p.1+(1-p).0=p=meanPD
Var(PD)=p.(1-meanPD)^2+(1-p).(0-meanPD)^2=p.(1-p)^2+(1-p).p^2=p(1-p)(1-p+p)=p(1-p).
Thanks

#### Dr. Jayanthi Sankaran

##### Well-Known Member
Hi Shakti,

Thanks a lot - I appreciate it!

(1) As far as the Bernoulli problem goes, I like your derivation - easy and simple to understand!
(2) As far as the Covariance problem goes, I got the same results as you:

Covariance(X,Y) = E(XY) - E(X)E(Y)

Although you are right in saying that the above formula holds good only for the population covariance (with n as the denominator), which is what I said to myself, the question I posed was somewhat different.

If you look at the dataset above, the population covariance of 0.67 is obtained by applying the formula:
E((X - Xavg)(Y- Yavg))/n ie. 2/3 = 0.67. The sample covariance is obtained as E((X - Xavg)(Y - Yavg))/(n -1)
ie. 2/2 = 1.0 - so how do you reconcile the adjustment in the denominator, for the sample covariance. I hope I am making myself clear....

Best
Jayanthi

#### David Harper CFA FRM

##### David Harper CFA FRM
Staff member
Subscriber
Hi @Jayanthi Sankaran I thinks it's a great point. I think the issue is that this is strictly a population covariance, Covariance(X,Y) = E(XY) - E(X)E(Y), and we cannot expect E(XY) to survive a translation from population to sample. The more fundamental idea, I think that's relevant here, is that unlike the population covariance (which is based on full knowledge of the distribution), there are more than one sample covariances possible. This is the nature of statistics: in theory there is only one population parameter (e.g., a population mean or population covariance) which is typically unknown to us, but inferred by several different estimators or statistics (i am ignoring the subtle difference). Here is the thing, just as sample volatility can either be divided by (n) or (n-1) in the denominator, so can sample covariance. It's actually the same choice as the choice in volatility (i.e., in volatility Hull first computes an unbiased volatility, which divides by n-1, but for the sake of convenience swithes to an MLE estimators which divides by n. Either is okay!): we divide by (n-1) merely to select the so-called unbiased estimator, but we could legitimately divide by (n) only and call that sample covariance, but our estimate would be of the "maximum likelihood estimate, MLE" sort (see http://en.wikipedia.org/wiki/Sample_mean_and_sample_covariance ).

So, given that there is more than one sample estimator for the true (actual) population covariance, I think there is no reason to expect the E(.) based formula to reconcile to all of them. Put another way, computing 0.67 is technically also a valid sample covariance, but as we (somewhat by convention) prefer unbiased estimators, we'd know to divide by (n-1).

Off-topic, but what sometimes trips me up is that the correlation coefficient is the same! I always think that's cool; e.g., Excel has a sample vs population variance and covariance but doesn't distinguish sample-vs-population for the correlation coefficient. Why? Because the (n-1) cancels out in the unitless correlation:

sample correlation = sample covariance/[sample std dev]*[sample std dev] = [sum cross products]/(n-1) / (sqrt [.. /(n-1)]* sqrt [.. /(n-1)]), where the 1/(n-1)*[sqrt(n-1)*sqrt(n-1)] = (n-1)/(n-1). Not your question but just in case you go there

#### Dr. Jayanthi Sankaran

##### Well-Known Member
Hi David,

Thanks for your detailed explanation - I like it - especially about the MLE estimate and the correlation (sample correlation coeff = population correlation coeff) - lucid and clear

Jayanthi

#### brian.field

##### Well-Known Member
Subscriber
I hadn't had a chance to respond! I'll say, "Yeah, what he (David) said!"

Brian

#### Dr. Jayanthi Sankaran

##### Well-Known Member
Okay, thanks Brian - I am sure you would have said the same thing!

Jayanthi

#### Dr. Jayanthi Sankaran

##### Well-Known Member
Hi David,

In page 39 of your Study Notes for Miller, Chapter 3, Basic Statistics, I am not sure I understand the following:

"In general, for (n) random variables, the number of non-trivial cross-central moments of order (m) is given by:

Equation (1)

k = (m + n - 1)! - n
m!(n - 1)!
In the case of n = 3, we have coskewness which is given by:

Equation (2)

k3 = (n + 2)(n+1)n - n
6​

How do you get equation (2) from equation (1)? Although I have seen part of equation (2) elsewhere, I don't know how to derive it!

Thanks
Jayanthi

Last edited:

#### ShaktiRathore

##### Well-Known Member
Subscriber
Jayanthi,
Its m=3 not n=3 a typo i think
k(m)=((m+n-1)!)/(m!(n-1)!)-n
k(3)=((3+n-1)!)/(3!(n-1)!)-n
k(3)=((n+2)!)/(6(n-1)!)-n
k(3)=((n+2)(n+1)n(n-1)!)/(6(n-1)!)-n [(n+2)! Can be write as (n+2)(n+1)n(n-1)!]
k(3)=((n+2)(n+1)n/6)-n
Yhanks

#### Dr. Jayanthi Sankaran

##### Well-Known Member
Thanks, Shakti - yes, I think it is a typo - neat derivation......

Jayanthi

Staff member
Subscriber

#### Dr. Jayanthi Sankaran

##### Well-Known Member
Hi David,

Thanks for your detailed explanation - it's great However, when I use the BA II Plus Professional Calculator, I get different values:

Y central moments (Excel spreadsheet) Y central moments (my calculations)
2 3 4 2 3 4
0.391 -0.488 0.610 0.423 -0.549 0.714
0.031 -0.008 0.002 0.045 -0.014 0.004
0.766 1.340 2.345 0.723 1.228 2.088
1.188 0.844 2.957 1.191 0.665 2.806
Std.
Dev 1.090 1.091

Skew 0.65 Skew 0.665
Kurtosis 2.097 Kurtosis 1.981

Co-Skew Co-Kurtosis
S(XXY) S(XYY) K(XXXY) K(XXYY) K(XYYY)
-31% -39% 31% 39% 49%
0% 0% 0% 0% 0%
44% 77% 44% 77% 134%
(CCM; sum) 0.1250 0.3750 0.7500 1.1563 1.8281
Std. CCM 0.2294 0.4466 1.9467 1.9474 1.9979
(My calculations)
Co-Skew Co-Kurtosis
S(XXY) S(XYY) K(XXXY) K(XXYY) K(XYYY)
-32.5% -42.3% 32.5% 42.25% 54.93%
0% 0% 0% 0% 0%
42.5% 72.3% 42.5% 72.25% 122.83%
(CCM; sum) 0.1000 0.3000 0.7500 1.1450 1.7776
Std. CCM 0.1830 0.3560 1.9453 1.9245 1.9362

I replicated the above using the formula's on the Excel spreadsheet. And have reviewed it many times - also looked for decimal problems - am foxed as to why the values are different? Although the value differences between standard deviation, skewness and kurtosis are trivial, it is not so with co-skewness and co-kurtosis!

Thanks!
Jayanthi

Last edited by a moderator:

#### Dr. Jayanthi Sankaran

##### Well-Known Member
Hi David,

Sorry about the mumble-jumble above - all the alignments have gone for a toss, despite spending a lot of time on it!

Thanks!
Jayanthi

#### Dr. Jayanthi Sankaran

##### Well-Known Member
Hi David,

Some other pointers:

(1) None of the dropbox links are working!
(2) Some typos:

"I was not very clear, above, about standardization. For that, I think it's useful to contemplate covariance.
Covariance is the raw ("unstandardized") second cross-central moment, E[(X - mu[X]^a)*(Y - mu[Y]^b)], where we happen to have a = 1, b = 1, such that a+b = 2
Which is just E[(X - mu[X])*(Y - mu[Y])].
We can then standardize covariance into correlation by dividing it by the product of sigma(X)*sigma(Y).

Similarly, there are three ways to compute a fourth cross-central moment because a+b=4 in three different ways: a = 1, b=3 OR a=2, b=2 OR a=3, b=1 (a =4, b=0 OR a=0, b=4 gives us a fourth "univariate" central moment instead, not a cross-central moment). A fourth cross-central moment can be either of:
• mu(XXXY) = E[(X - mu[X]^3)*(Y - mu[Y]^1)]
• mu(XXYY) = E[(X - mu[X]^2)*(Y - mu[Y]^2)], or
• mu(XYYY) = E[(X - mu[X]^1)*(Y - mu[Y]^3)], or
Then we standardize these (similar to standardizing covariance into correlation) into co-kurtosis:
• K(XXXY) = E[(X - mu[X]^3)*(Y - mu[Y]^1)] / [sigma(X)^3*sigma(Y)^1]
• K(XXYY) = E[(X - mu[X]^2)*(Y - mu[Y]^2)] / [sigma(X)^2*sigma(Y)^2]
• K(XYYY) = E[(X - mu[X]^1)*(Y - mu[Y]^3)] / [sigma(X)^1*sigma(Y)^3]"
Thanks!
Jayanthi

#### Nicole Seaman

Staff member
Subscriber
Hello @Jayanthi Sankaran,

I have fixed all of the dropbox links in David's forum link so they are all working now. Thank you for pointing out that they were broken.

Nicole

#### Dr. Jayanthi Sankaran

##### Well-Known Member
Thanks, Nicole - appreciate it!

Jayanthi

#### Dr. Jayanthi Sankaran

##### Well-Known Member
Hi Brian,

Hope your studying for the FRM II is coming along, nicely - I need to speed up! Meanwhile, I have a quick question for you:

• Does one need to know (memorize!) the formula for sample skewness and sample kurtosis, with corrections for overlap with calculation of sample mean and sample standard deviation
• The adjusted formula's are quite difficult to memorize....
• These adjusted formula's are in the GARP FRM Miller (Chapter 3) and not in the BT notes

Thanks!
Jayanthi