Covariance and Calculation of Portfolio Variance

Now, let's go to the next step - calculation of the expected return, the variance and the standard deviation of our portfolio, consisting of the two assets: 60% of the asset A and 40% of the asset B. Future returns of the assets A and B are considered as a random variables R A и RB.

Expected return of the asset A is 10% and the standard deviation is 8.66%. Expected return of the asset B is 15%, the standard deviation is 12%.

The calculation of the portfolio expected return is a fairly straightforward. But the calculation of the standard deviation and variance of the portfolio is more complicated, because portfolio variability (standard deviation) is not the weighted-average of the variabilities of the individual assets. Diversification reduces the variability of the portfolio, because the prices of different assets vary differently. In many cases, the decrease in price of one asset is compensated by the price growth for another.

Continue reading "Covariance and Calculation of Portfolio Variance"

Posted by mazoo at 12:49 PM | Comments (1)

August 17, 2006

Calculation of the coefficient of variation

Let’s consider the two asset portfolio with 60% of the asset A and the 40% of the asset B. Each security’s future return is considered as a random variable (RA and RB). Our portfolio is a weighed combination of assets. The return of a portfolio is also a random variable and we can calculate portfolio expected return and the variance of the portfolio.

First, let’s calculate the expected return and the variance for asset A. Assume, that the asset A has the following estimated rate of return distribution:

Rate of Return                Probability
(-5%)                                  20%
10%                                    50%
20%                                    30%

The expected rate of return for RA is:


rA = (-5%)*0.2 + 10%*0.5 + 20%*0.3 = 10%

The formula for variance RA is:

= (-5-10)(-5-10)*0.2 + (10-10)(10-10)*0.5 + (20-10)(20-10)*0.3 = 75


Standard deviation is simply the square root of the variance:
= 8.66%
Let us assume that the asset B has the expected value of return rB = 15%, and the standard deviation of RB is 12%.


The standard deviation reflects the degree of risk for each individual assets A and B. When we want to compare the risk of different assets with the different expected return, we need to use the relative measure - the coefficient of variation:

Hence,asset's A coefficient of variation is: 8.66/10 = 0.866
             asset's B coefficient of variation is: 12/15 = 0.8
So, we can say that asset A is a riskier investment than asset B.


In the next post, we'll calculate the expected return of our portfolio, define the covariance and coefficient of correlation for two assets, and how these values affect the variance and the standard deviation of the portfolio.


Technorati Tags:

Posted by mazoo at 1:50 PM | Comments (2)

December 28, 2005

Simplex Algorithm. Example #2

In the previous example we considered the solution of linear programming problem using the simplex method. We modified initial problem into the standard maximization problem with non-negative right-hand side of the constraints equations.

Let us consider more general case of solving standard maximization problem with arbitrary right-hand side of the constraints.

Initial linear programming (LP) problem:

4х1 + 15х2 + 12х3 + 2х4 -> min

2x2 + 3x3 + x4 >= 1
x1 + 3x2 + x3 - x4 >= 0
x1, x2, x3, x4 >=0

Convert initial LP problem to maximization LP problem:

-4х1 - 15х2 - 12х3 - 2х4 -> max

-2x2 - 3x3 - x4 <= -1
-x1 - 3x2 - x3 + x4 <= 0
x1, x2, x3, x4 >=0

Let S1, S2 >= 0 are slack variables.
Rewrite the constraint inequalities as equations by adding these variables:

-4х1 - 15х2 - 12х3 - 2х4 -> max (objective function)

0x1 - 2x2 - 3x3 - x4 + 1s1 + 0s2 = -1 (constraint equations)
-x1 - 3x2 - x3 + x4 + 0s1 + 1s2 = 0
x1, x2, x3, x4, s1, s2 >=0

Set up the initial simplex tableau (Click to see full size image):

simplex
1. The Cj row consists of the coefficients preceding x1, x2, x3, x4, s1, s2 from the objective function. 1 and 2 rows consist of the coefficients from the constraint equations. The RHS (right-hand side) column consists of -1 and 0 from right-hand side of these equations.
The variables that form an identity matrix are basic variables. S1 and S2 are the basic variables in our case.

2. The CB column consists of the coefficients preceding the basic variables in the objective function, i.e. 0 for S1 (row 1) and 0 for S2 (row 2).

