cs373 »


Question 5 Help

[Andy:] On the forums, we saw a lot of confusion about homeworks 2.5 and 2.6. Specifically, questions about what was going on with the linear algebra. I want to talk about some of that today, and I want to do it by comparing the 2D case -- and that's the case we talked about in lecture-- with the 4D case, which is what you're asked about on the homework. So in the 2-dimensional case, I want to first talk about this f matrix that Sebastian was calling the "state transition matrix." The idea behind this matrix was that we wanted to take some old beliefs, some old state, which in the 2-dimensional case was represented by x and ẋ where ẋ is our velocity and x is our position, and from that we want to extract our predict some new state, which was called x-prime and ẋ-prime. The question was what do we fill in here to get the proper values for x-prime and ẋ-prime. Let's think. What should our position be--our predicted position after some time has elapsed? Well, we want to include our old position, right? Lets first write out these formulas. We expect that x-prime will be composed of our old position plus whatever motion was occurring due to the velocity. That is going to be dt--the time elapsed--times our velocity. This is just velocity times time, which tells us how much our position has changed. Now, in matrix terms how do we express that? We're talking about x-prime, so that means we're going to think about this top row here. We want to keep x, which means a 1 goes here. We want to multiply ẋ by dt, so that means dt goes here. Just like that we figured out the first row of our F matrix. I'll label it here--F. Now what about the second row? Let's do a similar thing for ẋ prime to figure out where we should go in the second row. After our prediction, we said that we're just going to assume that the velocity hasn't changed. Velocity after equals velocity before. That means we don't want to have anything to do with this x, meaning a 0 goes here. We want everything to do with this ẋ--we want to keep this--so we put a 1 here. Okay. This kind of gives us some intuition for how this works in 2 dimensions. Let's see if we can generalize to 4. Now, again, we're going to some new state, and we're doing that by multiplying a state-transition matrix by some old belief. But now instead of x and ẋ, we also have y coordinates. So we have x, y, ẋ, and ẏ. Here we're going to, of course, get x, y, ẋ, ẏ, and all of those are prime, because they indicate after our prediction. Now, I'm not going to fill in this 4 x 4 matrix for you, but I think using similar reasoning to what we did in the 2-dimensional case, you can come up with what these formulas should be, and from that fill in this matrix appropriately, remembering that this entry corresponds to the first row, this entry the second, and so on. Good luck.

Question 6 Help

Now I want to talk about the H matrix. This is a matrix that takes a state, and when it multiplies by that state, spits out a measurement. Remember, we can only directly measure position and velocity, so that's all we want the H matrix to keep. Again, I want to talk about the 2D lecture case and the 4D homework case. Hopefully, by comparing them, we'll be able to build some intuition, and you'll be able to answer the homework. What was the goal of the H matrix? The goal of the H matrix was to take some state-- in the 2D case, our state was represented as an x and an ẋ-- multiply some matrix by that state in such a way that we extract a measurement. In the 2D case the measurement was just x--just the x coordinate. We can think of this as a 1 x 1 vector or a 1 x 1 matrix. The matrix we use to do that was this one. That was our H matrix--1, 0--because 1 times x gives us the x, and 0 times ẋ gives us the nothing--exactly what we want. But now let's talk about the dimensionality of these matrices and how this multiplication yielded just this number x. So we can think of x here as a 1 x 1 matrix. We got that matrix by multiplying this one, which is a 1 x 2-- one row by two columns--with this, which is two rows by one column. What we see here is that this 1 actually came from right here, and this 1 came from right here. These 2s we can think of as canceling out, in a way, giving us this 1 x 1 matrix. Now, let's see if we can generalize that to the 4-dimensional case as presented in the homework. In the 4-dimensional case our state is now given by x, y, ẋ, ẏ. We're going to have some H matrix. I don't know anything about it yet, but I'm just going to put this there for now as a placeholder. We want to get a measurement from that. What should this measurement be? It's not just going to be x, because now our position includes both x and y. So it's going to be a column vector--x and y. Again, let's think. What's going on with the dimensionality here? Here we have a 2 x 1 matrix, and that came from this matrix, which I said we don't know anything about yet-- I'll just say a question mark by question mark-- and this matrix, which is four rows by one column. Now, can you use the intuition we built up here for how the dimensionality of matrices works with this to fill in the question marks? Once you figure out the number of rows and the number of columns in this H matrix, figuring out where to put your 1s and 0s will be a little bit easier. I wish you luck.