1
00:00:04,010 --> 00:00:08,960
So in the previous exercise, you had to go through and implement the prediction step of the common

2
00:00:08,960 --> 00:00:14,120
filter, it's always good practice that if you have a simulation of the model that you're trying to

3
00:00:14,120 --> 00:00:20,090
estimate, then run the simulation without any noise from a known initial condition and then run the

4
00:00:20,270 --> 00:00:25,010
method of prediction step from the same initial condition and see that the two are consistent.

5
00:00:25,850 --> 00:00:28,250
Now, this is an important validation step.

6
00:00:28,280 --> 00:00:32,660
It shows that the common thread model that you're using is appropriate for the system dynamics that

7
00:00:32,660 --> 00:00:33,610
you're trying to estimate.

8
00:00:34,280 --> 00:00:37,360
And we want to run this without the update step from the common filter.

9
00:00:37,730 --> 00:00:43,070
This is because if we run it with the update step, sometimes the correction step can hide any errors

10
00:00:43,070 --> 00:00:43,630
in the model.

11
00:00:44,240 --> 00:00:49,100
So it's always good to make sure that the underlying prediction is as best as possible for the model

12
00:00:49,100 --> 00:00:53,220
that we want to try to estimate so we can have a look at this when we look at the code.

13
00:00:53,240 --> 00:00:54,980
So let's go switch the code.

14
00:00:55,940 --> 00:01:02,440
And if we start the initial state from zero zero zero and the covariance all from zero zero zero with

15
00:01:02,450 --> 00:01:07,150
zero process model noise and run it, we can see what happens with the true state.

16
00:01:07,460 --> 00:01:12,530
We can see that the object that we want to track shoots off at a 45 degree angle and it's traveling

17
00:01:12,530 --> 00:01:13,760
at 10 meters a second.

18
00:01:14,120 --> 00:01:19,580
So in this example, every time we run the simulation, the same velocity and the same direction happens.

19
00:01:19,580 --> 00:01:25,160
So we can say here we have Awasthi of about seven point zero seven and seven point zero seven.

20
00:01:26,410 --> 00:01:32,260
So using this information now, we can run the comment field, a prediction step using the same true

21
00:01:32,260 --> 00:01:32,980
initial state.

22
00:01:33,370 --> 00:01:39,490
So we saw that the initial state of the truth always starts at the Origin zero zero and had a controversy

23
00:01:39,490 --> 00:01:43,810
about seven point zero seven seven point zero seven.

24
00:01:44,200 --> 00:01:45,760
So now when we run the simulation.

25
00:01:48,880 --> 00:01:55,450
We can see our estimated position, the red dot and the true state, the blue dot, pretty much overlap.

26
00:01:55,970 --> 00:01:56,750
They line up.

27
00:01:56,770 --> 00:02:01,590
So the prediction step is very consistent with the actual model that we want to simulate.

28
00:02:02,020 --> 00:02:07,760
And we have looked at the main position error and maybe once the year, you see, they're very small.

29
00:02:08,290 --> 00:02:13,510
This is because we know the true state of the system and we're studying it from the true initial state.

30
00:02:14,020 --> 00:02:17,710
So if you look at the graphs here, you can see that we have a very small position error.

31
00:02:17,740 --> 00:02:23,770
So you can see here our units are very small and the same thing for the velocity, the velocity, and

32
00:02:23,770 --> 00:02:24,410
it's very small.

33
00:02:24,430 --> 00:02:28,800
So we pretty much start it from the truth and we're predicting it very well.

34
00:02:28,930 --> 00:02:34,930
So I can say that the true state tracks with the predicted state, I should say the other way around

35
00:02:34,930 --> 00:02:37,190
the predicted state tracks very well for the true state.

36
00:02:37,720 --> 00:02:40,570
So it all seems to be working fine.

37
00:02:41,080 --> 00:02:42,700
It all seems to be working accurately.

38
00:02:42,700 --> 00:02:46,750
And this is a good validation step as we covered in the slides.

39
00:02:48,810 --> 00:02:54,300
So the variance in the filter must always represent the approximate level of the uncertainty inside