3. The first element of the Zj row (in X1 column) is the sum of the products of multiplying each element in the CB column by each element in the X1 column.
0 (row 1, column CB) * 0 (row 1,column X1) + 0 (row 2, column CB) * (-1) (row 2,column X1) = 0
The subsequent elements of the Zj row (columns X2, X3, X4, S1, S2, RHS) are obtained in a similar way.

4. Compute the row 4 (Cj - Zj) by subtracting each element in the Zj row from each element in the Cj (top) row.

5. If all elements of the RHS (row 1, 2) are NON-NEGATIVE then go to 5''.
else go to 5'.

5'. For each rows (1 and 2) compute the ratios RHS/x, where x runs elements from columns
x1, x2, x3, x4, s1, s2. We seek the MINIMAL POSITIVE number (so we can compute only ratios with numerator and denominator are of the same sign).
Row 1:
column X2: (-1)/(-2)=0,5; column X3: (-1)/(-3)=0,3333(3); column X4: (-1)/(-1)=1
Row 2: all elements are zero

MINIMAL POSITIVE element is 0,33(3) from X3 column. Hence, 0,33(3) (mark green) is the leading element, X3 is the leading column, row 1 is the leading row. Go to 7.

7. Compute the rows 5 and 6: divide the leading row by the leading element and transform the leading column into identity column. Don't forget convert the RHS.

Let us make the next iteration step. In the previous step we compute the rows 5 and 6. Now all the RHS elements (0,33 and 0,33) are non-negative, hence go to 5".

5". We considered this case in the previous example. First, find the
LARGEST STRICTLY POSITIVE element in the (Cj-Zj) row (if there is not then go to the end of algorithm). This element is 2 from X4 column, row 8. So, X4 is new leading column.

6. Compute the ratios RHS/leading column for each row and find the MINIMAL POSITIVE element. This element gives us leading row. Intersection the leading row and the leading column give us leading element.
Row 5, Column X4: 0,33/0,33 = 1;
Row 6, Column X4: 0,33/1,33 = 0,25.
So, 1.33 (mark green) is new leading element. Go to 7.

Repeat iterations until (if the optimal solution exists) we can't find strictly positive leading element at the step 5' or 5" and 6.

In our example:
We form rows 9, 10, 11 and test RHS (rows 9, 10) for non-negativity (step 5). 0,25 and 0,25 are non-negative, hence, go to the step 5". 3,50 is the largest strictly positive number, but we can't find positive elements in this leading row (step 6). Hence, we have find the optimal solution:
X3 = 0,25;
X4 = 0,25;
Objective function value = -3,50 (mark red)

Posted by mazoo at 1:47 PM | Comments (4) | TrackBack

March 25, 2005

What is a learning curve?

This is a simple explanation of learning curve theory related to the comments on "Equation of a learning curve".

Learning curve - a graphic representation of the fact that, in repetitive activities, there is a constant and predictable rate of productivity improvement each time the number of units produced is doubled. Therefore, the learning curve is function that shows how labor-hours per unit decline as units of production increase.

There are two assumptions to estimate declining rate of labor-hours per unit (and hence labor-cost per unit):

First assumption:
1. Cumulative average time per unit is reduced each time production doubled by a certain percentage.
If it takes 100 hours to produce 1 unit, then (for 80% learning curve) cumulative average time per unit for producing 2 units is 100-20%=80 hours. Then total time to produce 2 units is 80*2=160 hours. Hence, the second unit requires only 160-100=60 hours.

Example 1:
Units         Total labor cost
10                 $120
20                 $192

Let's find the learning rate:
Cumulative average cost per unit for 10 units is 120/10=12;
Cumulative average cost per unit for 20 units is 192/20=9.6;

Let learning rate is x:
12*x=9.6
x=0.8 (or 80%)
Hence, this company experienced 80% learning curve according first assumption.

Second assumption:

2. Incremental unit time (time to produce the last unit) is reduced by a certain percentage when production doubled. If it takes 100 hours to produce 1 unit, then (for 80% learning curve) the time to produce the second unit is 100-20%=80 hours. Then total time to produce 2 units is 100+80=180 hours.

Example 2:
Units         Total labor cost
10                 $120
20                 $192

Let's find the learning rate:

Labor cost to produce the first bid of 10 units is 120;
Labor cost to produce the second bid of 10 units is 192-120=72;
Let learning rate is x:
120*x=72
x=0.6 (60%)
Hence, this company experienced 60% learning curve according second assumption.

Posted by mazoo at 1:10 PM | Comments (1)

