Showing posts with label CFA Level 2 Quantitative methods Reading 11 Correlation and Regression. Show all posts
Showing posts with label CFA Level 2 Quantitative methods Reading 11 Correlation and Regression. Show all posts

Wednesday, 12 January 2011

Wednesday, 29 December 2010

Reading 11, 3.8 Limitations of Regression Analysis

Level 2, Quantitative Methods, Reading 11

Short & Sweet!

The following limitations are important:

  • Parameter Instability - Regression relations can change over time, just as correlations can.
  • Public knowledge of regression relationships may negate their future usefulness.
  • If the regression assumptions listed in Section 3.2 are violated, hypothesis tests and predictions based on linear regression will not be valid.

That then, is Reading 11!

Tuesday, 28 December 2010

Reading 11, 3.7 Prediction intervals

Level 2, Volume 1, Quantitative methods, Reading 11, Correlation & Regression


In previous examples a regression model was calculated, where BHP revenue is the independent variable and Earnings per ordinary share is the dependent variable.

Using the linear regression formula:
Yi = bo + b1Xi, it was concluded that the linear regression formula for BHP is:
Yi =     -20.96370784 +  0.004473.Xi

In 2010, BHP revenue was $52,798b. If it is assume that, given the rise in commodities prices, investors are expecting the revenue to increase to $60,000b.

Using the regression model, 
Yi =     -20.96370784 +  0.004473.Xi, it is therefore calculated that
Yi = 247.44 cents earnings per share

It would however be pretty useful if we could use statistics to provide a level of confidence around this number. For example, as an investor it would be great if we could say that we are 95% confident that the earnings number would be for example between 200 cents earnings per share and 270 cents per share.
This range is what is calculated by Prediction intervals.

There are 4 steps to calculating the Prediction Interval.
Step 1 – Use the linear regression model to forecast value
Calculate the prediction, e.g that was done above. It was calculated that the Earnings per share would total 247.44 cents per share, if the Revenue for 2011 totalled $60,000b.

Step 2 – Calculate the estimated variance of the prediction error






Note the following:
  • The formula above calculates the variance! We are using Standard Deviation in Step 3. One should therefore obtain the square root of this answer, to get the standard deviation

  • Note that the formula makes reference to X.This is important, as it refers to the independent value, in this case Revenue per year. Values for the Prediction, Mean and Standard deviation of the independent variable is required!


Calculating the estimated variance of the prediction error:
Inputs
Values
Standard Error of Estimate
64.4
N
5
X
60000
Mean X
49810
Variance of the Mean X
 55 662 400

Estimated variance of the prediction error =
(64.4)² * (1 + (1/5)+ ((60000-49810)²/(4 X 55 662 400)))
=6825
AND REMEMBER, to get to Standard Deviation:
= √6825
= 82.61

Step 3 – Determine the critical value
N = 5, df therefore is 3
We want 95% confidence
This gives a critical value of 3.182

Step 4
247.44 +/- (3.182)(82.61)
=510.30502 AND
-15.42502

Comment
The range appears at face value to be extremely wide, to the extent that it in practise might have little value. Some the following factors should be considered:
1) The initial correlation between Revenue & Earnings per share was calculated at a low 0.51 in previous examples. This is because of an outlier year in 2009.
·         2) The sample is small, impacting on the interval 
3)   3) The level of confidence is high, at 95%.

Sunday, 26 December 2010

Reading 11, Putting the puzzle of Reading 11 together


Level 2, Volume 1, Quantitative methods, Reading 11, Correlation & Regression
Most questions related to Reading 11 incorporate tables as indicated below.
I struggled initially to understand the relevance and links between the data. After I studied it in some detail I came to the conclusion that if you understand the table, you understand most of Reading 11.
These tables are a bit like a big puzzle, and once you start to piece it together Reading 11 falls into place. This is pretty cool.
Below I use the information from Reading 11, Table 12 and show all the links and relationships using underlying formulas.
Did I say it is pretty cool?

Information from Reading 11, Table 12
Regression Statistics
Multiple R
0.928
R-Squared
0.861
Observations
60
Standard error of estimate
0.0174

ANOVA
Degrees of Freedom
Sum of Squares
Mean Sum of
Squares
F
Regression
1
          0.1093
0.1093
359.64
Residual
58
0.0176
0.0003
Total
59
0.1269

Coefficients
Standard Error
t-Statistic
Alpha
0.0009
0.0023
0.4036
Beta
0.7902
0.0417
18.9655


  
1.Calculate Correlation Coefficient  (“CC”)using Coefficient of Determination (“CD”)
Remember R-Squared = Coefficient of Determination
1.1 Reference
Reading 11, 3.4

1.2.1 Formula: Method 1
CD = Square the CC between the dependent and independent variables.
Thus CC = √CD

1.3.1 Using information from the tables:
CC =  √0.861 = 0.928

We can therefore also conclude that Multiple R = Correlation Coefficient

1.2.2 Formula: Method 2
Sum of Squares are used to calculate variation. Residual variation is the same as unexplained variation.

= 1 - (Unexplained variation/Total Variation)

1.3.2 Using information from the tables:
= 1 – (0.0176/0.1269)
= 0.928


2.1 Reference
Reading 11, 3.3

2.2 Formula






2.3 Using information from the tables:
We know that Residual Sum of Squares is the same as Sum of Error Squares.
Therefore:
√(0.0176/(60-2))
= √0.0003
= 0.0174


3. Calculating Means (Residual)
(0.0176/(60-2))
=0.0003


4. Calculate ANOVA using the F test

4.1 Reference:
Reading 11, 3.6

4.2 The formula:


4.3 Using information from the tables:
(0.1093/1) / (0.0176/(60-2))
= 360.193
(Difference due to rounding. As indicated in text book)

5. Link between F test & t-statistic

5.1 Reference
Reading 11, 3.6

5.2 Formula
For one independent variable the F-statistic is the square of the t-statistic for the slope coefficient.

5.3 Using information from the tables:
t- statistic = √F statistic
                  = √359.64
                   = 18.9655

6. Calculating the t-statistic

6.1 Reference
Reading 11, 2.6

6.2 Formula

6.3 Using information from the tables:
0.928. √(60-2) / √(1-0.928²)
18.9655


7.1 Reference
Reading 11, 3.5

7.2 Formula





This formula equals 0

7.3 Using information from the tables:
0 = 0.7902 +/- (x)(0.0417)
+/- X = 18.94







Monday, 20 December 2010

Reading 11, 3.5 Hypothesis Testing (Part b)

Level 2, Volume 1, Quantitative methods, Reading 11, Correlation & Regression, 3.5

This is Part B of Reading 11, 3.5, Part A

The most common way to test a hypothesis using a regression model is with a t-test of significance.
The formula for testing the hypothesis is just a rearrangement of the formula used previously in Part A.
The initial formula is:
 b1 equals:





But we are trying to calculate t (test statistic) and not the critical value. So t replaces tc

Therefore the equation changes to:
b1- bˆ1 = t .sbˆ1
t = (b1- bˆ1) / sbˆ1

Example 1: Calculate t for b1 from Part A
For bˆ1
= (0.005 - 0.004473) / (0.00002)
= 26.35
Because t (26.35) >  tc (5.841) , we reject the null hypothesis that b1 = 0.005

Example 2: Calculate t for bo from Part A
For bˆ0
= (-19 +20.9637) / (1)
= 1.9637
Because t (1) <  tc (3.182) , we accept the null hypothesis that b0 = 19

Thursday, 16 December 2010

Reading 11, 3.5 Five Steps to test Regression Coefficient (Part A)

Level 2, Volume 1, Quantitative methods, Reading 11, Correlation & Regression

In a previous section (2.6) hypothesis testing was used to test the significance of the correlation coefficient.
Hypothesis testing will again be used to test the hypotheses concerning the population values of the intercept (b0) or slope coefficient (b1) of a regression model. (remember intercept & slope coefficient is called the regression coefficients).

Step 1: Obtain the relevant information
1)   the estimated parameter value, bˆ0 or bˆ1;
2)   a confidence interval around the estimated parameter. (A confidence interval is an interval of values that we believe includes the true parameter value, b1, with a given degree of confidence. To compute a confidence interval, we must select the significance level for the test and know the standard error of the estimated coefficient); and
3)   the hypothesized value of the parameter, b0 or b1

Step 2:  State the hypothesis
Ho: b1 (or b0) = A certain value AND bˆ1   = estimate for b1
Ha: b1 (or b0) < > A certain value AND bˆ1   < > estimate for b1
(Because b1 (or b0) = A certain value, we are testing for a two tailed test!)


Saturday, 11 December 2010

Reading 11, 3.4 Coefficient of Determination - Method 2

Level 2, Volume 1, Quantitative Methods, Reading 11, Correlation & Regression

The references refer to the CFA text book.
3.4 Coefficient of determination (“CD”)

Why CD?
The standard error of estimate (SEE) gives some indication of how certain one can be about a particular prediction of Y using the regression equation.
It does not tell us how well the independent variable explains variation in the dependent variable. The coefficient of determination does this, measuring the fraction of the total variation in the dependent variable that is explained by the independent variable.

There are 2 methods to calculate CD. Method 1 was discussed in the previous post


Method 2:  For use in a linear regression with more than ONE independent variable

Total variation = Unexplained variation Plus Explained variation
Therefore
Explained variation = Total variation Minus Unexplained variation


Reading 11, 3.4 Coefficient of Determination - Method 1

Level 2, Volume 1, Quantitative Methods, Reading 11, Correlation & Regression