40
00:02:54,300 --> 00:02:58,910
the field estimates, and this needs to be done through a correct model and correct tuning.

41
00:02:59,460 --> 00:03:04,800
What this means is that the true state of the system is within the uncertainty bounds around the estimated

42
00:03:04,810 --> 00:03:05,210
state.

43
00:03:05,760 --> 00:03:08,990
If this is not the case, then the filter is called inconsistent.

44
00:03:09,240 --> 00:03:14,760
And if the filter is inconsistent, this leads to bad and incorrect estimates and it degrades the whole

45
00:03:14,760 --> 00:03:15,840
estimation process.

46
00:03:16,320 --> 00:03:20,720
In some cases, it pretty much means that the estimated state from the filter is worthless.

47
00:03:20,720 --> 00:03:24,800
It's useless if you're trying to use it for anything, it would just cause problems.

48
00:03:26,690 --> 00:03:31,520
So we've checked that the state transmission model is working correctly, it can correctly predict from

49
00:03:31,520 --> 00:03:34,310
a known initial condition the true state response.

50
00:03:34,940 --> 00:03:38,780
We also want to check that the prediction model correctly transforms the uncertainty.

51
00:03:39,590 --> 00:03:45,500
The uncertainty in the system should not be increasing if our key metrics, a process model noise is

52
00:03:45,500 --> 00:03:46,280
equal to zero.

53
00:03:46,820 --> 00:03:50,290
Rather, it should be transformed, appropriate with the system model.

54
00:03:50,900 --> 00:03:55,230
So on the slide here, we can see the common field, our prediction set for the uncertainty.

55
00:03:55,250 --> 00:03:57,040
So this is the current uncertainty.

56
00:03:57,320 --> 00:03:58,970
This is the predicted uncertainty.

57
00:03:59,660 --> 00:04:02,280
These are the state transition matrixes.

58
00:04:02,300 --> 00:04:05,360
And this is the process model noise.

59
00:04:06,650 --> 00:04:08,960
So this step here takes the process model.

60
00:04:09,410 --> 00:04:15,470
So this step here takes the uncertainty at the TimeStep K minus one, transforms it through the process

61
00:04:15,470 --> 00:04:18,470
model to get the new uncertainty at the current time.

62
00:04:18,990 --> 00:04:21,590
So this transforms the uncertainty from the time set.

63
00:04:21,770 --> 00:04:26,150
It does not actually inflate the uncertainty, does not increase the uncertainty in the system.

64
00:04:26,390 --> 00:04:29,990
It just transforms what's appropriate with the system dynamics.

65
00:04:30,740 --> 00:04:35,990
Whereas this key metrics here, this actually increases or inflates the uncertainty inside the system.

66
00:04:36,620 --> 00:04:41,780
So if Kyuss equal to zero, we're just transforming the uncertainty based on the process model.

67
00:04:42,110 --> 00:04:46,100
If CU is non-zero, then we're actually increasing the uncertainty in the system.

68
00:04:49,160 --> 00:04:54,650
So what they can do is that we can check the position uncertainty is operating as expected, and to

69
00:04:54,650 --> 00:04:58,480
do this, we set the initial position uncertainty to be a non-zero value.

70
00:04:58,910 --> 00:05:04,670
We set the initial velocity, uncertainty to be zero, and then we can run the filter and see that the

71
00:05:04,670 --> 00:05:06,390
position uncertainty stays the same.

72
00:05:07,160 --> 00:05:09,710
So let's do that with the code that we have developed.

73
00:05:11,030 --> 00:05:14,790
So we want to set the initial position uncertainty to a non-zero value.

74
00:05:15,140 --> 00:05:21,190
So in this case, let's set the position uncertainty or the position standard deviation to be five.

75
00:05:21,200 --> 00:05:27,740
So the variance is five squared, so five squared for the X and five squared for the Y initial position

76
00:05:27,740 --> 00:05:28,220
uncertainty.

77
00:05:28,970 --> 00:05:29,870
So when we run this.

78
00:05:32,300 --> 00:05:38,480
We can now say that we have an uncertainty elipse around the estimate so we can see from these graphs