March 21, 2005

Simple Linear Regression Equation Part 2

Previous Part

In the Part 1, we have received linear regression equation for the following problem:

The firm has decided to use linear regression by employing the equation y = a + bx for the annual sales. The prior years's data regarding sales and advertising expenditures are here.

Linear regression equation is

y = f(x) = 4.2 + 0.31x

Let y' is the mean of the observed data points, i.e.

y' = (y1 + y2 + y3 + y4 + y5)/5

1. The variance of the estimate S2 is equal:
variance_of_estimate.gif

where n = 5 is the number of observations, k = 1 is the number of independent variables in the linear regression. n-k-1 is calling the number of degrees of freedom.

Hence, S2 = 2.624

The standard error of estimate is equal square root of the variance of the estimate and is equal S. Hence, standard error of estimate S = 1.62

2. Variance of constant coefficient a is equal Sa2:

variance_of_a.gif

Sa2 = 6.216

Hence, Sa - standard error of a is equal square root of the variance of a and is equal Sa = 2.49

3. Similarly, variance of variable coefficient b is equal Sb2:

variance_of_b.gif

Sb2 = 0.002332

Hence, Sb - standard error of b is equal square root of the variance of b and is equal Sb = 0.0483

4. Coefficient of determination r2:
determination.gif

r2 = 0.9328

r - coefficient of correlation, r = 0.9658

The coefficient of determination r2 may be interpreted as the percent of variation in the depended variable "explained" by the variation in the independent variable. Hence, the variance in annual sales is 93.28% of the variance in advertising cost.

5. Confidence interval for b (similarly for other parameters):
interval.gif

If we want to receive 90% confidence interval for b, then we need the t-value from Student's t-table: t(5-1-1,(1-0.90)/2) = t(3 , 0.05) =2.35

Hence, management may be 90% confident that b will be in the range of:

(0.1965; 0.4235)

The two-third confidence level falls within one standard deviation (approximately) from the mean. So, if advertising expenditures will be $40 000 (40 thousands) management can be two-third confident that the annual sales will be in the range of:

( 4.2+0.31*40 – 1.62; 4.2+0.31*40 + 1.62)
or
(14.98; 18.22)
or
($14 980 000; $18 220 000).


Previous part

Posted by mazoo at 9:25 PM | Comments (1)

March 3, 2005

Simple Linear Regression Equation Part 1

Next Part
Let us consider the example of linear regression problem solving. We want to receive linear regression formula, the values of standard errors for estimate and coefficients, coefficient of determination, confidence interval and other parameters from the statistical data.

The firm has decided to use linear regression by employing the equation y = a + bx for the annual sales. The prior years's data regarding sales and advertising expenditures are as follows:

Sales($000,000s) (yi) Advertising($000s) (xi)
2871
1431
1950
2160
1635

1. Let us find linear regression equation from using least squares computations.
The following equations can be used to determine the equation for the least squares regression line (in the form of y = a + bx):

regression_equation.gif

In our case n=5 (the number of observations) and:

Regression_sums.gif

Substituting into the two equations gives:
98 = 5a + 247b
5192 = 247a + 13327b

Solving for the two unknowns gives a=4.2 and b=0.31, so expected sales equal 4.2 plus 0.31 times the advertising expenditure,

y = 4.2 + 0.31x

Hence, if the advertising expenditures in the next year is $40 000, the expected sales will be $16 600 000.

The observations are graphed as follows:

Resression.gif

a is called as constant coefficient of linear regression equation and b is called as variable coefficient of linear regression equation.

Therefore, in the Part 1 we have derived:
- the formula of linear regression equation,
- constant and variable coefficients of linear regression equation
from the prior years's observations.

In the Part 2, we'll derive:
- standard error for estimate sales,
- standard error of a,
- standard error of b,
- coefficient of correlation (covariance) r,
- coefficient of determination r2,
- confidence intervals.

Next (Part 2).

Posted by mazoo at 8:02 PM | Comments (3)

February 24, 2005

Equation of a learning curve

Learning curves reflect the increased rate at which people perform task as they gain experience. Ordinarily, the curve is expressed as percentage of reduced time to complete a task for each doubling of cumulative production.

Common assumption is that the cumulative average time per unit is reduced by a certain percentage each time production doubles.

Let's consider 75% learning curve:

Cumulative number of tasksCumulative average time per unitTotal time
80564 480
16042 (56*0,75)6 720
32031,5 (42*0,75)10 080
64023,625 (31,5*0,75)15 120

