Presentation is loading. Please wait.

Presentation is loading. Please wait.

UnB - Financial Econometrics I Otavio Medeiros 1 The Matrix Otavio R. de Medeiros UnB Programa de Pós-Graduação em Administração Programa Multiinstitucional.

Similar presentations


Presentation on theme: "UnB - Financial Econometrics I Otavio Medeiros 1 The Matrix Otavio R. de Medeiros UnB Programa de Pós-Graduação em Administração Programa Multiinstitucional."— Presentation transcript:

1 UnB - Financial Econometrics I Otavio Medeiros 1 The Matrix Otavio R. de Medeiros UnB Programa de Pós-Graduação em Administração Programa Multiinstitucional e Interregional de Pós-Graduação em Ciências Contábeis UnB-UFPB-UFRN Financial Econometrics I

2 UnB - Financial Econometrics I Otavio Medeiros 2 Matrices A Matrix is a collection or array of numbers Size of a matrix is given by number of rows and columns R x C If a matrix has only one row, it is a row vector If a matrix has only one column, it is a column vector If R = C the matrix is a square matrix

3 UnB - Financial Econometrics I Otavio Medeiros 3 Definitions Matrix is a rectangular array of real numbers with R rows and C columns. are matrix elements.

4 UnB - Financial Econometrics I Otavio Medeiros 4 Definitions Dimension of a matrix: R x C. Matrix 1 x 1 is a scalar. Matrix R x 1 is a column vector. Matrix 1 x C is a row vector. If R = C, the matrix is square. Sum of elements of leading diagonal = trace. Diagonal matrix : square matrix with all elements off the leading diagonal equal to zero. Identity matrix: diagonal matrix with all elements in the leading diagonal equal to one. Zero matrix: all elements are zero.

5 UnB - Financial Econometrics I Otavio Medeiros 5 Definitions Rank of a matrix: is given by the maximum number of linearly independent rows or columns contained in the matrix, e.g.:

6 UnB - Financial Econometrics I Otavio Medeiros 6 Matrix Operations Equality: A = B if and only if A and B have the same size and a ij = b ij  i, j. Addition of matrices: A+B= C if and only if A and B have the same size and a ij + b ij = c ij  i, j.

7 UnB - Financial Econometrics I Otavio Medeiros 7 Matrix operations Multiplication of a scalar by a matrix: k.A = k.[a ij ], i.e. every element of the matrix is multiplied by the scalar.

8 UnB - Financial Econometrics I Otavio Medeiros 8 Matrix operations Multiplication of matrices: if A is m x n and B is n x p, then the product of the 2 matrices is A.B = C, where C is a m x p matrix with elements: Example: Note: A.B  B.A

9 UnB - Financial Econometrics I Otavio Medeiros 9 Transpose of a matrix matrix transpose: if A is m x n, then the transpose of A is n x m, i.e.:

10 UnB - Financial Econometrics I Otavio Medeiros 10 Properties of transpose matrices (A+B)+C=A+(B+C) (A.B).C=A(B.C)

11 UnB - Financial Econometrics I Otavio Medeiros 11 Propriedades: PROJEÇÕES

12 UnB - Financial Econometrics I Otavio Medeiros 12 Square matrices : Identity matrix I: Note: A.I = I.A = A, where A has the same size as I.

13 UnB - Financial Econometrics I Otavio Medeiros 13 Square matrices : Diagonal matrix:

14 UnB - Financial Econometrics I Otavio Medeiros 14 Square matrices: Scalar matrix = diagonal matrix, when     n. Zero matrix: A + 0 = A; A x  0 = 0.

15 UnB - Financial Econometrics I Otavio Medeiros 15 Trace of a matrix: If A is m x n and B is n x m, then AB and BA are square matrices and tr(AB) = tr (BA)

16 UnB - Financial Econometrics I Otavio Medeiros 16 Determinants matrix 2 x 2:

17 UnB - Financial Econometrics I Otavio Medeiros 17 Determinants matrix 3 x 3:

18 UnB - Financial Econometrics I Otavio Medeiros 18 Determinants Matrix 3 x 3:

19 UnB - Financial Econometrics I Otavio Medeiros 19 Inverse matrix The inverse of a square matrix A, named A -1, is the matrix which pre or post multiplied by A gives the identity matrix. B = A -1 if and only if BA = AB = I Matrix A has an inverse if and only if det A  0 (i.e. A is non singular). (A.B) -1 = B -1.A -1 (A -1 )’=(A’) -1  if A é symmetrical and non singular, then A -1 is symmetrical. If det A  0 and A is a square matrix of size n, then A has rank n.

20 UnB - Financial Econometrics I Otavio Medeiros 20 Steps for finding an inverse matrix Calculation of the determinant: Kramer’s rule or cofactor matrix. Minor of the element a ij is the determinant of the submatrix obtained after exclusion of the i-th row and j-th column. Cofactor is the minor multiplied by (-1) i+j,

21 UnB - Financial Econometrics I Otavio Medeiros 21 Steps for finding an inverse matrix Laplace expansion: take any row or column and get the determinant by multiplying the products of each element of row or columns by its respective cofactor. Cofactor matrix: matrix where each element is substituted by its cofactor.

22 UnB - Financial Econometrics I Otavio Medeiros 22

23 UnB - Financial Econometrics I Otavio Medeiros 23 Example 2 x 2 matrix :

24 UnB - Financial Econometrics I Otavio Medeiros 24 Example 3 x 3 matrix :

25 UnB - Financial Econometrics I Otavio Medeiros 25 Matrix differentiation:

26 UnB - Financial Econometrics I Otavio Medeiros 26 Matrix differentiation:

27 UnB - Financial Econometrics I Otavio Medeiros 27 Matrix differentiation:

28 UnB - Financial Econometrics I Otavio Medeiros 28 Since  = 0.5 e  = 0.5, the regression equation is y t = 0.5 + 0.5x t Solution: Linear regression, example 1: Perform a linear regression, given that the data for the dependent variable are 1, 2, 1, 2, 2 and for the independent variable are 1, 2, 2, 3, 3.

29 UnB - Financial Econometrics I Otavio Medeiros 29

30 UnB - Financial Econometrics I Otavio Medeiros 30 Linear regression, example 2: a firm manufacturing bikes is preparing a project and wishes to find out what is the relationship between bike sales and national income (GDP). In the last 5 years, bike sales increased by 5%, 9%, 5%, 6% and 10%, whereas GDP increased by 2,5%, 4%, 3%, 2,5%, 4%. What is the relationship between bike sales and GDP?

31 UnB - Financial Econometrics I Otavio Medeiros 31 The past relationship between bike sales growth and GDP growth is given by: y t = -0.0204 + 2.826x t Example 2: Solution 1

32 UnB - Financial Econometrics I Otavio Medeiros 32 Hint: to avoid working with decimals, we can multiply y and x by 100. To find the correct final result, divide  by 100.  doesn’t change. Example 2: Solution 2

33 UnB - Financial Econometrics I Otavio Medeiros 33 Graph (Excel):

34 UnB - Financial Econometrics I Otavio Medeiros 34 Goodness of fit: A measure of the goodness of fit of a regression is the coefficient of determination R 2, which is defined as:

35 UnB - Financial Econometrics I Otavio Medeiros 35 Goodness of fit: When all the residuals are equal to nil, R 2 = 1, meaning that the regression is perfect, with all data points located on the line. When thenR 2 = 0, meaning that there is no regression. Hence, the range for R 2 will be: 0 < R 2 < 1 Values of R 2 close to 1 indicate a good regression, while low values of R 2 indicate a bad or inexisting regression.

36 UnB - Financial Econometrics I Otavio Medeiros 36 Calculation of R 2 – Example 1:

37 UnB - Financial Econometrics I Otavio Medeiros 37 Calculation of R 2 – Example 2:


Download ppt "UnB - Financial Econometrics I Otavio Medeiros 1 The Matrix Otavio R. de Medeiros UnB Programa de Pós-Graduação em Administração Programa Multiinstitucional."

Similar presentations


Ads by Google