Alignment is used in dynamic microsimulation to keep the simulation outcome in line with external targets. One
important thing to note is that the processes to be aligned are
executed at an individual level, while alignment always takes place at
the population level. That is, individual outcomes or probabilities are
determined for each individual based on the chosen econometric
specification and the estimated coefficients. This in general leads to a
mismatch between the simulated (provisional) totals and the aggregate
targets, which can of course be assessed only at the population level.
The alignment algorithm then directly modifies the individual outcomes
or probabilities of occurrence.
We introduce the Multiple Choice alignment methods available in JAS-mine (section A) , followed by a description of the binary alignment methods available (section B), concluding with an introduction to alignment with variable agent weightings (section C). The earliest alignment techniques implemented in JAS-mine fall into the category of binary alignment. Version 3.2.0 of JAS-mine introduced the possibility of multiple choice alignment by implementing the Logit Scaling alignment method of Stephensen (2016). Logit Scaling (LS) is an alignment technique that is theoretically optimal in that it minimizes the information loss i.e. distortion (as measured by the relative entropy) in the process of aligning probabilities to given targets. In addition, it is computationally efficient and quick to run. The method is implemented using the 'Bi-Proportional Scaling' algorithm that quickly converges to the solution of the problem. This involves representing the set of state probabilities for all individuals in a population as a two-dimensional matrix, with each row representing an individual 'i', and each column representing a particular state 'a' (the choice or outcome of the process to be aligned). The matrix undergoes an iterative process whereby: 1) the sum of each column of probabilities is scaled to match the alignment target, which is the expected (mean) number of individuals in the state 'a' that the column represents; 2) the sum of each row is then scaled to equal 1 (as the sum of state probabilities should always equal 1, i.e. the individual must be in one particular state at any moment in time). Steps 1) and 2) are then repeated in sequence until the system converges. Not only does Logit Scaling alignment minimize the distortion to the probability distributions of the individuals while obtaining the alignment targets, but it has a number of useful features including the ability to retain zero probabilities (i.e. impossible events), a symmetric formulation where neither outcome (or choice) has a favoured status in the algorithm, and moreover the ability to handle more than just two choices (which the following alignment algorithms are all restricted to doing). Logit Scaling is the clear choice for any user wanting to perform multiple choice alignment in JAS-mine. Here is an example of how the multiple choice Logit Scaling alignment
could be implemented in a JAS-mine model where there are three potential
outcomes (note the last argument is an array containing three elements
that sum to 1). new LogitScalingAlignment<Agent>().align(
// collection // alignment probability closure for multiple choice alignment new AlignmentMultiProbabilityClosure<Agent>() { @Override public double[] getProbability(Agent agent) { return agent.getProb(); } @Override public void align(Agent agent, double[] alignedProabability) { agent.setChoice(RegressionUtils.event(Choice.class, alignedProabability)); } }, new double[]{targetShareA, targetShareB, (1.- targetShareA - targetShareB)}); } In addition to Logit Scaling alignment, there are six binary alignment methods implemented in JAS-mine:
Implementation of (1)-(4) is based on Li and O’Donoghue (2014) (Jinjing Li kindly provided the Stata code used in that paper), while implementation of (5) closely follows Richiardi and Poggi (2014) and Leombruni and Richiardi (2006). (1) Multiplicative scaling involves undertaking an unaligned simulation using Monte Carlo techniques and then comparing the proportion of transitions with the external control total. The average ratio between the desired transition rate and the actual transition is used as a scaling factor for the simulated probabilities. The method ensures that the average scaled simulated probability is the same as the desired transition rate. The method, however, is criticized by Morrison (2006) as probabilities are not guaranteed to stay in the range 0-1 after scaling, though the problem is rare in practice as the multiplicative ratio tends to be small. (2) The Sidewalk method was first introduced as a variance reduction technique, which was also used as an alternative to the random number based Monte Carlo simulation. It keeps a record of the accumulated probability from the first modelled binary outcome to the last. As long as there is a change of the integer part of the accumulated probability, the observation is assigned with an outcome value of 1. Sorting based alignment algorithms involve sorting of the predicted probability adjusted with a stochastic component, and selects desired number of events according to the sorting order: (3) SBD sorts by the difference between the predicted probability and a random number in (0,1), while (4) SBDL sorts by a logistic transformation of the predicted probability. Both SBD and SBDL introduce a significant distortion in the estimated probabilities and their use is deprecated. However, they are included for replication exercises. (5) Resampling involves drawing again the event, without altering the predicted probabilities, either for agents who have experienced the transition (if too many transitions have occurred) or for agents that have not experienced the transition (if too few events have occurred), until the target is reached. (6) Implementation of binary Logit Scaling (LSb) closely follows Stephensen (2016) and the description of the Bi-Proportional Scaling algorithm above, however it exploits the two-state property of the system to simplify the algorithm. Li and O’Donoghue (2014) analyze three other binary alignment algorithms:
SNT and CLT have not been implemented yet in JAS-mine as they are relatively more complicated and run much slower than the other methods; SBP has not been implemented due to its theoretical shortcomings and poor empirical performances (see Li and O’Donoghue, 2014). Here is how the SBD alignment is implemented in the Demo07 model, using the JAS-mine classes: new SBDAlignment<Person>().align(
); C. Alignment with Weighting
ReferencesLeombruni R, Richiardi M (2006). "LABORsim: An Agent-Based Microsimulation of Labour Supply. An application to Italy." Computational Economics, vol. 27, no. 1, pp. 63-88Li J, O'Donoghue C (2014). “Evaluating Binary Alignment Methods in Microsimulation Models”. Journal of Artificial Societies and Social Simulation, 17(1): art. 15. Richiardi M, Poggi A (2014). "Imputing Individual Effects in Dynamic Microsimulation Models. An application to household formation and labor market participation in Italy." International Journal of Microsimulation, 7(2), pp. 3-39. Stephensen P (2016). "Logit Scaling: A General Method for Alignment in Microsimulation models." International Journal of Microsimulation, 9(3), pp. 89-102. |