Академический Документы
Профессиональный Документы
Культура Документы
ij
ij
ij
ij
var(yi) =
cov(yi, yj) = 0
Proof: The first statement results from Theorem 11 as explained above. Since the
column vectors are orthonormal, =
= 0 if j i and
= 1 if j = i. Thus
i
Property 2:
Proof: By definition of the covariance matrix, the main diagonal of contains the
values
, ,
, and so trace() =
Eigenvectors, trace() =
=
, but by Property 1, this is also the total variance for Y.
Thus the portion of the total variance (of X or Y) explained by the ith principal
component yi is /
ij
ij
ij
cov(yi, yj) = 0
The sample covariance matrix S is shown in Figure 3 and can be calculated directly as
=MMULT(TRANSPOSE(B4:J123-B126:J126),B4:J123-B126;J126)/
(COUNT(B4:B123)-1)
Here B4:J123 is the range containing all the evaluation scores and B126:J126 is the
range containing the means for each criterion. Alternatively we can simply use the
Real Statistics supplemental function COV(B4:J123) to produce the same result.
In practice, we usually prefer to standardize the sample scores. This will make the
weights of the nine criteria equal. This is equivalent to using the correlation
matrix. Let R = [r ] where r is the correlation between x and x , i.e.
ij
ij
The sample correlation matrix R is shown in Figure 4 and can be calculated directly
as
=MMULT(TRANSPOSE((B4:J123-B126:J126)/B127:J127),(B4:J123B126;J126)/B127:J127)/(COUNT(B4:B123)-1)
Here B127:J127 is the range containing the standard deviations for each criterion.
Alternatively we can simply use the Real Statistics supplemental function
CORR(B4:J123) to produce the same result.
Note that all the values on the main diagonal are 1, as we would expect since the
variances have been standardized. We next calculate the eigenvalues for the
correlation matrix using the eVECTORS(M4:U12) supplemental function, as
described in Linear Algebra Background. The result appears in range M18:U27 of
Figure 5.
The first row in Figure 5 contains the eigenvalues for the correlation matrix in Figure
4. Below each eigenvalue is a corresponding unit eigenvector. E.g. the largest
eigenvalue is = 2.880437. Corresponding to this eigenvalue is the 9 1 column
eigenvector B whose elements are 0.108673, -0.41156, etc.
As we described above, coefficients of the eigenvectors serve as the regression
coefficients of the 9 principal components. For example the first principal
component can be expressed by
1
i.e.
Thus for any set of scores (for the x ) you can calculate each of the corresponding
principal components. Keep in mind that you need to standardize the values of
the x first since this is how the correlation matrix was obtained. For the first sample
j
(row 4 of Figure 1), we can calculate the nine principal components using the matrix
equation Y = BX as shown in Figure 6.
The values in column M are simply the eigenvalues listed in the first row of Figure 5,
with cell M41 containing the formula =SUM(M32:M40) and producing the value 9 as
expected. Each cell in column N contains the percentage of the variance accounted
for by the corresponding eigenvalue. E.g. cell N32 contains the formula =M32/M41,
and so we see that 32% of the total variance is accounted for by the largest
eigenvalue. Column O simply contains the cummulative weights, and so we see that
the first four eigenvalues accounts for 72.3% of the variance.
Using Excels charting capability, we can plot the values in column N of Figure 7 to
obtain a graphical representation, called a scree plot.
We decide to retain the first four eigenvalues, which explain 72.3% of the variance. In
section Basic Concepts of Factor Analysis we will explain in more detail how to
determine how many eigenvalues to retain. The portion of the Figure 5 that refers to
these eigenvalues is shown in Figure 9. Since all but the Expect value for PC1 is
negative, we first decide to negate all the values. This is not a problem since the
negative of a unit eigenvector is also a unit eigenvector.
Those values that are sufficiently large, i.e. the values that show a high correlation
between the principal components and the (standardized) original variables, are
highlighted. We use a threshold of 0.4 for this purpose.
This is done by highlighting the range R32:U40 and selecting Home > Styles|
Conditional Formatting and then choosing Highlight Cell Rules > Greater
Than and inserting the value .4 and then selecting Home > Styles|Conditional
Formatting and then choosing Highlight Cell Rules > Less Than and inserting
the value -.4.
Note that Entertainment, Communications, Charisma and Passion are highly
correlated with PC1, Motivation and Caring are highly correlated with PC3 and
Expertise is highly correlated with PC4. Also Expectation is highly positively
correlated with PC2 while Friendly is negatively correlated with PC2.
Ideally we would like to see that each variable is highly correlated with only one
principal component. As we can see form Figure 9, this is the case in our example.
Usually this is not the case, however, and we will show what to do about this in
the Basic Concepts of Factor Analysis when we discuss rotation in Factor Analysis.
In our analysis we retain 4 of the 9 principal factors. As noted previously, each of the
principal components can be calculated by
In Figure 10 we show how this is done using the four principal components that we
calculated from the first sample in Figure 6. B (range AN74;AQ82) is the reduced set
of coefficients (Figure 9), Y (range AS74:AS77) are the principal components as
calculated in Figure 6, X are the estimated standardized values for the first sample
(range AU74:AU82) using the formula =MMULT(AN74:AQ82,AS74:AS77) and
finally X are the estimated scores in the first sample (range AW74:AW82) using the
formula =AU74:AU82*TRANSPOSE(B127:J127)+TRANSPOSE(B126:J126).
As you can see the values for X in Figure 10 are similar, but not exactly the same as
the values for X in Figure 6, demonstrating both the effectiveness as well as the
limitations of the reduced principal component model (at least for this sample data).
Covariance
From Wikipedia, the free encyclopedia
This article is about the measure of linear relation between random variables. For other uses,
see Covariance (disambiguation).
In probability theory and statistics, covariance is a measure of how much two random
variables change together. If the greater values of one variable mainly correspond with the
greater values of the other variable, and the same holds for the smaller values, i.e., the variables
tend to show similar behavior, the covariance is positive. [1] In the opposite case, when the greater
values of one variable mainly correspond to the smaller values of the other, i.e., the variables
tend to show opposite behavior, the covariance is negative. The sign of the covariance therefore
shows the tendency in the linear relationship between the variables. The magnitude of the
covariance is not easy to interpret. The normalized version of the covariance, the correlation
coefficient, however, shows by its magnitude the strength of the linear relation.
A distinction must be made between (1) the covariance of two random variables, which is
a population parameter that can be seen as a property of the joint probability distribution, and (2)
the sample covariance, which serves as an estimated value of the parameter.
Contents
[hide]
1 Definition
2 Properties
o
4 Comments
5 Applications
o
6 See also
7 References
8 External links
Definition[edit]
The covariance between two jointly distributed real-valued random variables X and Y with
finite second moments is defined as[2]
where E[X] is the expected value of X, also known as the mean of X. By using the linearity
property of expectations, this can be simplified to
However, when
, this last equation is prone to catastrophic
cancellation when computed with floating point arithmetic and thus should be avoided in
computer programs when the data have not been centered before.[3]
For a vector
of m jointly distributed random
variables with finite second moments, its covariance matrix is defined as
Properties[edit]
Variance is a special case of the covariance when the two variables are
identical:
For a sequence X1, ..., Xn of random variables, and constants a1, ..., an,
we have
let
vector
, and
is:
.
In this case, the relationship between Y and X is nonlinear, while correlation and covariance are measures
of linear dependence between two variables. This
example shows that if two variables are uncorrelated,
that does not in general imply that they are
independent. However, if two variables are jointly
normally distributed (but not if they are
merelyindividually normally distributed),
uncorrelatedness does imply independence.
Then we have
,
which is an estimate of the covariance
between variable j and variable k.
The sample mean and the sample
covariance matrix are unbiased
estimates of the mean and
the covariance matrix of the random
vector
, a row vector whose jth
element (j = 1, ..., K) is one of the
random variables. The reason the
sample covariance matrix has
in the denominator rather than
essentially that the population
mean
is
. If
Comments[edit]
The covariance is sometimes
called a measure of "linear
dependence" between the two
random variables. That does not
mean the same thing as in the
context of linear algebra(see linear
dependence). When the
covariance is normalized, one
obtains the correlation coefficient.
From it, one can obtain
the Pearson coefficient, which
gives the goodness of the fit for
the best possible linear function
describing the relation between the
variables. In this sense covariance
is a linear gauge of dependence.
Applications[edit]
In genetics and molecular
biology[edit]
Covariance is an important
measure in biology. Certain
sequences of DNA are conserved
more than others among species,
and thus to study secondary and
tertiary structures of proteins, or of
RNA structures, sequences are
compared in closely related
species. If sequence changes are
found or no changes at all are
found in noncoding RNA (such as
microRNA), sequences are found
to be necessary for common
structural motifs, such as an RNA
loop.
In financial economics[edit]
Covariances play a key role
in financial economics, especially
in portfolio theory and in the capital
asset pricing model. Covariances
among various assets' returns are
used to determine, under certain
assumptions, the relative amounts
of different assets that investors
should (in a normative analysis) or
are predicted to (in a positive
analysis) choose to hold in a
context of diversification.
In meteorological data
assimilation[edit]
The covariance matrix is important
in estimating the initial conditions
required for running weather
forecast models.