The references refer to the CFA text book.

3.4 Coefficient of determination (“CD”)

Why CD?
The standard error of estimate (SEE) gives some indication of how certain one can be about a particular prediction of Y using the regression equation.
It does not tell us how well the independent variable explains variation in the dependent variable. The coefficient of determination does this, measuring the fraction of the total variation in the dependent variable that is explained by the independent variable.

There are 2 methods to calculate CD, method 1 is shown below, with Method 2 in the next post

Method 1:  For use in a linear regression with ONE independent variable
CD = Square the correlation coefficient between the dependent and independent variables.

(Link to Excel file on box.net)

Example

Reading 11, 3.3 Standard Error of Estimate

Level 2, Volume 1, Quantitative Methods, Reading 11, Correlation & Regression


The references refer to the CFA text book.

3.3 The Standard Error of Estimate

Recall that the Standard Error of Estimate (SEE) it is a part of the linear regression formula, as shown below:




The standard error of estimates is a measure of the accuracy of predictions made by linear regression methods. It represents the portion of the dependent variable that cannot be explained by the independent variable.

The formula for the standard error of estimate (SEE) for a linear regression model with one independent variable is =
 




Thursday, 9 December 2010

Quantitative Methods: Correlation implies causation. NOT!!

Correlation does not imply Causation! Had a good laugh
Picked this up from Infectious Greed blog. 


Reading 11, 3.2 Linear Regression Model Assumptions in pictures

Level 2, Volume 1, Quantitative methods, Reading 11, Correlation & Regression


3.2 Recalling the assumptions of the Linear Regression Model
The six assumptions, noted yesterday, is a bit dry. So I have added some images (and the explanation of the images) to make it easier to recall these assumptions.

Assumptions
Ideas pictures
Images
1. The relationship between the dependent variable, Y, and the independent variable, X is linear in the parameters b0 and b1.

I associate “Independent” with the American flag, and the lines on the flag is “Linear”

2. The independent variable, X, is not random.

To be “Independent” does not happen at random, but is the result of “hard work”


3. The expected value of the error term is 0: E(℮) = 0. (Unbiased)
One of the American values is  that judges should be “unbiased”.






4. The variance of the error term is the same for all observations. (also called Homoscedasticity)

Homo = Same, therefore associate it with twins (with little variance in looks etc)




5. The error term, ℮, is uncorrelated across observations. Consequently,
E(℮i, ℮j) = 0 for all i not equal to j

Error term is uncorrelated across observations (One would think that Arnie & Danny is uncorrelated)

6. The error term, ℮, is normally distributed.

The Eiffel Tower has the shape of a normal distribution

                                                                                  









Wednesday, 8 December 2010

Reading 11, 3.2 Assumptions of the Linear Regression Model


CFA Level 2, Volume 1, Quantitative methods, Reading 11, Correlation & Regression

(References refer to CFA text book)



3.2 Assumptions of the Linear Regression Model


Classic normal linear regression model assumptions

Why is it important
Other info
1. The relationship between the dependent variable, Y, and the independent variable, X is linear in the parameters b0 and b1.

If you fit a linear model to data which are nonlinearly related your predictions are likely to be serious in error.

If the relationship between
the independent and dependent variables is nonlinear in the parameters, then estimating that relation with a linear regression model will produce invalid results.

Even if the dependent variable is nonlinear, linear regression can be used as long as the regression is linear in the parameters.


2. The independent variable, X, is not random.

Assumption 2 ensures that linear regression produces the correct estimates of b0 and b1.


3. The expected value of the error term is 0: E(℮) = 0.


Assumption 3 ensures that linear regression produces the correct estimates of b0 and b1.

E(℮) = 0. If the expected error = 0, it means that the forecast is unbiased.

If a forecast is biased it means that there are consistent differences between actual outcomes & previously generated forecasts of these quantities, that is, forecasts may have a general tendency to be too high or too low.
(2)

4. The variance of the error term is the same for all observations. (also called Homoscedasticity)
Violations of Homoscedasticity make it difficult to gauge the true standard deviation of forecast errors, usually resulting in confidence intervals that are too wide or too narrow.



5. The error term, ℮, is uncorrelated across observations. Consequently,
E(℮i, ℮j) = 0 for all i not equal to j

Serial correlation in the residuals mean that there is room for improvement in the model, and extreme serial correlation is often a symptom of a badly mis-specified model.

Assumption 5, that the errors are uncorrelated across observations, is  necessary for correctly estimating the variances of the estimated parameters bˆ0 and bˆ1.



6. The error term, ℮, is normally distributed.

Assumption 6, that the error term is normally distributed, allows us to easily test a particular hypothesis about a linear regression model.



Sources
1. www.duke.edu/~rnau/testing.htm
2. Wikipedia.org/wiki/forecast_bias