<< Chapter < Page | Chapter >> Page > |
When we take the expected value , or average, of a random process , we measure several important characteristics about how the process behavesin general. This proves to be a very important observation. However, suppose we have several random processes measuringdifferent aspects of a system. The relationship between these different processes will also be an important observation. Thecovariance and correlation are two important tools in finding these relationships. Below we will go into more details as towhat these words mean and how these tools are helpful. Note that much of the following discussions refer to just randomvariables, but keep in mind that these variables can represent random signals or random processes.
To begin with, when dealing with more than one random process, it should be obvious that it would be nice to be able to havea number that could quickly give us an idea of how similar the processes are. To do this, we use the covariance , which is analogous to the variance of a single variable.
Mathematically, covariance is often written as and is defined as
For anyone who has any kind of statistical background, you should be able to see that the idea of dependence/independenceamong variables and signals plays an important role when dealing with random processes. Because of this, the correlation of two variables provides us with a measure of how the two variables affect one another.
It is often useful to express the correlation of random variables with a range of numbers, like a percentage. For agiven set of variables, we use the correlation coefficient to give us the linear relationship between our variables. The correlation coefficient of twovariables is defined in terms of their covariance and standard deviations , denoted by , as seen below
Now let us take just a second to look at a simple example that involves calculating the covariance and correlation of twosets of random numbers. We are given the following data sets: To begin with, for the covariance we will need to find the expected value , or mean, of and . Next we will solve for the standard deviations of our two setsusing the formula below (for a review click here ). Now we can finally calculate the covariance using one of the two formulas found above. Since we calculated the threemeans, we will use that formula since it will be much simpler. And for our last calculation, we will solve for thecorrelation coefficient, .
The above example can be easily calculated using Matlab. Below I have included the code to find all of the valuesabove.
x = [3 1 6 3 4];
y = [1 5 3 4 3];
mx = mean(x)
my = mean(y)
mxy = mean(x.*y)
% Standard Dev. from built-in Matlab Functions
std(x,1)
std(y,1)
% Standard Dev. from Equation Above (same result as std(?,1))
sqrt( 1/5 * sum((x-mx).^2))
sqrt( 1/5 * sum((y-my).^2))
cov(x,y,1)
corrcoef(x,y)
Notification Switch
Would you like to follow the 'Intro to digital signal processing' conversation and receive update notifications?