Lecture 05 - 102A_5_ho

# Lecture 05 - 102A_5_ho - Introduction Basic Matrix...

This preview shows pages 1–3. Sign up to view the full content.

Introduction Basic Matrix Operations Patterned Matrices Full Rank Decomposition and Matrix Rank QR Decomposition and Rank LDU Decomposition and Matrix Inverse UCLA Department of Statistics Course 102A Introduction to Computational Statistics with R Part V: Matrices in R Jan de Leeuw October 27, 2010 Jan de Leeuw 102A_5 UCLA Department of Statistics Introduction Basic Matrix Operations Patterned Matrices Full Rank Decomposition and Matrix Rank QR Decomposition and Rank LDU Decomposition and Matrix Inverse Eigen o Outline 1 Introduction 2 Basic Matrix Operations 3 Patterned Matrices 4 Full Rank Decomposition and Matrix Rank 5 QR Decomposition and Rank 6 LDU Decomposition and Matrix Inverse 7 Eigen or spectral decomposition Jan de Leeuw 102A_5 UCLA Department of Statistics Introduction Basic Matrix Operations Patterned Matrices Full Rank Decomposition and Matrix Rank QR Decomposition and Rank LDU Decomposition and Matrix Inverse In this part of the notes we will give an R -oriented overview of matrix algebra and matrix calculation. This means that we will think of a matrix as a certain type of R object. More precisely, for the purposes of this course a matrix is a vector of numbers with a dimension attribute. The dimension attribute is a vector with two integers, the number of rows and the number of columns. Jan de Leeuw 102A_5 UCLA Department of Statistics Introduction Basic Matrix Operations Patterned Matrices Full Rank Decomposition and Matrix Rank QR Decomposition and Rank LDU Decomposition and Matrix Inverse Eigen o So matrix calculus for us is calculating with these R objects. Of course packages like Matlab or SPSS or Stata have very similar objects – and thus their matrix calculus will be very similar to ours. Observe that in this part of the course we exclude matrices of logicals, characters or raw bytes. Only numerical matrices are used, and actually only matrices with doubles are considered. We will freely switch from matrix notation (formulas) to R notation (code). Jan de Leeuw 102A_5 UCLA Department of Statistics

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Introduction Basic Matrix Operations Patterned Matrices Full Rank Decomposition and Matrix Rank QR Decomposition and Rank LDU Decomposition and Matrix Inverse Here is an example of a matrix. 1 > options (digits = 2) 2 > x <- matrix ( rnorm (20), 5, 4) 3 > x 4 [,1] [,2] [,3] [,4] 5 [1,] -2.42 0.0282 0.11 -0.25 6 [2,] -0.78 0.1449 -0.74 -0.24 7 [3,] -1.24 0.0029 -0.20 1.55 8 [4,] -0.65 0.5688 -0.83 -0.68 9 [5,] -0.24 -0.2800 -1.32 0.25 10 > nrow (x) 11 [1] 5 12 > ncol (x) 13 [1] 4 14 > dim (x) 15 [1] 5 4 Jan de Leeuw 102A_5 UCLA Department of Statistics Introduction Basic Matrix Operations Patterned Matrices Full Rank Decomposition and Matrix Rank QR Decomposition and Rank LDU Decomposition and Matrix Inverse Eigen o In order to get better acquainted: 1 > str (x) 2 num [1:5, 1:4] -2.419 -0.777 -1.238 -0.651 -0.241 . .. 3 > attributes (x) 4 \$ dim 5 [1] 5 4 Jan de Leeuw 102A_5 UCLA Department of Statistics Introduction Basic Matrix Operations Patterned Matrices Full Rank Decomposition and Matrix Rank QR Decomposition and Rank LDU Decomposition and Matrix Inverse It is important to understand the role of the dimension attribute.
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### Page1 / 22

Lecture 05 - 102A_5_ho - Introduction Basic Matrix...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online