So let's have a look at a correctly tuned common filter, so using this to track a problem that we've
been developing, we're going to run the simulation with the position measurement noise or the X and
Y position standard deviation set to be ten.
We're going to assume a straight path motion for the object.
We're going to start at a random origin.
We're going to be traveling at a random speed and heading OK.
Now for the properties of the common filter, we're going to say that the acceleration, standard deviation
that which affects the key matrix is going to be zero.
And we're going to set the measurement standard deviation to be 10.
So this is the matrix.
So, of course, that we're going to set the common field of noise variance for the sensor measurement
model to be ten, because that's the same as what we've actually done in simulation.
So and also we're going to run it with a delayed initialization.
So when you run this, come and fill it up.
We can see the results, so if we have a look over here at the measurement innovations for the X and
Y components, you can see that the measurement innovations are zero mean.
So the Senate about zero.
So this is the first indication that the filter is working correctly.
We also have a look at the innovation covariance.
So the plus or minus one sigma for the X and for the Y.
So this green dash line here, we can see that it sort of converges to a level of about we'll call that
10 plus minus ten for one sigma, for the X and for the Y innovation.
It converges to about the same level plus or minus ten for one sigma.
And if we look at the standard deviation for the X innovation and Y innovation, which is plotted out
in the simulation, we can see we get a value of about a 10 and a value of 11.
So according to this, the filter is very well trained and that's to be expected.
We're using the true noise density properties and we set that the standard deviation for the acceleration
to be zero.
So there's no process model noise.
So if we look at the actual results, we can see that we're using delayed initialization, so our initial
position starts off at the first measurement.
So you can see here the state assessment starts off at this measurement here and same down here, although
it's a bit hard to see that.
So, I mean, you can see the velocity starts of zero zero because we have no idea what the initial
velocity is.
But you can see that as if it were to get to position measurements.
It quickly converges down to the true value.
And the same thing up here, you can see it starts of zero and it quickly converges.
If we look at the x y position error, you can see that our standard deviation for how sorry I can say
that our three sigma variance for the position error, it contains our state estimates with the error
and the same thing pretty much for the Y position.
You can see that most of the error is contained within plus or minus three sigma.
So that's working correctly and likewise for the X and Y velocity.
You can say that a nice a nice convergence for the Vocera and something for the year.
Now if we have a look at a final X and Y position, error, uncertainty.
So this is for our three sigma.
We can see that we have a three sigma value of plus or minus five meters and the same thing probably
for the Y direction as well, about plus or minus five meters.
So that's for the three sigma value.
So that's very good considering that our overall position measurements shown here that have a variance
or they have a standard deviation, I should say, of 10 meters so we can see that we've pretty.
So you can see that our position error is a lot smaller than 10 meters and this is three times the standard
deviation.
So we're about a standard deviation for the X and Y estimates of about what we say that too.
So that's very good.
So basically drop the variance down.
So we basically drop the standard deviation down from about 10 to about two.
If we also have a look at our velocity, you can see that initially when we have a large uncertainty,
our velocity jumps around a lot.
But as we longer we around the field, the uncertainty converges down so that the jumps in smaller and
smaller and we end up converging pretty much to the truth.
And you can see that as along this time here are vastly jumps a lot smaller.
This is because you have less uncertainty in the side, the system.
And if we look at the end here for hour plus or minus three sigma value, we can see that we've got
a pretty good estimate of our velocity was converted to almost zero error.
And the uncertainty is plus or minus point one meters per second for the three sigma value.
So you can see that this is a very good estimate of what the velocity is and we don't even have any
sense to measure the velocity at all is done through precision measurements and then the common field
of process model of the dynamic system.
So this field is working very well.
So now let's rerun the simulation for a field that's not correctly trained.
So now let's overestimate how good a sensor actually is.
So let's say the measurement deviation, we assume it to be a standard deviation of one.
But in reality, it's ten.
So now if you run this.
You can see we get a very different response, so now you can see the variance in our innovations is
a lot larger than our plus or minus one sigma for the innovation experience.
So this is from The Matrix.
So you can see that this Philidor here is not quickly change.
So even though we have about zero mean for the innovation, the covariance is not indicative of the
actual variance inside the system.
So the filter is inconsistent.
And you can see this again on these graphs here.
So even though the velocity might converge down to a four, the true value will we get down towards
zero error?
You can see that our position is jumping around so much.
This is because we assume that every position measured when we get is very accurate.
So the filter is always going to be trying to update to that position measurement rather than trust
the model that it should be trusting more so you can see these large jumps in position and we can see
most of the time our position is outside of our uncertainty balance.
So this means the field is inconsistent.
So these are indications of the field not being very well tuned.
So now let's set the measurement standard deviation back to 10.
So back to the true value.
Now, what happens if we have like lots of uncertainty inside the system for the process model?
So let's have a key matrix that's non-zero now.
So let's set the acceleration standard deviation, three point one.
So now we're introducing unneeded uncertainty inside the system through the process model.
And let's run this.
OK, so now looking at this, you might say, oh, it's working fairly well and yes, is still working
fairly well, you can see that our innovation convenience is about 10 plus or minus again.
And the same thing for the Y and it's main.
And our innovation sequence has a standing ovation of about 11 and about one call at ten.
So looking at the innovation and mystical properties of the innovation, it's fairly is working fairly
well.
But if we actually have a look at what's going on in the estimates, you can see now how position uncertainty
in the X and Y for estimate is not as much is not as converged.
It has not as it has not converged as well as it did in previous example in the Crickley chain Furo,
we had an uncertainty of about four three seamer of plus or minus five here.
Now we've got the uncertainty about plus or minus 10 for position and for the velocity.
You see that we can't converge on a true velocity as well because we no longer have, because we are
introducing more uncertainty inside the system.
So now the velocity error, uncertainty is about plus or minus one for the three sigma value because
of this uncertainty inside the system.
As the filter runs, you can see that we're getting these larger jumps in the velocity the longer we
run it.
So this is the uncertainty inside the system that we're adding through.
The process model is not letting the field all converge to a true value and it's not letting it stay
converged.
The true value, because every time we run the prediction step, we're going to get more uncertainty
inside the system.
So you can see that the uncertainty is causing the uncertainty grow up.
So you can see the process model uncertainty is causing the uncertainty inside the estimates to increase.
So our position error and was the error uncertainty does not converge to as a small level.
So there's still more uncertainty inside the system, which lets the coming for updated move the state
around a lot more.
So we're trying to use these vosta estimates for something else, like for control.
We're going to get a very noisy signal because every time we get a position, update is going to try
to change velocity to make the field consistent with that.
So this is just one example of a filter that's not tuned as well as it could be tuned.
Now, all these examples of how the system model that replicates what's actually happening in real life
is is a tracking, an object that's moving at a constant velocity.
What happens if we had a bit of error inside the process model?
So what happens if we actually assume that the object was travelling at a constant velocity, but it
wasn't actually traveling at a constant velocity, it had a non-zero acceleration value.
So we can have a look at this in the simulation.
So it set our acceleration, standard deviation back down to zero.
And let's try this change the motion type from straight to linear.
So what this motion model is now going to do under law in the simulation is going to assume a constant
but non-zero acceleration.
And this acceleration, random constant is going to be chosen at the start of the simulation.
So now let's run this.
So the filter is not going to be going to be able to perform as well, so if you look at how well it
tracks, you can see that the true object is getting ahead of it while we're lagging behind.
So if we look at our innovations, you can see that we're not at a zero.
I mean, you can say innovation starting to get larger and larger and larger.
And this is because we have unmoral dynamics in the true system.
So if we look at how the velocity of the object that we're trying to track, the true velocity, the
blue line here and the blue line here, you can see that is no longer a constant velocity, is not a
straight line anymore.
We have a acceleration value.
So since the filter assumes a constant velocity and and a zero acceleration value, there's not enough
flexibility in the system to let the filter estimates catch up.
So you can see that our measurements are following the true state as they should.
But I feel that does not have enough uncertainty inside the system to let the filter catch up to what
this is.
So to get around this, this is where we have to start using our key metrics by adding extra uncertainty
inside the system to help catch up.
So now let's set our acceleration, starvation back to point one and run the filter again.
We should be able to see the foot of trucks, the accelerating object, a lot better now.
So now we have a zero mean for the innovations and the innovation variance is about the same size as
it should be.
And if you look at our graphs here, you can see that the filter is now tracking our non-zero acceleration.
So we now it's tracking the velocity better.
But you can see there's been a trade off.
Now since we're using a the key metrics to add more uncertainty into the system, the velocity estimates
no longer converge down to a very smooth value.
You can see now, since we had to add this uncertainty into the system to compensate for the unmoral
dynamics, we're not going to get a smooth loss, the estimate anymore.
So we're going to get these random jumps in our velocity as it tries to update it using the position.
So this is one problem with tuning the filter.
We want to make the key matrix as small as possible so all our states are smooth.
But in this situation here, when we have a unmoral dynamics or extra uncertainty inside the process
model, we need to increase the key matrix.
But we always want to do this in using the least amount as possible.
If we have another look at a different example, so let's say instead of having a constant non-zero
acceleration, we actually have a object traveling in a circle.
And this time, let's go back to our zero key metrics, so this is definitely not what the system was
designed for.
So I can see as we travel around in a circle, our filter is going to start to get more and more delayed
and more and more error.
And we can say this in the innovation is no longer here, I mean, and our velocity measurements and
position measurements are going to be very delayed.
So you can see here our velocity estimates don't really follow the true velocity at all.
So this is because in a circle, the object is constantly accelerating and changing velocity.
This violates the underlying assumption that we're traveling at a constant velocity.
So to handle this again, we can start adding some more process, more noise into it, using the acceleration.
And if we run this.
So let's see what happens this time, so this time you can see that we're tracking the object a bit
better, but it's still having a bit of trouble keeping up with the object.
So there's not enough uncertainty inside the system to let the system catch up with the moving object.
The that's always constantly changing acceleration.
But you can see our innovation is better this time.
So we're closer to being see remain, but we still have a delayed response.
So if we try this again, so it's adding a larger standard deviation for the acceleration.
So let's actually say five.
OK, so now I can see that the object is now you can see the computer is tracking the object a lot better,
but you can still see that the object is jumping around a lot.
This time, innovation is there, I mean, so that's good.
So it seems to be fairly consistent in that point of view.
And you can see our errors are mostly zero.
I mean, but unfortunately, inside the system, to make it work, be able to track the object, we've
had to increase the key metrics so much.
And if we actually have a look at our position error, you can see the uncertainly that we think in
the system is going to be plus or minus.
Well, we said plus or minus about 20.
So this is very large.
And in fact, this is probably larger, almost as large as the real measurement standard deviation itself.
So that's pretty much saying that this field is not adding anything into it, into the estimates.
I've lost the sort of tracking the true state, but we have lots of noise inside it.
So this is not a very good model to use in this situation.
There'll be better models we can come up with, better for the common field to handle circular dynamics.
So in this case, we've had to increase the key metrics a lot because the actual dynamics violate the
assumptions we made inside the common filter for the process model dynamics.
And because of this, we have these really large uncertainties around our state estimates.
So we have a large position uncertainty and a lot of uncertainty, which means our signal estimates
are going to be very noisy because it's going to be jumping around a lot and the same thing for our
velocity.
So in these situations, even though the common field is estimating the velocity and position, it's
very noisy.
And this is just because our system model is not a very good model for what we actually want to estimate.
So it can be hard to come up with a simple coming for model that can track an object that does not add
too much complexity into it.
So for this example, we've had made a few assumptions, and one of those assumptions was that we had
a zero acceleration and we had a constant velocity.
So I can say in some situations in the first couple of simulations, it was working fine.
But when we changed the actual motion type of the true system to something that's accelerating or something
that's like circular is not a very good model to use in these cases.
And the things that we needed to do to make it work, such as increasing the process of noise, means
reducing the effectiveness of the filter.
So these are some things to consider when we're designing a common filter and using it in practice,
if the dynamic model for the true system is very different to what the computer thinks it is.
Well, then it reduces the effectiveness of the common filter.
And we have to start increasing the uncertainty inside the system to make the filter work.
But that's going to degrade the overall performance.