If the average time for 80 units is 56 hours per unit, the total time is 4 480. At an average time of 42 hours for 160 units, the total time is 6 720 hours. Hence the additional 80 units (from 81 to 160) required only 2 240 hours, or 2 240/80 = 28 hours per unit.

From the table above we are able to get learning curve formula. It shows how total time depends on total output:

F(x) = 0.75^( ln(x/80) /ln (2) ) * 56 * x, where

0,75 - learning curve percentage rate divided by 100;
80 - the first lot of units;
x/80 - the number of lots;
ln(x/80) /ln (2) - logarithm of (x/80) to base 2;
56 - the average time for the first 80 units.

Learning-curve.gif

The alternative assumption is that incremental unit time (time to produce the last unit) is reduced when production doubled. But it occurs more rarely than the common assumption in the test prep questions.

Posted by mazoo at 3:46 PM | Comments (5)

Example of using simplex algorithm

Let's consider a simple example of solving linear programming problem by using the simplex method.

Let A company manufactures small and large garden benches in two departments, the Machining Department and the Polishing Department. Small bench requires 2 hours in the Machining Department and 3 hours in the Polishing Department. It takes 4 hours to machine large bench and 3 hours to polish. The available time for processing the two models is 100 hours a week in the Machining Department and 90 hours a week in the Polishing Department. The contribution margin expected is $5 for small bench and $7 for large bench. Let's find the optimal mix of products A company should produce to maximize total contribution margin.

Let X is quantity of small benches and Y is quantity of large benches. Let's find such X, Y that:

5X + 7Y - > max - objective function;
2X + 4Y < = 100 - constraints
3X + 3Y < = 90
X , Y > = 0

Let S1, S2 >= 0 are slack variables and then constraint transforms from inequality expressions to equality form. And linear programming problem may be restated as follows:

5X + 7Y +0S1 + 0S2 - > max
2X + 4Y +1S1 + 0S2 = 100
3X + 3Y +0S1 + 1S2 = 90,
X , Y, S1, S2 > = 0

Now we can construct the initial simplex tableau:
Simplex.jpg

1. The Cj row consists of the coefficients from the objective function. 1 and 2 rows consist of the coefficients from the constraint equalities. The values 100 and 90 in the right-hand side (RHS) column come from the right-hand side of the constraint equations. Those variables that form an identity matrix are basic variables. S1 and S2 are the basic variables in this case.

2. The CB column consists of payoff coefficients of the basic variables in profit-maximization problem (objective function), i.e. 0 for S1 (row 1) and 0 for S2 (row 2).

3. The first element of the Zj row (in X column) is the sum of the products of multiplying each element in the CB column by each element in the X column. 0 (row 1, column CB) * 2 (row 1,column X) + 0 (row 2, column CB) * 3 (row 2,column X) . The subsequent elements of the Zj row (columns Y, S1, S2, RHS) are obtained in a similar way.

4. Row 4 (Cj - Zj) is obtained by subtracting each element in the Zj row from each element in the Cj (top) row.

5. Find in row (Cj-Zj) LARGEST STRICTLY POSITIVE element. Corresponding column is leading column. From row 4 we choose element 7 and the
leading column is Y (rows 1, 2) in our case.

6. Find in the leading column MINIMAL POSITIVE element from the elements are obtained from the formula RHS/leading column. This element gives us leading row. Intersection the leading row and the leading column give us leading element. In our case we choose between 100/4=25 and 90/3=30 and the leading row is row 1. Hence the leading element is 4.

7. The rows 5 is obtained by dividing leading row by leading element and row 6 is obtained by subtracting 3*(row 5) from row 2. Hence we have received an identity leading column. Hence the new basic variables are Y and S2. Go to step 2.

Repeat iterations until there are no strictly positive elements in the (Cj-Zj) row (if the optimal solution exists).

If the optimal solution exist then the element in row Zj (row 11) column RHS is objective function value in the optimal solution point. And (20, 10) from rows 9, 10 column RHS is optimal mix of products.

Hence, maximum profit margin is 190 and A company should produce 10 small benches and 20 large benches.

We have considered the solution of standard maximization problem with non-negative right-hand side of the constraints using the simplex method. The more general case of linear programming (LP) problem with the orbitrary right-hand side of the constraints we consider in the example #2.

Posted by mazoo at 1:34 PM | Comments (5) | TrackBack