79
00:05:38,480 --> 00:05:43,850
here that the three sigma, these green lines here and here for the plus or minus sigma and plus or

80
00:05:43,850 --> 00:05:47,290
minus three sigma for the position error, they stay constant.

81
00:05:48,110 --> 00:05:50,670
And from a process model, this is what we expect.

82
00:05:50,690 --> 00:05:52,220
We're not increasing the uncertainty.

83
00:05:52,220 --> 00:05:54,220
We're just keeping the uncertainty the same.

84
00:05:54,230 --> 00:05:58,040
So the position uncertainty stays the same throughout the simulation.

85
00:05:59,650 --> 00:06:04,300
So the covariates prediction for the position on certainly seems to be operating as expected.

86
00:06:04,990 --> 00:06:09,540
So now let's check that they've lost the uncertainty is operating as expected.

87
00:06:09,550 --> 00:06:14,380
And to do this, we're going to set the initial position, uncertainty to zero, but we're going to

88
00:06:14,380 --> 00:06:17,340
set the velocity uncertainty to a non-zero value.

89
00:06:18,160 --> 00:06:23,500
And when we do this and run the field, we should see that the velocity uncertainty stays at the same

90
00:06:23,500 --> 00:06:23,950
value.

91
00:06:24,430 --> 00:06:28,290
But the position uncertainty in this case should grow linearly with time.

92
00:06:29,110 --> 00:06:32,470
And this is just due to the dynamics of the system.

93
00:06:32,830 --> 00:06:36,650
So if we integrate diversity, we shall get a change in position.

94
00:06:37,630 --> 00:06:44,110
So switching to the code this time, we're going to have a zero position uncertainty for the initial

95
00:06:44,110 --> 00:06:47,700
state, but we're going to have an uncertainty for the velocity.

96
00:06:47,710 --> 00:06:50,590
So let's say a standard deviation or variance of one.

97
00:06:52,630 --> 00:06:54,100
So now when we run the simulation.

98
00:06:55,940 --> 00:07:01,460
OK, so now if we have a look at the graphs, we can see that our velocity and certainly a three sigma

99
00:07:01,460 --> 00:07:05,750
bounce stays the same and it's going to be at three because this is a three sigma bounce.

100
00:07:05,750 --> 00:07:07,720
And we said the answer only to be one.

101
00:07:08,450 --> 00:07:12,870
So I've lost the uncertainty is doing what's expected is staying constant.

102
00:07:13,430 --> 00:07:18,770
Now, if you look at our position, uncertainty, we can see that is increasing with time and linearly

103
00:07:18,770 --> 00:07:19,760
increasing of time.

104
00:07:19,760 --> 00:07:24,920
And this is to be expected because we know that when we integrate velocity, we get a change in position.

105
00:07:25,580 --> 00:07:28,880
So initially we start off at zero variance, so we start off at zero.

106
00:07:29,090 --> 00:07:30,230
That's what we said it is.

107
00:07:30,560 --> 00:07:38,300
And you can see after our 120 seconds, it should be friends of one multiplied by 120, multiplied by

108
00:07:38,300 --> 00:07:38,720
three.

109
00:07:38,720 --> 00:07:40,460
So it should be quite a large value.

110
00:07:40,490 --> 00:07:49,100
So now it's three hundred and sixty as expected and same thing for the Y, so we can see that our velocity

111
00:07:49,130 --> 00:07:52,070
uncertainty is doing the correct thing with the system dynamics.

112
00:07:52,070 --> 00:07:53,690
It's changing.

113
00:07:54,590 --> 00:07:59,540
It's transforming the uncertainty in the appropriate way that represents the system dynamics.

114
00:08:02,320 --> 00:08:05,390
So we've looked at the uncertainty due to the process model.

115
00:08:05,560 --> 00:08:08,610
Now we want to know that you have a look at the process model noise.

116
00:08:08,620 --> 00:08:12,620
So this is the key metrics, part of the uncertainty equation.

117
00:08:13,270 --> 00:08:18,580
So we want to check that the process model noise, the acceleration uncertainty is operating as expected

118
00:08:19,450 --> 00:08:20,050
to do this.

119
00:08:20,060 --> 00:08:23,610
We're going to set the initial position and the uncertainties to zero.

