Professional Documents
Culture Documents
Chapter1 (Data Array and Matrices)
Chapter1 (Data Array and Matrices)
Chapter1 (Data Array and Matrices)
WHAT IS MULTIVARIATE
ANALYSIS
Statistical methodology to analyze data
with measurements on many variables.
controllable factors
"
input "
output
Process
"
uncontrollable factors
1
Application of Multivariate Techniques
APPLICATION EXAMPLES
2
Application of Multivariate Techniques
ARRAY
Xjk = measurement of the kth variable on
the jth item.
Var 1 Var 2 … Var k … Var p
Item 1 x11 x12 … x1k … x1p
Item 2 x21 x22 … x2k … x2p
…
… …
Item j xj 1 xj 2 … xjk … xjp
…
… …
Item n xn 1 xn 2 … xnk … xnp
Department of Statistics Ida Rosmini Othman 6
3
The Organization of Data
ARRAY
…
X = … …
xj 1 xj 2 … xjk … xjp
…
…
… …
xn 1 xn 2 … xnk … xnp
ARRAY
4
Some Basics of Matrix and Vector Algebra
VECTORS
Can be transpose
⎡ x1 ⎤
⎢x ⎥
x = ⎢ 2⎥
⎢#⎥
⎢ ⎥
⎢⎣ xn ⎥⎦
x' = [ x1 , x2 ," , xn ]
VECTORS
Can be expanded
through constant
multiplication
⎡ cx1 ⎤
⎢cx ⎥
cx = ⎢ 2 ⎥
⎢ # ⎥
⎢ ⎥
⎣⎢cxn ⎦⎥
5
Some Basics of Matrix and Vector Algebra
VECTORS
Can be added
⎡ x1 ⎤ ⎡ y1 ⎤
⎢x ⎥ ⎢ y ⎥
x+ y = ⎢ 2⎥ + ⎢ 2⎥
⎢#⎥ ⎢#⎥
⎢ ⎥ ⎢ ⎥
⎢⎣ xn ⎥⎦ ⎢⎣ yn ⎥⎦
⎡ x1 + y1 ⎤
⎢x + y ⎥
=⎢ 2 2⎥
⎢ # ⎥
⎢ ⎥
⎢⎣ xn + yn ⎥⎦
VECTORS
6
Some Basics of Matrix and Vector Algebra
VECTORS
VECTORS
a) length
7
Some Basics of Matrix and Vector Algebra
VECTORS : ANGLE
x, y
cos (θ ) =
Lx L y
x, y
=
x' x y ' y
EXAMPLE 2.1
8
Some Basics of Matrix and Vector Algebra
EXAMPLE 2.1
⎡1 ⎤ ⎡3⎤
a) 3x = 3 ⎢ 3 ⎥ = ⎢9 ⎥
⎢ ⎥ ⎢ ⎥
⎢⎣ 2 ⎥⎦ ⎢⎣ 6 ⎥⎦
⎡ 1 ⎤ ⎡ − 2 ⎤ ⎡ − 1⎤
b) x + y = ⎢⎢ 3 ⎥⎥ + ⎢⎢ 1 ⎥⎥ = ⎢⎢ 4 ⎥⎥
⎢⎣ 2 ⎥⎦ ⎢⎣ − 1 ⎥⎦ ⎢⎣ 1 ⎥⎦
EXAMPLE 2.1
c) Length of x d) Length of y
⎡1⎤ ⎡ −2 ⎤
x' x = [1 3 2] ⎢⎢3⎥⎥ =14 y' y = [ −2 1 −1] ⎢⎢ 1 ⎥⎥ = 6
⎢⎣2⎥⎦ ⎢⎣ −1⎥⎦
Lx = 14 = 3.742 Lx = 6 = 2.449
9
Some Basics of Matrix and Vector Algebra
EXAMPLE 2.1
e) Angel between x and y
⎡ −2 ⎤
x' y = [1 3 2 ] ⎢⎢ 1 ⎥⎥ = − 1
⎢⎣ − 1 ⎥⎦
x,y −1
cos (θ ) = = = − 0.109
' ' 14 6
xx yy
θ = 96.3D
Department of Statistics Ida Rosmini Othman 19
EXAMPLE 2.1
f) Check that length of 3x is 3 times the length of x
⎡3⎤
3 x = ⎢⎢9 ⎥⎥
⎢⎣ 6 ⎥⎦
⎡3⎤
3 x 3 x = [3 9 6] ⎢⎢9 ⎥⎥ = 126
'
⎢⎣6 ⎥⎦
L3 x = 126
3Lx = 3 14 = 126
∴ L3 x = 3Lx
Department of Statistics Ida Rosmini Othman 20
10
Some Basics of Matrix and Vector Algebra
MATRICES
⎡0 3 1⎤ ⎡1 −2 −3⎤
A=⎢ ⎥ B=⎢ ⎥
⎣1 −1 1⎦ ⎣2 5 1 ⎦
⎡0 1⎤
Transpose : A' = ⎢⎢3 −1⎥⎥
⎢⎣1 1 ⎥⎦
⎡0 12 4⎤
Multiply by cons tan t : 4A = ⎢
⎣ 4 −4 4⎥⎦
⎡0 3 1⎤ ⎡1 −2 −3⎤ ⎡1 1 −2⎤
Addition : A + B = ⎢ ⎥+⎢ =
⎣1 −1 1⎦ ⎣ 2 5 1 ⎥⎦ ⎢⎣3 4 2 ⎥⎦
Department of Statistics Ida Rosmini Othman 21
MATRICES
Multiplication :
⎡ −2 ⎤
⎡3 −1 2⎤ ⎡2 0⎤
A=⎢ B = ⎢⎢ 7 ⎥⎥ C =⎢
⎣1 5 4 ⎥⎦ ⎣1 − 1⎥⎦
⎢⎣ 9 ⎥⎦
⎡ −2 ⎤
⎡3 −1 2 ⎤ ⎢ ⎥ ⎡5⎤
A B =⎢ 7 =
( 2×3 ) ( 3×1) ⎣ 1 5 4 ⎥⎦ ⎢ ⎥ ⎢ 69 ⎥
⎣ ⎦
⎢⎣ 9 ⎥⎦ ( 2 ×1)
⎡2 0 ⎤ ⎡3 −1 2⎤ ⎡6 −2 4 ⎤
A =⎢ =
− 1⎥⎦ ⎢⎣ 1 4 ⎥⎦ ⎢⎣ 2 − 2 ⎥⎦
C
( 2×2 ) ( 2×3 ) ⎣ 1 5 −6
( 2× 3 )
11
Some Basics of Matrix and Vector Algebra
MATRICES
⎡3 5⎤
Symmetric : ⎢
⎣5 − 2 ⎥⎦
⎡3 6⎤
Not symmetric : ⎢
⎣4 − 2 ⎥⎦
MATRICES
⎡ −.2 .4 ⎤
A −1 = ⎢ ⎥
⎣ .8 −.6 ⎦
12
Some Basics of Matrix and Vector Algebra
MATRICES
⎡ a11 0 0 0 0 ⎤
⎢0 a22 0 0 0 ⎥⎥ ⎡ 1 ⎤
⎢ ⎢a 0 0 0 0 ⎥
Diagonal : ⎢ 0 0 a33 0 0 ⎥ ⎢ 11 ⎥
⎢ ⎥ ⎢ 1 ⎥
⎢0 0 0 a44 0 ⎥
⎢ 0 0 0 0 ⎥
⎢⎣ 0 0 0 0 a55 ⎥⎦ ⎢ a22 ⎥
⎢ 1 ⎥
Inverse : ⎢ 0 0 0 0 ⎥
⎢ a33 ⎥
⎢ 1 ⎥
⎢ 0 0 0 0 ⎥
⎢ a44 ⎥
⎢ 1 ⎥
⎢ 0 0 0 0 ⎥
⎢⎣ a55 ⎥⎦
MATRICES
A square matrix is said to be orthogonal if
QQ ' = Q ' Q = I
Q −1 = Q '
⎡cos θ − sin θ ⎤ ⎡ cosθ sin θ ⎤ ⎡1 0 ⎤
⎢ sin θ =
⎣ cos θ ⎥⎦ ⎢⎣ − sin θ cos θ ⎥⎦ ⎢⎣0 1 ⎥⎦
−1
⎡ cos θ sin θ ⎤ ⎡ cosθ − sin θ ⎤
⎢ − sin θ =⎢
⎣ cos θ ⎥⎦ ⎣ sin θ cos θ ⎥⎦
Department of Statistics Ida Rosmini Othman 26
13
CLASS EXERCISE
14