• No results found

8.5 Simulation

The main target of the simulation is to achieve proof of concept, thus to show the qualities of the new method. The results are compared with the currently used monotone constant interval update in a fair way. The analysis includes many parameters for the performance of the algorithm. The simulation shows the advantages and the practical difficulties. A benefit of the simulation is also the possibility to test the algorithm with different threshold values, so that the limits of the method can be found.

8.5.1 Simulation structure

The MATLAB 7 software is used for the simulation. The software is very suitable for this type of simulation. On the one hand, it provides many integrated mathematical functions: array sorting, histogram, approximation etc. On the other hand, it is a flexible programming language for creating non-standard functions. The simulations are done on PC hardware: AMD Athlon, 512 MB RAM and 1.15 MHz CPU.

The simulation is offline using the update/Event Intervals rather than absolute time, thus the clock is not used, see 8.5.2. The code efficiency is out of scope for this simulation. The stress is the accuracy of the predicted values, thus the minimum number of updates with smallest possible error (disconnection).

The simulation focuses on gathering statistical information for predefined Event Time Points (ETPs). Therefore, the structure of the code is inverse to the real implementation. The simulation code calculates for given Event Time Points the needed Update Time Points, Measured Intervals etc. The structure of the code is presented in Figure 8.8. It consist of six main blocks, their purpose and implementation are as follows:

Initialisation The semi-random intervals are generated in this step. Five representative semi-random cases are used in this thesis, see 7.5.1. The intervals correspond to the distance between the Event Time Points (ETPs). The Event Intervals (EI) are relative to the start of the filter cycle and the intervals are relative to each other. Intervals between the ETPs can be generated in advance. In contrarily, the start of the filter cycle depends on the quality of the estimation and cannot be pre-calculated. The Absolute EIs (AEIs) must be calculated systematically, thus cycle after cycle. The intervals between the ETPs are converted to EI using subtraction of remainder, explained later in this chapter.

Location Update measurement The procedure finds the Update Interval where the event occurs. Then it calculates the error, i.e. the disconnection time. The Maximum Disconnection Interval (MDI) is the size of the Update Interval (UI) with ETP. The estimated value is in the middle of the UI. The number of updates needed to detach the event are calculated in order to get the method qualities. All values are stored in an array for later statistical analysis.

Figure 8.7: Reminder UTPp ETPk-1 Initialised Intervalk Reminder time ETPk UTPp-1 UTPp+3 Event Intervalk Kthfilter cycle

8.5 Simulation 145

A remainder is used to align the Event Intervals and Relative Update Intervals in the filter cycle. It converts the initialised intervals to EI. Basically, it is the difference between the initialised intervals, the ETP, and the following UTP, see Figure 8.7. It is executed before every filter cycle of prediction. Otherwise, the Event Interval is unknown in the filter cycle.

Update Procedure The particle weights are updated considering the new measured value in this block. The procedure is a straightforward implementation of the algorithm: addition of the weight with the conditional distribution expressed by Gaussian distribution.

Normalisation The weights are normalised if the maximum weight has reached a certain threshold value. The weights are divided to their sum, see 8.4.4.

Prediction If there is knowledge of the natural model (Hidden Markov Model), a prediction of the new particle position is carried out. In our simulation there is zero knowledge about the model, thus the predicted particle value is the same as the current one.

Analysis This part presents variables important for comparing the quality of the results. The four diagrams explained in 8.6 are used to present the results.

8.5.2 Periodic behaviour dependent of the absolute time

The filter prediction mechanism uses only intervals between the events not considering the absolute time. The simulation code does not correspond to real implementation, where the absolute time can be considered.

The performance of the algorithm can become poor when the Event Time Points dependend on the absolute time. The PDF cannot be built in the correct way, since it considers the intervals between the ETPs. For example: a mobile device owned by a daily worker. An active time is between 8:00h and 19:00h, where there are more events. There will be less Event Time Points after 22:00 to 6:00h. An inadequate PDF will be built if only the intervals are considered. The small size interval will dominate the PDF and small Update Intervals will be executed even in late hours. The performance of the algorithm will be even poorer than a constant interval since significant input is not considered in the simulation.

Move a particle ?

Select next ETP change sample Select next ETP

change sample ETPs generation ETPs generation EI calculation, remainder EI calculation, remainder UTPs calculation UTPs calculation Max error, measurem., rem. Max error, measurem., rem. Normalisation Particle weigths

Particle weigths Update

Partilce moving Partilce moving [true] New particle weights New particle weights Measurement Prediction particle (optional) Prediction particle (optional) Prediction Figure 1 EI and MI Figure 1 EI and MI Figure 2,3

Error histogam and distribution

Figure 2,3

Error histogam and distribution Figure 4 PDF of EI and filter Figure 4 PDF of EI and filter [false] [false] [true] Normalisation needed ? Last ETP? [true] [false] Analysis Initialisation Constants Constants Start Stop

8.6 Simulation results