120
00:08:24,130 --> 00:08:27,310
And we want to set a non-zero acceleration stand deviation.

121
00:08:27,310 --> 00:08:31,480
So we want the key metrics, the process model noise metrics to be non-zero.

122
00:08:32,290 --> 00:08:37,000
So when you run the filter, we should say that the total level of uncertainty in the system should

123
00:08:37,000 --> 00:08:38,230
be growing with time.

124
00:08:38,680 --> 00:08:44,440
Now, this means that the velocity uncertainty should be increasing linearly and the position uncertainty

125
00:08:44,440 --> 00:08:50,050
should be increasing quite radically as expected due to the system dynamics, because we know that position

126
00:08:50,050 --> 00:08:52,780
is a second integral of acceleration.

127
00:08:53,390 --> 00:08:55,690
So let's carry out this experiment, Velcade.

128
00:08:56,650 --> 00:09:00,540
So we're going to set our initial variances for position of velocity to be zero.

129
00:09:00,970 --> 00:09:03,400
But now we want a non-zero key matrix.

130
00:09:03,400 --> 00:09:07,630
So we're going to set this standard deviation of acceleration to be point one.

131
00:09:08,610 --> 00:09:11,290
So now when we run the simulation, we should say something different.

132
00:09:12,030 --> 00:09:15,280
We can see that the uncertainty in the system is increasing with time.

133
00:09:15,300 --> 00:09:21,140
So our three sigma so bubble here is increasing as the simulation runs.

134
00:09:21,660 --> 00:09:27,900
And if we look at our core variances now, we can see that our velocity era, that's increasing linearly

135
00:09:27,900 --> 00:09:32,790
with time and we can see our position and certainly increasing quite radically with time.

136
00:09:34,280 --> 00:09:37,520
So everything seems to be working as expected on this front.

137
00:09:39,840 --> 00:09:45,930
So the person's moral noise increases the uncertainty in the system to capture the stochastic nature

138
00:09:45,930 --> 00:09:47,260
of the system dynamics.

139
00:09:47,850 --> 00:09:53,310
Now, in this simple case where we have an object that starts at a known origin and moves at a constant

140
00:09:53,310 --> 00:09:59,850
velocity and there's no randomness, randomness inside the system, then it's not really all that important.

141
00:09:59,880 --> 00:10:01,380
This is why we the.

142
00:10:01,760 --> 00:10:06,380
So this is why we can set a key metrics to be zero, because there's no uncertainty in the system.

143
00:10:06,600 --> 00:10:13,290
The only uncertainty at the moment is around our initial guess of the position and velocity.

144
00:10:14,770 --> 00:10:20,080
So in general, when running a common field, all the key metrics or the process of noise can compensate

145
00:10:20,080 --> 00:10:26,260
for a common Philidor process model that does not correctly or accurately model the true system dynamics.

146
00:10:27,560 --> 00:10:33,020
And this works by increasing the uncertainty inside the system, which helps to cause a filter to stay

147
00:10:33,020 --> 00:10:39,440
consistent so that it helps to make the uncertainty around the estimates to actually include where the

148
00:10:39,440 --> 00:10:46,280
true state actually is, the presence of noise ties closely and with the measurement of noise and the

149
00:10:46,280 --> 00:10:47,350
performance of the filter.

150
00:10:47,600 --> 00:10:50,050
So we only cover this in a lot more detail later on.

151
00:10:51,690 --> 00:10:56,460
So hopefully now you have a better understanding of why we went about the different exercises in the

152
00:10:56,460 --> 00:11:02,190
way that we did, a key takeaway point from all this is that whenever we designing or implementing a

153
00:11:02,190 --> 00:11:07,110
common filter, if we have a simulation of what the true system is going to do, we should run that

154
00:11:07,110 --> 00:11:12,540
and run the method of prediction step to make sure the two are consistent or as consistent as possible.

155
00:11:13,470 --> 00:11:18,090
If we do this, then there's a good chance that the model we have selected for the common filter should

156
00:11:18,090 --> 00:11:20,910
be appropriate for the system in that mix that we're trying to estimate.

