Basic Linear Algebra in R by Ankita Jain - PowerPoint PPT Presentation

1 / 6
About This Presentation
Title:

Basic Linear Algebra in R by Ankita Jain

Description:

By default numbers are put column wise in matrix. ' byrow=T' makes it put row wise in matrix. ... Reading Data from a File. Scan command loads the file in R ... – PowerPoint PPT presentation

Number of Views:39
Avg rating:3.0/5.0
Slides: 7
Provided by: Mat137
Category:
Tags: algebra | ankita | basic | jain | linear | wise

less

Transcript and Presenter's Notes

Title: Basic Linear Algebra in R by Ankita Jain


1
Basic Linear Algebra in Rby Ankita Jain
2
Vectors
  • Defining a column vector
  • Transpose of a vector
  • Addition of two vectors
  • Multiplication of a vector with a scalar and
    another vector
  • Inner Product of vectors ( a is orthogonal to c
    iff a.c0)
  • Length(norm ) of a vector

3
Matrices
  • Defining a matrix with first argument as array of
    numbers and second specifying number of columns
  • By default numbers are put column wise in matrix.
    byrowT makes it put row wise in matrix.
  • Adding two matrices(similarly for vectors)
  • Trace of a matrix t(B)
  • Multiplication of Matrix with a scalar and with
    a matrix (similarly with a vector)

4
Matrices
  • Diagonal of a matrix
  • Defining a diagonal matrix
  • Inverse of a matrix solve(A)
  • To solve Axb, we find xA-1B (Binv(A), x Bb)

5
Other Matrix Operations
  • Finding determinant of a matrix
  • eigen(A) Eigen values and vectors of a matrix
  • cbind(A,B) Concatenating two matrices
  • Row Operations in a matrix
  • Multiply a row by a (non-zero) constant
  • Multiply a row by a non-zero constant and add the
    result to another row
  • Interchange two rows

6
Reading Data from a File
  • Scan command loads the file in R
  • Selecting particular rows and columns from the
    scanned file
Write a Comment
User Comments (0)
About PowerShow.com