Professional Documents
Culture Documents
3
Stats 848.3
Phone: 966-6096
MWF
Lectures:
12:30am - 1:20pm Arts 104
1. Cooley, W.W., and Lohnes P.R. (1962). Multivariate Procedures for the
Behavioural Sciences, Wiley, New York.
Independent variables
Continuous & ?? ?? ??
Categorical
Multivariate Techniques
Multivariate Techniques can be classified as
follows:
1. Techniques that are direct analogues of
univariate procedures.
• There are univariate techniques that are then
generalized to the multivariate situarion
• e. g. The two independent sample t test,
generalized to Hotelling’s T2 test
• ANOVA (Analysis of Variance) generalized to
MANOVA (Multivariate Analysis of Variance)
2. Techniques that are purely multivariate
procedures.
• Correlation, Partial correlation, Multiple
correlation, Canonical Correlation
• Principle component Analysis, Factor Analysis
- These are techniques for studying complicated
correlation structure amongst a collection of variables
3. Techniques for which a univariate
procedures could exist but these techniques
become much more interesting in the
multivariate setting.
• Cluster Analysis and Classification
- Here we try to identify subpopulations from the data
• Discriminant Analysis
- In Discriminant Analysis, we attempt to use a
collection of variables to identify the unknown
population for which a case is a member
An Example:
70
60
50
40
30
Linkage Distance
20
10
0
C ases
Pessimistic
1
Religious Non-religious
0
-4 -3 -2 -1 0 1 2 3 4 5 6
F1 (Discriminant function 1)
vn
v1
v
v 2
vn
v1
v v2
v3
v2
v1
Matrix Operations
Addition
Let A = (aij) and B = (bij) denote two n × m
matrices Then the sum, A + B, is the matrix
a11 b11 a12 b12 a1n b1n
a b a22 b22 a2 n b2 n
A B aij bij 21 21
am1 bm1 am 2 bm 2 amn bmn
cam1 cam 2 camn
Addition for vectors
v3
v1 w1
v w v2 w2
w1
v3 w3
w w2
w3
v1
v v2
v2
v3
v1
Scalar Multiplication for vectors
v3
cv1
cv cv2
cv3
v1
v v2
v3
v2
v1
Matrix multiplication
Let A = (aij) denote an n × m matrix and B = (bjl)
denote an m × k matrix
Then the n × k matrix C = (cil) where
m
cil aij b jl
j 1
is an n × 1 vector A
w3
v3
v1
v v2
v3
w2
v2 w1
w w2 Av
w3
w1
v1
Definition
An n × n identity matrix, I, is the square matrix
1 0 0
0 1 0
I In
0 0 1
Note:
1. AI = A
2. IA = A.
Definition (The inverse of an n × n matrix)
Let A denote the n × n matrix
a11 a12 a1n
a a a
21 22 2n
A aij
an1 an 2 ann
Let B denote an n × n matrix such that
AB = BA = I,
If the matrix B exists then A is called invertible
Also B is called the inverse of A and is denoted by
A-1
The Woodbury Theorem
1
A BCD
1
A A B C DA B DA1
1 1 1 1
1 1 1
1
1 1
A A B C DA B DA1 A BCD
A A A B C DA B DA1 A
1 1 1 1
1
A BCD A B C DA B DA BCD
1 1 1 1 1
1
I A B C DA B D
1 1 1
1
A BCD A B C DA B DA1BCD
1 1 1 1
I A1 BCD
1
A B C DA B I DA1BC D
1 1 1
I A1 BCD
1
A B C DA B C DA B CD
1
1
1 1 1
1 1
I A BCD A BCD I
The Woodbury theorem can be used to find the
inverse of some pattern matrices:
Example: Find the inverse of the n × n matrix
b a a 1 0 0 1 1 1
a b a 0 1
0 1
1 1
b a a
a a b 0 0 1 1 1 1
1
1
b a I a 1 1 1 A BCD
1
where
1
1
A b a I B C a D 1 1 1
11
1
1
1 1
1
C
hence A I
a
ba
and 1
1
1 1
C DA B 1 1 1
1 1
I
a b a
1
1 n b a an b a n 1
a b a a b a a b a
Thus
a b a
1
C DA B
1 1
b a n 1
1
1 a b a
1 1 1
I I 1 1 1 I
ba b a b a n 1 ba
1 1
1
1 a 1 1 1
I
ba b a b a n 1
1
1
Thus b a a
a b a
a a b
1 0 0 1 1 1
0 1 0 1 1 1
1 a
b a b a b a n 1
0 0 1 1 1 1
c d d
d
c d
d d c
where
a
d
b a b a n 1
1 a
and c
b a b a b a n 1
1 a 1 b a n 2
1
b a b a n 1 b a b a n 1
Note: for n = 2
a a
d 2
b a b a b a2
1 b b
and c 2
b a b a b a2
1
b a 1 b a
Thus 2 a b
a b b a 2
Also
1
b a a b a a b a a c d d
a b a a b a a b a d c d
a a b a a b a a b d d c
bc n 1 ad bd ac (n 2)ad bd ac (n 2)ad
bd ac (n 2)ad bc n 1 ad bd ac (n 2)ad
bd ac (n 2)ad bd ac (n 2)ad bc n 1 ad
Now
a
d
b a b a n 1
1 b a n 2
and c
b a b a n 1
bc n 1 ad
b b a n 2 n 1 a 2
b a b a n 1 b a b a n 1
b b a n 2 n 1 a 2
b a b a n 1
b 2 ab n 2 n 1 a 2
1
b ab n 2 n 1 a
2 2
and
bd ac (n 2)ad
a b a n 2 b (n 2)a a
b a b a n 1 b a b a n 1
0
Then
A11 A12 B11 B12
A B
A21 A22 B21 B22
Then
A11 A12 B11 B12
A B
A21 A22 B21 B22
Ip 0
p n p
0 I n p
n p p
Hence
A11 B11 A12 B21 I 1
A11 B12 A12 B22 0 2
A21 B11 A22 B21 0 3
A21 B12 A22 B22 I 4
1 1
From (1) A11 A12 B B B
21 11 11
From (3)
A221 A21 B21B111 0 or B21B111 A221 A21
1 1
Hence A11 A12 A A21 B
22 11
1
or B11 A11 A12 A A21
1
22
1
1
11
1
11 12
1
A A A A22 A A A A21 A11 1
21 11 12
similarly
1
B12 A A B22 A A A22 A A A
1
11 12
1
11 12
1
21 11 12
Summarizing
A11
p A12
Let A
nn n p A21 A22
p n p
B11 p B12
Suppose that A-1 = B
n p B21 B22
p n p
then
1 1
B11 A11 A12 A A21 A A A A22 A A A A21 A111
1
22
1
11
1
11 12
1
21 11 12
1 1
B22 A22 A A A A A A21 A11 A12 A A21 A12 A221
1
21 11 12
1
22
1
22
1
22
1
B12 A A B22 A A A22 A21 A111 A12
1
11 12
1
11 12
1
B21 A A21B11 A A21 A11 A12 A A21
1
22
1
22
1
22
Example
a 0 b 0
Let
aI
p bI 0 a 0 b
A
p cI dI c 0 d 0
p p
0 c 0 d
p B11 B12
Find A-1 = B
n p B21 B22
p n p
A11 aI , A12 bI , A21 cI , A22 dI
1
B11 aI bI I cI a bcd I
1
1
d
d
ad bc I
B22 dI cI I bI d bca I
1 1
1
a
a
ad bc I
1 ad bc I
d
ad bbc I
hence A c
ad bc I I
a
ad bc
The transpose of a matrix
Consider the n × m matrix, A
a11 a12 a1n
a a22 a2 n
A aij 21
am1 am 2 amn
then the m × n matrix, A(also denoted by AT)
a11 a21 am1
a a22 am 2
A a ji 12
am1 am 2 amn
A 1
A 1
The trace and the determinant of a
square matrix
Let A denote then n × n matrix
a11 a12 a1n
a
a22 a2 n
A aij 21
an1 an 2 ann
Then n
tr A aii
i 1
a11 a12 a1n
also a
21 a22 a2 n
A det the determinant of A
an1 an 2 ann
n
aij Aij
j 1
a11 a12
det a11a22 a12 a21
a21 a22
Some properties
1. I 1, tr I n
2. AB A B , tr AB tr BA
1 1
3. A
A
A11 A A
A12 22 11 12 22 A21
A A 1
4. A
A21 A22 A11 A22 A21 A111 A12
A22 A11 if A12 0 or A21 0
Some additional Linear Algebra
Inner product of vectors
Let x and y denote two p × 1 vectors. Then.
y1
x y x1 , , x p x1 y1 x p y p
yp
p
xi yi
i 1
Note:
x x x1 x p the length of x
2 2
Let x and y denote two p × 1 vectors. Then.
x y
cos angle between x and y
x x y y
x
y
Note:
Let x and y denote two p × 1 vectors. Then.
x y
cos x y 0 xand
if between
0angle and y 2
x x y y
Thus if x y 0, then x and y are orthogonal.
x
y
2
Special Types of Matrices
1. Orthogonal matrices
– A matrix is orthogonal if P'P = PP' = I
– In this cases P-1=P' .
– Also the rows (columns) of P have length 1 and
are orthogonal to each other
Suppose P is an orthogonal matrix
then PP PP I
Let x and y denote p × 1 vectors.
Let u Px and v Py
Then u v Px Py xPPy xy
and uu Px Px xPPx xx
1 3
1
3
1
3
1
P 2
1
2
0
1 1 2 6
6 6
Special Types of Matrices
(continued)
for all x 0
– A symmetric matrix, A, is called positive semi
definite if:
x Ax 0
for all x 0
If the matrix A is positive definite then
the set of points, x , that satisfy x Ax c where c 0
are on the surface of an n dimensiona l ellipsoid
centered at the origin, 0.
Theorem The matrix A is positive definite if
A1 0, A2 0, A3 0, , An 0
where
a11 a12 a13
a11 a12
A1 a11 , A2 , A3 a12 a22 a23 ,
a12 a22 a13 a23 a33
a11 a12 a1n
a a a
and An A 12 22 2n
a
1n 2 na a nn
Special Types of Matrices
(continued)
3. Idempotent matrices
– A symmetric matrix, E, is called idempotent if:
EE E
– Idempotent matrices project vectors onto a linear
subspace
E Ex Ex
x
Ex
Definition
Let A be an n × n matrix
Let
x and be such that
Ax x with x 0
then is called an eigenvalue of A and
and x is called an eigenvector of A and
Note:
A I x 0
1
If A I 0 then x A I 0 0
thus A I 0
is the condition for an eigenvalue.
a11 a1n
A I det = 0
an1 ann
= polynomial of degree n in .
then A 1 x1 x1 n xn xn
proof
Note xixi 1 and xix j 0 if i j
x1 x1x1 x1xn
PP x1 , , xn
xn xn x1 xn xn
1 0
I P is called an
0 1 orthogonal matrix
therefore P P 1
and PP PP I .
1
thus x1
I PP x1 , , xn x1 x1 xn xn
xn
now Axi 1 xi and Axi xi i xi xi
Ax1 x1 Axn xn 1 x1 x1 n xn xn
A x1 x1 xn xn 1 x1 x1 n xn xn
A 1 x1 x1 n xn xn
Comment
The previous result is also true if the eigenvalues
are not distinct.
Namely if the matrix A is symmetric with
eigenvalues, 1, … , n, with corresponding
eigenvectors of unit length x1 , , xn
then A 1 x1 x1 n xn xn
1 0 x1
x1 , , xn PDP
0 n xn
An algorithm
for computing eigenvectors, eigenvalues of positive
definite matrices
m m m
and that A 1 x1 x1 2 x2 x2 n xn xn
m
m
m
1 x1 x1 x2 x2 xn xn 1 x1 x1
m 2 n m
1 1
Thus for large values of m
A a constant x1 x1
m
The algorithim
1.Compute powers of A - A2 , A4 , A8 , A16 , ...
2.Rescale (so that largest element is 1 (say))
3.Continue until there is no change, The
A c x1 x1
m
resulting matrix
will be
4.Find b so that A b b c x1 x1
m
1
5. Find x1 b and 1 using Ax1 1 x1
bb
To find x2 and 2 Note :
A 1 x1 x1 2 x2 x2 n xn xn
6. Repeat steps 1 to 5 with the above matrix to find
7. Continue to find
x2 and 2
x3 and 3 , x4 and 4 , , xn and n
Example
5 4 2
A= 4 10 1
2 1 2
1 2 3
eigenvalue 12.54461 3.589204 0.866182
eignvctr 0.496986 0.677344 0.542412
0.849957 -0.50594 -0.14698
0.174869 0.534074 -0.82716
Differentiation with respect to a
vector, matrix
Differentiation with respect to a vector
Let x denote a p × 1 vector. Let f x denote a
function of the components of x .
df x
dx1
df x
dx
df x
dx
p
Rules
1. Suppose f x ax a1 x1 an xn
f x
x1 a1
df x
then a
dx
f x a p
x
p
2. Suppose
f x xAx a11 x12 a pp x 2p
2a12 x1 x2 2a13 x1 x3 2a p 1, p x p 1 x p
f x
x1
df x
then 2 Ax
dx
f x
x
p
f x
i.e. 2ai1 x1 2aii xi 2aip x p
xi
Example
1. Determine when f x xAx bx c
is a maximum or minimum.
solution
df x 1
2 Ax b 0 or x 1
2 A b
dx
2. Determine when f x xAx is a maximum if
xx 1. Assume A is a positive definite matrix.
solution
let g x xAx 1 xx
is the Lagrange multiplier.
dg x
or Ax x
2 Ax 2 x 0
dx
This shows that x is an eigenvector of A.
and f x xAx xx
Thus the eigenvector of A associated with the largest eigenvalue, .
is
x
Differentiation with respect to a matrix
Let X denote a q × p matrix. Let f (X) denote a
function of the components of X then:
f X f X
x11 x1 p
df X f X
dX xij
f X f X
xq1 x pp
Example
Let X denote a p × p matrix. Let f (X) = ln |X|
d ln X 1
then X
dX
Solution
X xi1 X i1 xij X ij xip X ip
Solution p p
tr AX aik xki
k 1 k 1
tr AX
a ji
xij
Differentiation of a matrix of functions
Let U = (uij) denote a q × p matrix of functions
of x then:
du11 du1 p
dx dx
dU duij
dx dx
duq1 duqp
dx dx
Rules:
d aU dU
1. a
dx dx
d U V dU dV
2.
dx dx dx
d UV dU dV
3. V U
dx dx dx
4.
d U 1 U 1 dU 1
U
dx dx
Proof: 1
U U I
1
dU 1 dU
U U 0
dx dx p p
1
dU 1 dU
U U
dx dx
1
dU 1 dU
U U 1
dx dx
dtrAU dU
5. tr A
dx dx
p p
Proof: tr AU aik uki
i 1 k 1
tr AU p p
uki dU
aik tr A
x i 1 k 1 x dx
dtrAU 1 1 dU 1
6. tr AU U
dx dx
dtrAX 1
7.
dxij
ij 1
tr E X AX 1
kl kl kl 1 i k , j l
E (eij ) where eij
0 otherwise
Proof:
1
dtrAX
dxij
tr AX
1 dX
dx
1
X tr AX 1 E ij X 1
ij
ij 1
tr E X AX 1
dtrAX 1
8. X 1 AX 1
dX
The Generalized Inverse of a
matrix
Recall
B (denoted by A-1) is called the inverse of A if
AB = BA = I
Note: A- is unique
Proof: Let B1 and B2 satisfying
1. ABiA = A
2. BiABi = Bi
3. (ABi)' = ABi
4. (BiA)' = BiA
Hence
B1 = B1AB1 = B1AB2AB1 = B1 (AB2)'(AB1) '
= B1B2'A'B1'A'= B1B2'A' = B1AB2 = B1AB2AB2
= (B1A)(B2A)B2 = (B1A)'(B2A)'B2 = A'B1'A'B2'B2
= A'B2'B2= (B2A)'B2 = B2AB2 = B2
Ax0 b
Let
x A b I A A z
then Ax A A b I A A z
AA b A AA A z
AA Ax0 Ax0 b
Calculation of the Moore-Penrose g-inverse
then A AA
1
Let A be a p×q matrix of rank q < p,
A
Proof
1 1
A A A A A A A A
A A I
thus
AA A AI A and A AA IA A
also A A I is symmetric
1
and AA A A A
A is symmetric
then B B BB
1
Let B be a p×q matrix of rank p < q,
Proof
1 1
BB B B BB
BB BB
I
thus
BB B IB B and B BB B I B
also BB I is symmetric
1
and B B B BB
B is symmetric
Let C be a p×q matrix of rank k < min(p,q),
then C = AB where A is a p×k matrix of rank k and B is a k×q matrix of rank
k