• No results found

5 COMPONENT SET RESAMPLING FOR HIGH DIMENSIONAL STATE

5.2 Component set re-sampling

To alleviate the problem brought by the sample impoverishment and particle deprivation

problem we develop a new re-sampling called component set re-sampling. In this section we

describe the method developed in detail.

5.2.1 Motivation

In the standard particle filter re-sampling procedure, the entire system state is treated as a

whole when being re-sampled. The basic idea of the component set re-sampling is to break the

system state into sub-components and carry out re-sampling at the component level. In other

words, instead of re-sampling each particle as a whole as in standard particle filters, we divide

the state space into sub dimensions (named as components) and resample from the set of components to “construct” new particles. The component set re-sampling makes sense especially for the agent-based simulation model because the system state is composed from states of

individual agents, and each agent’s state variables can be treated as a component of the whole

system state. For example, for an agent-based model with two agents agent1 and agent2, one component would be agent1’s position and destination; another component would be agent2’s position and destination. With the component set re-sampling, the combinations among agents in

each particle are broken when being re-sampled. By reconstructing new particles with

components from different particles, the diversity of the sample space increases with the same

number of particles, because new combinations of components can be generated. We note that a

particle filtering algorithm with the component set re-sampling differs from the standard particle

filtering algorithm only in how particles are re-sampled. It does not change the weight

calculation of particles, that is, a particle is still treated as a whole when calculating its

calculation and normalization, we divide a particle into different components, all of which inherit

the same weight from the particle. For a particular component category (e.g., agent1’ state), the corresponding components from all particles form a component set. When reconstructing a new

particle, we select a component (according to components’ weight) from each component set for

all component sets to form a new particle.

5.2.2 Method illustration

To illustrate the component set re-sampling method, formally, let:

1, , , ,...,2 3 4

i i i i i i

m

x r r r r r

represents the system state of particle i, where m is the number of components in the system state (in our work, m is the number of agents in the system), and

i i i

j j j

r =< l ,d >

represents agent j’s state in particle i, i.e., agent j’s position and destination. Overall, the states of particle i consists of components r1, .r2 , r3, …, rm . Each component rji has the same important

weight that is inherited from the particle’s importance weight.

( ) i j r i i i t t t t wwp y x The component sets of N particles are defined as:

R1 ={ r11 , r12, r13 , r14 ,…, r1N } R2 ={ r 21 , r22, r23 , r24 ,…, r2N } R3 ={ r31 , r32, r33 , r34 ,…, r3N } … … Rm ={ rm1 , rm2, rm3 , rm4 ,…, rmN }

, where eachrji has an associated i j r t

w . With these components sets, a new particle is constructed

as: i i i i i i t 1 2 3 4 m x = r ,r ,r ,r ,...,r  , where ( ) i k k rselect R

and select (X) is the function of multinomial selection to select a component from set X according to the weight assigned to the components. Fig 5.1 illustrates how the component set

re-sampling works. In this example, there are 3 particles (P1, P2 and P3) where each particle is

composed from 3 components l1, l2, and l3 (in the figure, li j represents the component li in

particle Pj). Assuming the weights of the three particles P1, P2 and P3 are WP1, WP2, WP3

respectively, we have WP2>WP1, and WP1=WP3 . In (a), the standard re-sampling is used where

the 3 particles are selected according to their weights. In this example, P1 is selected once and P2 is selected twice. In (b), the component set re-sampling is used where re-sampling is carried out

at the component level. The three vertical dashed boxes represent the component sets for l1, l2,

and l3, respectively. As can be seen, each component set is re-sampled vertically and then

recombined together to form a new particle. In this example, since P2 has the highest weight, the

components from P2 yield higher probability to be selected.

(a) Standard Re-sampling (b) Component set Re-sampling

Figure 5.1 Comparison of standard re-sampling and component set re-sampling The component set re-sampling procedure is summarized as follows:

