Calculating Portfolio Standard Deviations On the TI 84+ Calculator

Experimental AI-generated Podcast Overview of This Article
An image of the TI 84 Financial Calculator
TI 84 Financial Calculator

This tutorial shows how to use the matrix algebra functions on a TI 83 or TI 84 calculator to calculate the standard deviation of a portfolio with more than two securities. This can be a challenge when there are more than two securities in the portfolio, but the matrix functions make it straightforward.

Calculating the standard deviation ($\large \sigma_{_P}$) of a two-security portfolio is quite straightforward using the equation:

$$\sigma_{_P}=\sqrt{w^2_1\,\sigma^2_{1}+w^2_2\,\sigma^2_{2}+2\,\sigma_{1,2}\,w_1\,w_2 } \label{portstd}\tag{1}$$

Where $\large w_{_1}$ and $\large w_{_2}$ are the respective weights (must sum to 100%), and $\large \sigma_{_{1,2}}$ is the covariance between the two securities.

Alternatively, we can specify the equation in a way that allows for any number of securities:

$$\sigma_{_P}=\sqrt{\,\sum\limits_{i=1}^N\sum\limits_{j=1}^N\sigma_{i,j}\,w_i\,w_j} \label{eq2}\tag{2}$$

Unfortunately, when there are more than two securities in the portfolio equation $\ref{portstd}$ quickly grows very large:

$$\text{Number of Terms}=\frac{N(N+1)}{2}$$

The table below shows how quickly the number of terms in equation $\ref{portstd}$ grows as more securities are added to the portfolio.

SecuritiesNumber of Terms
11
23
36
410
515
621
728
836
945
1055
1005,050
500125,250
1,000500,500
Number of Terms as a Function of the Number of Securities

Clearly it would be a chore, even with a calculator or spreadsheet, to type in the equation with more than two or three securities in the portfolio. Fortunately, there is a better way. This tutorial will show how to calculate the portfolio standard deviation using the matrix algebra functions in any of the calculators in the Texas Instruments TI 83/84 family.

The Data

Imagine that we have a portfolio that contains 4 securities: Google (GOOG), Ford Motor (F), The Home Depot (HD), and Hovnanian Enterprises (HOV). To calculate the portfolio standard deviation, we need to know the weights of each security, the standard deviation of each security, and the variance/covariance matrix. The data given below were calculated from 5 years of monthly returns taken from Morningstar Direct as of 20 October 2013 (standard deviations and covariances are population statistics):

GOOGFHDHOV
Average Monthly Return1.38%4.04%2.16%3.17%
Standard Deviation8.16%20.91%6.43%28.36%
Portfolio Weights30%20%28%22%
Average Returns, Standard Deviations, and Weights
GOOGFHDHOV
GOOG0.006650.004290.002000.00470
F0.004290.043720.005910.03206
HD0.002000.005910.004130.01047
HOV0.004700.032060.010470.08041
Variance/Covariance Matrix

The Calculations

We will use matrix algebra functions to do the calculation. We can restate equation $\ref{eq2}$ in matrix terms:

$$\sigma_{_P}=\sqrt{W^T\,V\,W}$$

Where $W$ is an $N\times 1$ column vector of security weights, $W^T$ is the transpose of the weight vector, and $V$ is the $N\times N$ variance/covariance matrix.

Before doing the calculation, we must first create the matrices in the calculator. On your TI 83 or 84 press 2nd and then x-1 to enter the matrix menu shown below:

A screenshot of the TI 83 or TI 84 choose matrix screen
The Choose Matrix Screen

Scroll to the right and choose EDIT, and then select matrix [A] by pressing 1. Make the size of the matrix $4\times 1$ and enter the weights from the table as shown below:

A screenshot of the TI 83 or TI 84 Edit Matrix screen with the weights filled in.
The Edit Matrix Screen with Weights Filled In

Next, press 2nd and then x-1 to return to the matrix menu. Create a $4\times 4$ matrix [B] using the data from the variance/covariance table as shown below:

A screenshot of the TI 83 or TI 84 Edit Matrix screen with the variance/covariance matrix filled in
The Edit Matrix Screen with the Variance/Covariance Matrix Filled In

Note that the image above shows only the first three columns, but they will scroll automatically as you enter the data. You can use the arrow keys to scroll around the matrix if necessary.

The data is now ready, so press 2nd and then MODE to return to the normal screen. To enter the equation, you will need to repeatedly enter the matrix menu and select a matrix or function. First, press 2nd and then x-1 to return to the matrix menu and press ENTER to select matrix [A] (the weights vector), which will now appear on the screen. Return again to the matrix menu but scroll to the right to select MATH and then press 2 to transpose [A].

A screenshot of the TI 83 or TI 84 Matrix Math menu
Transpose Selected in the MATH Menu

Press the X key to multiply, and then select matrix [B] (the variance/covariance matrix). Press the X key again, and then select matrix [A] again. (Note: You don’t actually have to place an X between the matrices, but it does make clear what we are doing for this tutorial.) Now press ENTER to solve the equation and your screen should look like the one below:

A screenshot of the TI 83 or TI 84 showing the matrix formula and the result
The Matrix Formula and the Result of the Calculation

That tells us that the variance of the portfolio is 0.01281, so we need to take the square root to get the standard deviation. Note that the answer is provided as a $1\times 1$ matrix, and we need to extract that scalar value. We can get at the scalar value by using matrix indexing. Specifically, ANS(1,1) will return 0.01281, and we can then take the square root. Even better, we can take the square root directly as shown in the following image:

A screenshot of the TI 83 or TI 84 showing the calculation of the standard deviation from the result of the matrix calculation
Calculating the Standard Deviation After Calculating the Variance Using Matrix Math

The standard deviation of our portfolio is 11.317% per month.

I hope that you have found this tutorial to be useful.

Share on Social Media: