课程: R for Data Science: Lunch Break Lessons

免费学习该课程!

今天就开通帐号,24,100 门业界名师课程任您挑!

matrix: solve inverse

matrix: solve inverse

- [Instructor] In Matrix Math, it's not uncommon to need the inverse of a matrix, and R provides Solve to create the inverse of a matrix, but it requires that you correctly set everything up. So let's take a look at how to find the inverse of a matrix. First you remember the formula, matrix with a dot product times the inverse of the matrix equals the identity matrix, and we'll use that formula. I've placed it in the lower right hand corner for reference, Here's how to set up for this particular equation. First, we need the matrix A and I'm going to call it well, matrix A and into matrix A, I'm going to assign a matrix with a vector of three through six and I'll need to tell it how many rows will we have nrow equals to two. So let's go ahead and take a look at that matrix that I've just created. You can see that I have two rows and it's three if you talk rows five and then four and six. So we're going to find the…

内容