Component Set Re-sampling

Re-sampling step:

Input: The set of particles {x1: it;i 1,..., N} with associated weights{wt i ;i 1,..., N} ;

Output: A new set of particles {x1: it;i 1,..., N}

1. Normalize the weights according to:       1 i i t t N j t j w w w    2. For i= 1 to N

Divide state space into m components

x

i

r r r r

1i

, , , ,...,

2i 3i 4i

r

mi

; Assign weight ( ) i j r i i i t t t t wwp y x to each component rji; End for

For each component rki , k=1 to m

create a component set Rk so that:

Rk ={ rk1 , rk2, rk3 , rk4 ,…, rkN }

End For For i=1 to N For q= 1 to m

select a component from Rq according to components’ weights i q

q

r ~ {R ;i = 1,...,N} for particlexit;

End for

construct the new particle i i i i i i

t 1 2 3 4 m

x = r ,r ,r ,r ,...,r 

End for

Figure 5.2 Algorithm of component set re-sampling

The component set re-sampling diversifies the sample space with a limited number of

particles. However, it also brings an issue: when dividing the state space into components, a

“good” particle with the right combination of components may be broken during the re-sampling procedure. Furthermore, when different components of the system state have dependencies over

each other, a newly constructed particle may not hold the dependencies among the sub- components and thus results in “invalid” state from the system point of view. To ensure the robustness and correctness of the particle filtering algorithm, we propose to combine the

component-set re-sampling and the standard re-sampling to take advantage of both. Specifically,

standard re-sampling and re-sample the rest of particles using the component set re-sampling.

The goal of the standard re-sampling is to ensure the robustness and correctness of the algorithm,

and the goal of the component set re-sampling is to diversify the sample space with limited

number of particles. In our work, we have set that 20% of the particles are re-sampled from the

standard re-sampling and 80% of the particles are re-sampled from the component set re-

sampling. We note that these percentage numbers are empirically determined based on

experiments for the agent-based model. In our application, the dependencies among the different

agents are relatively weak and thus the majority particles are re-sampled from the component set

re-sampling. We expect for different applications different percentage values should be used in

order to achieve best performance. A guideline about what percentage values to use can be

established based on the level of dependency among sub-components, and that is considered as

future work.

The final re-sampling procedure is named as the mixed component set re-sampling and is described below, where we assume the total number of particles is M, among which U particles are re-sampled from the standard re-sampling and V particles are re-sampled from the component set re-sampling. We note that the standard re-sampling procedure can be thought as a special

case of the mixed component set re-sampling when U=M.

Mixed Component Set Re-sampling

Resample particle set with M=U+V particles

1. For particle xt1…xtV

Generate particles using Standard Re-sampling End for

2. For particle xtV+1…xt M

Generate particles using Component Set Re-sampling End for

Figure 5.3 Mixed component set re-sampling

With the component set re-sampling enabled, the overall data assimilation procedure for

particles where each particle has the same number of agents as the number of occupants in the

real system. Initially, the position of each agent in each particle is randomly distributed over the

2D smart environment. In each data assimilation step, it first uses the state transition function

defined in section 3.2 to draw new samples by forwarding the state of each particle for a period

of time Δt, where tis the time from the last data assimilation step to the current data

assimilation step; the particles are then re-sampled using the mixed component set re-sampling.

This algorithm is summarized as follows:

Data Assimilation based on Particle Filter

1. Initialization. t = 0

For particle i=1, …, N,

randomly assigning agents’ positions and destinations in particle i; Generate routes

Set t=1

End For

2. Sampling

For particle i =1, …, N

Run t steps of simulation based on ABM model

End For

For particle i=1, …, N

calculate weights using (3)(4)

End For

3. Re-sampling

Resample with replacement N particles using the mixed component set re-sampling

Set t t 1 and go to step. 2

Figure 5.4 Particle filter algorithm with component set re-sampling enabled