A simple agent-based spatial model of the economy: tools for policy

This study simulates the evolution of artificial economies in order to understand the tax relevance of administrative boundaries in the quality of life of its citizens. The modeling involves the construction of a computational algorithm, which includes citizens, bounded into families; firms and governments; all of them interacting in markets for goods, labor and real estate. The real estate market allows families to move to dwellings with higher quality or lower price when the families capitalize property values. The goods market allows consumers to search on a flexible number of firms choosing by price and proximity. The labor market entails a matching process between firms (location) and candidates (qualification). The government may be configured into one, four or seven distinct sub-national governments. The role of government is to collect taxes on the value added of firms in its territory and invest the taxes into higher levels of quality of life for residents. The model does not have a credit market. The results suggest that the configuration of administrative boundaries is relevant to the levels of quality of life arising from the reversal of taxes. The model with seven regions is more dynamic, with higher GDP values, but more unequal and heterogeneous across regions. The simulation with only one region is more homogeneously poor. The study seeks to contribute to a theoretical and methodological framework as well as to describe, operationalize and test computer models of public finance analysis, with explicitly spatial and dynamic emphasis. Several alternatives of expansion of the model for future research are described. Moreover, this study adds to the existing literature in the realm of simple microeconomic computational models, specifying structural relationships between local governments and firms, consumers and dwellings mediated by distance.


INTRODUCTION AND LITERATURE
T HE Brazilian tax system is paradoxical, with high taxes, dual tax systems (taxes and contributions) and fierce fiscal war between federated members [1]. The complexity of the tax system becomes more obvious and striking when considering the subnational entities. The post-1988 constitutional decentralization imposes the same competences to very hetero- geneous municipalities [2]. Municipalities that have different administrative, technical, and political capacities; besides their inherently differentiated borrowing leverage [3]. This heterogeneity among municipalities occurs not only in relation to budgetary magnitude, but also with regard to the disparity between central and peripheral municipalities in metropolitan and regional context [4], [5]. Indeed, Furtado et al. [6] identified that there are significantly fewer resources to metropolitan peripheral municipalities vis-à-vis the central city and nonmetropolitan municipalities. The authors also suggest that such municipalities are administratively inefficient, with higher expenditures and poorer results. In addition to this reduced administrative and financial capacity, peripheral municipalities still have worse quality of life and higher levels of violence [7], [8]. There is a huge amount of literature on public spending efficiency [1], [9], [10], which contains actual policy propositions [11], [12], is descriptive [13], and of a high-quality level. However, few exercises emphasize the prospective analysis that simulates future effects of present public policy change [14], [15], especially for the case of Brazil and its subnational entities. Computer simulation models for macroeconomic analysis and taxes [16], [17], [18], banking and finance [19], [20], [21], stock exchange [22], [23] and energy market [24], to name a few applications, abound. These studies were developed from the seminal works of Anderson, Pines and Arrow [25] and Arthur [26]. Recently, advances in this literature includes models that discusses bank interconnections by means of network analysis and systemic fault possibilities [27], [28], [29] This abundant literature, however, looks at specific markets (banking, energy or exchange markets) or seek to represent markets and its agents and processes in detail, so that they quickly become complex and demanding high computing power [30], [31].
Simple models that intend to model the interaction among actors in short-term spatial scales are rare. Tesfatsion [32] makes an initial proposal of a model with two products (hash and beans) whereas Straatman et al. [33] proposed a framework that simulates a market auctions linked to a production model that together result in a simple model, but complete and micro founded.
Lengnick [34] expands the work of Gaffeo et al. [35] and proposes a model that simulates macroeconomic variables, contains elements of real estate and goods and labor markets. As detailed below, our proposal is based on Lengnick's model, but makes several changes, including explicit space in the housing market, and subnational administrative regions.
Given this framework, this paper proposes an agent-based model that is able to replicate basic elements of an economy, its markets, its players and its processes as simple as possible, enabling spatial and dynamic analysis of the central economic mechanisms. The intention is to understand the mechanisms that generates the observed data, so that prospective analysis can be made. Specifically, the research question is to identify whether the change of administrative boundaries and the consequent change of local tax revenue dynamics, in principle, alters the quality of life of the citizens.
In addition to answering the research question, the contribution of this study is the explicit construction of a computational algorithm that can be configured as a 'simulation engine of the economy'. The paper can be said to be a modular laboratory on which small changes and additions can be applied in order to amplify research possibilities. Thus, the fourth section includes specific examples of future applications of the model in addition to the exercise done in this text.
The model adds to the literature as an adaptation and advancement of the approach proposed by Lengnick [34]. The main contribution is the inclusion of local governments to collect taxes and provide public services. However, the proposed model has a different objective from the original. Whereas Lengnick seeks to study effects on macroeconomic variables of small shocks of monetary policy, this model emphasizes the spatial differences among different administrative regions that collect taxes and invest in their own regions through public service provision, hence promoting the improvement of quality of life of local people. Moreover, the design of the model is also innovative, changing a fixed dwelling structure into one in which families move in search of homes and regions either with better quality of lifeà la Tiebout [36] or that best suits their current income status. 1 Another important distinction of our model is the absence of a network-like structure that establishes the interactions of the labor market and the goods market. In our model the interactions in these markets take place through prices and the distance between the dwelling and the 1. See Pinto's [37, p. 75] discussion: "The decentralization and fragmentation of the territory poses alternatives for consumers of collective services who cannot buy services individually, but may buy a package of services and goods that are more preferable". firm. Finally, the entry into the labor market is restricted only by age and open to all members of the family, whereas in Lengnick [34] it is exclusive of the head of the family.
Hence, this paper proposes a simulation model of the economy which is based on previous literature, but advances in the specific area of simple microeconomic models, introducing local governments and explicit spatiality of markets.
Besides this introduction, the text includes the presentation of the model (section 2), followed by the presentation and discussion of the results (section 3) and the proper sensitivity analysis. section 4 specifies possibilities of further development of the model that can be easily applied, justifying the work as a theoretical and methodological 'proposal'. section 5 presents the final considerations.

OGY, FEATURES AND PROCESSES
In order to model the collection of local taxes and the provision of public goods to evaluate and compare policy options an agent-based model of a simple economy is presented. We propose a model with heterogeneous agents, dwellings, firms and governments, each with attributes, location and specific processes attached. After the description of the theoretical model, a numerical simulation is applied to the set of parameters, its robustness is verified by a sensitivity analysis and the results for specific periods of time are computed.

Literature
The economic analysis based on agent-based models has its methodological groundwork laid by the 'Sugarscape' model, developed by Epstein and Axtell [38]. Before that, agentbased models were discussed in the context of social segregation in the classical work of Nobel author Thomas Schelling [39]; on the seminal framework of game theory and cooperation strategies [40] and social [41] and economic sciences [42], [43]. Furthermore, complete microsimulations models of the labor market were reported much earlier by Bergmann [44] and Eliasson [45].
More recently, agent-based models have been applied to learning and behavior studies, coalition and cooperation [46]; artificial intentionality [47] and education and cognition [48], [49] 2 . A recent milestone in economics is the text of Boero et al. [51] which offers a conceptual and methodological description, along with applications for human capital development, network analysis, the interbank payment systems, consulting firms, insurance systems in health, ex-ante evaluation of public policies, governance, tax, and cooperation.
The methodological steps of ABMs with an emphasis on interpretation of empirical data are described by Hassan et al. [52]. Two central aspects of the methodology are verification and validation [53], [54]. The verification step assesses whether the adopted algorithm effectively does what the modeler and the developer planned. That is, it checks the adequacy of the intention of the algorithm against its factual implementation [55].
The validation process refers to the use of historical data to assess whether the model can minimally replicate known trajectories. It verifies that the model contains the essence of the phenomenon. Once validated, the model can be used to indicate future trajectories. Zhang et al. [56] illustrate this process for the adoption of alternative car fuels.
One methodological principle of this modeling process is that the decisions made and the steps of the model are known, understood and comparable. The scientific community suggests two procedures (a) the adoption of protocols, such as the Overview, Design concepts, and Details protocol (ODD), described by Grimm et al. [57], [58]; and (b) the availability of the source code. The code used in this study is available and can be requested to the authors. 3 The PseudoCodes are available as appendices.
The ODD protocol is also available as Appendix section D of this work.

Attributes of the model: processes and rules
This section describes the model, its characteristics, assumptions, processes, steps, intentions and limitations. Intuitively, we describe the decision-making processes that govern the dynamics of the model. The literature that underlies the choices are listed in the processes.

Classes
The model was developed using the concept of object-oriented programming (OOP) in Python, version 3.4.4. 4 The following section describes the initial values and allocation processes; the breakdown of markets, the government, the spatial and temporal sequencing of the model. Then, we present the implementation, parameters and limitations of the model.

Classes -initial values
The model contains five main classes: agents: citizens, bounded into families; dwellings, firms, and governments. The agents' features are drawn from a uniform distribution and includes age, years of schooling (qualification) and an initial monetary amount.
Dwellings have different sizes. Their prices are a function of its size and the value of the square meter given by its location. Firms are also located randomly in space and start the simulation with some capital.

Allocation of agents into families
The modeler determines the number of agents and the number of families of the model exogenously. The allocation process is random. An agent who has not been allocated is chosen along with a family and the link is made. Thus, the proportion of agents per family is endogenous and variable. Agents maintain the same age throughout the simulation.
Initial allocation of families into dwellings Before simulation begins, families are randomly allocated to dwellings that are vacant. 4. For an introduction in Python, see Downey [59] 2.2.2 Real estate market When the simulation is already underway, the process of modeling the real estate market is as follows: Given a parameter chosen by the modeler, say 0.07, that portion of the set of families monthly enters into a randomly composed list of 'families on the market' in pursuit of new residence [60]. At the same time, vacant dwellings are selected. 5 Residential prices P t,i are monthly updated, given the price in the previous month P t−1,i and the percentage of change in the Quality of Life Index ∆IQV r of the region where the residence is located.
The quality of the dwelling Q i is based on the size of the residence s i which is a fixed value and on the current Quality of Life Index [61], [62] and it serve solely as a choice criteria for the new residence. 6 Two alternatives are available for families who are on the market. Families whose total financial resources is higher than the median of all families will look for houses with higher quality and will conclude the purchase if the value of the current family home P i(s,r) added to the cash available Y is higher than the value of the better quality house intended P i(s,r) +Y > P j(s,r) . On the other hand, families whose available resources are less than the median of families' wealth will look for cheaper homes P i(s,r) > P j(s,r) , so that they acquire new cash [63], [61]. When observed the conditions, the change of address is made and the difference, if moving into more expensive homes P i(s,r) − P j(s,r) , or payback P j(s,r) − P i(s,r) is computed on the family budget. The houses whose families moved become vacant.
Thus, a portion of the families are always looking for larger or better quality homes, located in the best areas, when they have the financial resources and the other portion of 5. The number of dwellings should always be larger than the number of families, for this version of the model. 6. That is, properties' prices are defined by their own features, plus local attributes. families are in search of cheaper homes from which they can capitalize.

Firms: production function and prices
The firm's production technology is fixed and the production function depends on the number of workers l f , their qualification E k and an exogenous parameter α that determines productivity. 7 The production is updated daily according to the above equation. In this model there is only one product per firm.
Firms: decision-making about price adjustment The literature confirms the rigidity of prices and the difficulty of managerial decisionmaking about the process of changing prices [64], [65]. In the proposed model, the initial price is set as the cost price. Firms change their prices according to inventory levels [44]. 8 When the level in stock q is below the level given by the exogenous parameter δ, prices are adjusted upwards, in the amount stipulated by another chosen parameter φ. This parameter is exactly the mark-up chosen by the firm. When the amount is above the chosen level, prices go back to cost price. That is, when demand is low the mark-up is zero. This proposal follows the survey results, conducted by Blinder [65], which indicates that only a small portion of firms readjusts prices downwards.

Goods market
Given that not all family agents are part of the working population, the family's total resources are equally divided among family members before the decision to consume. Each customer then chooses a value for consumption ranging between 0 and their total wealth w i , 7. Adapted from [34], [18], [35]. 8. Bergmann [44] uses cost and profit information in addition to stock levels to determine price changes. Dawid et al. [16] use stock levels to define production quantity. discounted by an exogenous factor of propensity to consume β [66].
The family then carries out two calculations. Given the market size parameter Γ, for example, of five firms, each agent searches among these firms, the one with lowest price [67], and the one with the shortest distance of the agent's residence [68], [69]. Randomly, the agent chooses between lower price and shorter distance. Intuitively, sometimes it is worth the effort to go further to find the lowest price, sometimes one chooses closer, though not necessarily cheaper.

Labor market Wages
Wages are defined as a fixed portion k 9 multiplied by the employee qualification E i elevated to a parameter of productivity α. The parameter α is the same parameter of the company production function. This decision is harmonious to the fact that more skilled workers also produce more (in the proposed model).
Thus, better-qualified (and more productive) employees have better pay.
Labor market The firm makes decisions regarding hiring and firing randomly, on average, once every four months, according to an exogenously set parameter .
The selection is made through a public advertising system. Interested companies become part of a list. Employees between 17 and 70, who are currently not employed, repeatedly, apply themselves to the labor supply list.
Then, there is a matching system between company and employee, so that the randomly selected firm chooses the most qualified employee or the one who lives the closest [71]. Once the matching has been made, the firm and the hired employee are removed from the list of public announcements and a new round of wage, distances and qualifications ranking 9. For this specification of the model, k was set to 0.65 is made. And so on, until there is no more interested firms or available employees. 10 When making firing decisions, the firm just randomly chooses an employee and let him or her go.

Government
Local governments in each region collect a tax on consumption τ , at the time of purchase in accordance with the location of the firm conducting the sale. The rate is determined by an exogenous parameter. Every month, the governments of each region r completely transform the resources per capita collected in linear increases in the Quality of Life Index [66]. That is, the QLI is a linear result of the summed sales of firms in a given region, weighted by (everchanging) population dynamics (N r ).
In the model proposed in this paper, three alternatives of government administrative designs are proposed. They are detailed in item 2.3.

Model sequence
The model follows the temporal distribution proposed by Lengnick [34], which consists of 21 days to make a month, months are added to quarters and then to years. The sequence of actions occurs with the simultaneous interaction of various classes (see Table 1). The model sequence can be described as follows: 1) The modeler defines whether the system should be configured with one, 4 or 7 regions. The simulation parameters (see section 2.4) and the run parameters can be changed. 2) Regions, agents, families, households and firms are created, given the parameters provided. 3) Agents are allocated to families and families are allocated to dwellings. 4) Before the actual start of the simulation time, the initial framework includes the 10. Neugart et al. [72] have discussed matching mechanisms for the labor market bu ponder that there is insofar no concensus about the best procedure. creation of one product by firm and an initial round of hiring. 5) When the simulation begins, the production function is applied everyday for all firms. 6) At the end of each month: a) Firms pay wages; b) Households consume and (in the same transaction) governments collect taxes; c) Governments apply their available resources into the update of QLI; d) Firms update their profits, given their last quarter capital; e) Firms update product prices; f) If necessary, firms post job offers or fire employees; g) Unemployed workers offer themselves for the vacancies and the matching process is carried out; h) A share of the families enter the housing market and perform transactions.
7) Every quarter, companies report profits for the period

Indicators and iterations
For this paper, the results were obtained with 1,000 iterations for each spatial divisions (one, 4 and 7 regions).

Spatial emphasis of the model
The model has a clear emphasis on its spatial aspects, as space is central to answer the research question. Calculation of the distance (and accessibility) is present in two moments: (a) at the choice of the employee by the firm and (b) when the consumer chooses between price and (easy) location. As a share of families is relocating, these distance calculations are dynamic and change the relations among firms and consumers and firms and workers every month. That is, firms and dwellings are fixed, but families move constantly, ensuring the spatial dynamics of the model. Table 1 Sequencing and interaction between classes and temporal dynamics of the algorithm. Start processes at 'setup' and 'day 0', followed by days that add up into months and months into quarters, successively, until the period determined by the modeler.
Items with an asterisk indicate the need for exogenous parameters Furthermore, the QLI is a linear and spatially compartmentalized reflection of firms sales in each region. This same QLI, in turn, affects the prices of dwellings. Thus, the housing market and the goods and labor markets are all spatially linked.
Besides the presence of spatial interaction in the processes themselves, the model also differentiates the applied regions design, according to the scheme of Figure 1. The figure shows the coordinates of the central point (0, 0). Along the four directions, the boundaries can be established by parameters. This study uses the parameters 10, -10, 10, -10, for the North, South, East and West directions, respectively.
Three different design were used and are applied by changing the number of regions η. If η is equal to 1, the model runs with only one region, with code 0, which encompasses the entire space. With η equal to 4, the model runs with four regions, with codes 0, 1, 2 and 3, and region 3 covers the entire area of subregions 3, 4, 5 and 6 in Figure 1. And finally, with seven regions, the model follows the configuration of the codes of Figure 1, with four smaller regions and three larger ones.

Model implementation and parameters
Running the model is simple and done with just one command. Optionally, the modeler can set the parameters for each simulation and for the run itself, as described below. A systematic analysis of the parameters that assesses whether small changes significantly affect the results and seek to confirm the robustness of the model (sensitivity analysis) is made after the presentation of results. For each simulation run you can choose the number of agents, families, households, the time duration in days, the number of local governments in which space is divided (namely, municipalities, with competence over their territory) and the path file to save the results (??).
The proposed model contains a very small number of exogenous parameters. The parameters help understand how the model mechanisms influence its results. Parameter α, for example, can be set to 1 so that its effect is zero. By reducing the parameter successively by 0.1, one can observe the effect of increasingly less productive workers. The same understanding of relevance can be made with the β parameter, or the rate of consumption tax. This construction offers some flexibility to the modeler. This flexibility is most relevant if the goal is to increase understanding of the problem that is modeled and the model is used as a guiding tool for decision-making, or as a methodology to discuss 'what if' questions.

Limitations
The limitation of this study arises from the difficulty of finding complete, integrated, and simple models that could be used as initial steps to be expanded and adapted by following researchers. In fact, despite the models of Lengnick [34] and Gaffeo et al. [35], all others are specific to a single market, such as energy [73], finance [74] or labor market [75]; or are too complex [76], [30].
Thus, the task of investigating a specific phenomenon (in this case, the spatial influence of consumption taxes), under a single integrated model, requires that all processes (firm production firm, goods and labor market) and all its associated parameters are explained, theoretically sound and numerically compatible. In practice, this requires that the modeler get results that are consistent with the literature for indicators such as inflation, GDP growth, unemployment, household income, simultaneously and temporally consistent.
The question put to modelers is of an epistemological nature. How can we determine which are the central elements of the phenomenon, which must be present, and what are the accessory elements? At what point, simplifying the process can take place and where there is significant change of the observed phenomenon?
Besides this general limitation, this version of the model also does not include the credit market, demographic changes nor investment in social capital.

RESULTS AND DISCUSSION
The most thriving economy is the model with seven regions (Figure 3), on average with median GDP only 30% higher when compared to the model with four regions. This model with four regions, in turn, achieves results that are 38% above the model with a single region (Figure 2). The variability is higher for the model with seven regions, vis-à-vis the one region model (Table 3 and Figure 4). Table 2 Parameters of the simulation (that define each run) and exogenous parameters of the model.   Considering the labor market, the economies converge towards full employment,  keeping a cycle of very low unemployment, throughout the period, for the three regional designs show similar results ( Figure 5 and Figure 6). Household income varies significantly among the three regional designs, for one region ( Figure 7) variation is of lower magnitude when compared to the model with seven regions ( Figure 8) through 1.000 iterations. The   (Table 3 and Figure 6). Although the dispersion is higher for the model with seven regions, the value of the first quartile is slightly less than the median with a single region (Figure 9).

Simulation parameters Values Possibilities' intervals Observations
The Gini coefficient is computed on the utility of the families. Utility is directly proportional to the cumulative consumption of the families. The GINI coefficient reaches a higher level in the model with 7 regions when compared to the two other models ( Figure 10). Moreover, the behavior of the coefficient in the 1,000 iterations has a similar pattern of variability ( Figure 11 and Figure 12) with slightly higher standard deviation.
Finally, the basic indicator to compare the   . BoxPlot of families' wealth for the last month of the simulations, 1,000 iterations, for the three regional designs Figure 10. BoxPlot of the Gini coefficient for the last month of the simulation, 1,000 iterations, for the three regional design. Figure 11. Results for the Gini coefficient, 1,000 iterations, one region.
performance of the models is the Quality of Life Index for each simulated design for one region ( Figure 13) and for seven regions (Figure 14). The median and the quartiles are higher for the model with seven regions vis-à-vis the other models ( Figure 15). The model results indicate that changes in administrative boundaries have led to robust changes among the three considered region design. According to the procedures described, the dynamism of the real estate market, namely, household mobility in the simulations with more than one region, was relevant to the results.   In the absence of a credit market, families Figure 15. BoxPlot of the QLI, for the last month of the simulation, 1,000 iterations for the three regional designs.
with income level below the median become sellers in the real estate market. Thus, these families capitalize on the sale of homes whose prices increased along with the quality of life in the region, and migrate toward regions with poorer quality. This movement is partly counterbalanced by families trying to migrate in search of better quality.
As a result, the models with subdivisions lead to regions that are less populated and have better quality of life and at the same time, more populated regions that have worse QLI (Table 4). Table 4 Median and standard deviation of the maximum and minimum regional values for each simulation for QLI and population, 1,000 iterations, by regional design. Finally, it is noteworthy the trade off between the results for the three models. While the model with seven regions is more dynamic, more productive and wealthier, it is also more heterogeneous. The model with one region, in turn, is more harmonic but less vigorous.

Regions
The underlying assumption of the authors that the model with one region would be more efficient from the standpoint of conurbation regions was not observed with the present configuration. Especially given the strength and mobility of the real estate market that concentrates smaller populations in regions with higher quality and larger populations in areas with poorer quality. However, the research question that is, if administrative boundaries influence the economic and fiscal dynamic of the regions can be confirmed.
Yet, the results indicate the wealth of possibilities of analysis of the economic system from heterogeneous agents and firms in an environment that is continually changing.
Finally, given the process of creating artificial economies, at each loop iteration the agents and firms are completely different. Thus, the next phase of research, which is the model application to real data, will input actual data as attributes of the economy and thus reduce the variability of results.

Sensitivity analysis and robustness
The sensitivity analysis is central in building simulation models to ensure that the model is structurally consistent and does not depend solely on a particular parameter, which is adjusted for a specific value. Furthermore, the sensitivity analysis may serve as an analytical tool to show how and with which magnitude certain configurations and model processes change trends and results.
The sensitivity analysis made was based on the variation of the model parameters in 10 different values between their minimum and maximum values ( Table 5). As random numbers influence the model results, comparing the results of different iterations (model runs) is only possible if we use the same seed. Thus, if the model is run several times with the same parameter and the same seed, the same results will be produced. Therefore, when the modeler changes the parameters, variations in sensitivity analysis results will be a result of the model structure and not of the random number generator. 11 The change of the parameters was performed separately (one parameter at a time) with the other parameters maintained at their default values, defined in a first exploratory analysis.
Given that the premise is to create a model (or simulation machine), the sensitivity analysis furthers our understanding of the model. Of course, we also varied the number of regions (1, 4, 7).

Alpha
The variation of each of the parameters affects differently the results of the simulations. The alpha parameter which evaluates worker productivity for example, leads to higher values of total GDP when values are between 0.32 and 0.37.
Considering unemployment, the alpha parameter provides full employment, conditioned to other parameter's default value. Figures Figure 16 and Figure 17 shows that unemployment converges quickly towards full employment. The behavior was similar for all regions. The variation in productivity and unemployment indicate that when worker productivity is very high, there is an excess supply that is not absorbed by the market.
There is greater variation in firms' profits when alpha is smaller and more stability when alpha is higher ( Figure 18).
The value of alpha at 0.35 results in a good balance of resources in the economy among firms and households, on average, for all the region designs.
The Gini coefficient is slightly higher for higher values of alpha. Finally, prices rise slightly to higher values of alpha.

Beta
The beta parameter which controls the propensity to consume of households influences strongly the economy. In fact, higher values of beta (lower discount at maximum limit of 11. The results of the sensitivity analysis were obtained using a fixed seed.   household spending) or lower levels of beta, which restricts consumption, lead to high and persistent levels of unemployment ( Figure 19 and Figure 20), especially in the model with one region, where the dynamics is more dependent on the goods market. Low values also keep firms' profits close to zero. The impact of beta in the Gini coefficient is relevant and similar among the regional designs used. For low values of beta and low household consumption, Gini rises gradually, reaching a maximum at about 0.5. However, when beta has a value of 0.99, inequality rises steeply to reach values close to 0.90 at the end of the period (Figure 21).

Tax on consumption
As expected, the value of the tax rate influences the economy on many levels. Lower rates lead to lower unemployment, but influence little when below 0.5 ( Figure 22 and Figure 23). Very high tax rates bring hyperinflation, widespread unemployment and a significant drop in revenues and profits of firms. However, given that the amounts collected in taxes are applied in the same regions where collected, QLI improves, and consequently, property prices increase accordingly. Household income (Figure 24 and Figure 25) and GDP are higher for intermediate values of tax rate

Other parameters
A sensitivity analysis was performed for each exogenous parameters of the model, with lower relative impact compared to parameters alpha, beta and the tax rate.
The level of the inventory that triggers changes in prices, for example, seems to impact slightly on the evolution of the price index, delaying its increase.
The frequency with which firms enter the labor market affects the speed of adjustment     are higher taking longer to enter the labor market unemployment is only insignificant at the end of the period. When the entry of firms is frequent, full employment is achieved within months.
The change in the mark-up value, i.e., the percentage increase in product prices of firms when their stock is low does not greatly change the profit levels of the firms. However, very high mark-up rates, lead to uncontrolled inflation after some time.
The size of the market checked by consumers when they go shopping does not interfere in the results, with little loss of momentum when size is restricted to only one firm.
Finally, the percentage of families entering the housing market seems to have little influence. When all families are on the market all the time, there is a small reduction in household income.
Thus, we understand that the variation of the results of the model given by the variation of the parameters is in line with the underlying theory. In addition, there is no change of parameters that cause different or unexpected behavior of the model. Thus, we believe it indicates the robustness of the model, as described.

POSSIBILITIES FOR FUTURE RESEARCH
This section describes various additions to the model that could be implemented with relatively small and simple changes in the current code. Given the seminal methodological trait of this paper, we thought the model should be developed in its simplest form possible, following the KISS logic ('keep it simple, stupid'). Eventually, it could evolve into the KIDS form ('keep it descriptive, stupid'), formulated by Edmonds and Moss [77]. The immediate interest of the authors, it is to apply it for the Federal District region, in Brazil. Empirical data would be used in the initial configuration of the model, namely: actual municipal boundaries, specific spatiallybound demographic patterns, actual companies attributes and location, and supply of skilled labor. The following step would be to validate the empirical model for a given time line, seeking correlation or similarity between the evolution of observed indicators and those produced by the model. Finally, after validation, the model could be effectively used to implement public policy alternatives.
The actual realm of research possibilities are detailed below, following the KIDS argument of Edmonds and Moss [77]. 1) Implement demographic change, with processes that describe birth, deaths and families creation in order to become a more dynamic and real model while enabling results for specific demographic cohorts. In addition, intertemporal analyzes involving inheritance (of wealth or social capital), could also be tested; 2) Another relatively simple alternative is the inclusion of updating workers qualification (years of study), deducing investment from their resources; 3) The credit market, with production and consumer financing possibility is also relevant to make the model closer to economic reality. The literature is already available [19], [20], [21]; 4) Currently, the market for goods is restricted to firms and consumers in the domestic market. However, it could also include firms and governments as buyers (and sellers), enabling analysis of intermediate sectors, as well as foreign buyers allowing the inclusion of an economic measure of exports and trade balance; 5) Although distance is already included in the model, the formula could be sophisticated to effectively include the transport system available in the municipalities that are object of study. As a result, accessibility analysis would be systemically integrated with the rest of the economy, as demand and supply of the transport system (for employment purposes). 6) The process of imposing a limit by time or distance to daily commute would endogenously enable the creation of a system with several regions, making it simple to study urban hierarchy analysis. In such case, the 'employment areas' would be endogenous to the model. 7) Firms and their production technologies, decision-making processes and hiring and firing could be drawn from tacit information specific to a particular firm or sector. 8) The taxation system of this model is simplistic, with only one tax applied to consumption, typically a value-added tax (VAT) levied on the location of the firm. However, note the reader, that the implementation of the Territorial Taxes on property or on income, or changing VAT to be collected at the destination, i.e., at the consumer's place of residence, could be easily implemented. Thus, specific research questions of fiscal interest could be investigated.
Indeed, it is worth mentioning the advantage of modularity within the scope of this work. Using the basic model is possible to detail, build, and expand the model module by module, according to the research needs, while ensuring the evolution of the integration of other processes already implemented and validated.
Anyway, this list is not exhaustive and only fulfills the job of informing the model expansion opportunities, through enhanced feature of this theoretical and methodological proposal.

FINAL CONSIDERATIONS
This paper specifies, explains and justifies the steps and processes of the construction of the computational algorithm that prospectively simulates a spatial economy. It adds to the literature on the explicit spatiality of the model, and in achieving a simple model with three markets and conurbated subnational governments. Thus, establishing an actual framework for economic simulation, constituting itself as a public policy tool.
The model has a dynamic real estate market with prices given by the features of the dwelling and its location; a labor market, with matching mechanism between skilled workers and companies; and a goods market with endogenous price adjustment based on stock. The configuration in different subnational governments, one, four or seven differentiated regions allows for explicit spatial analysis.
The results and trends obtained after 1,000 simulation runs indicate that mobility of families among regions is central to the model with impoverished families migrating to poorly serviced places and, therefore, lower real estate prices; and families that are financially well migrating to better quality areas. Therefore, the model with only one region has a less dynamic economy, although more homogeneous, whereas the model with seven regions shows greater dynamism, but also greater heterogeneity and inequality.
The research question that asked whether the change of administrative boundaries and the consequent change of local tax revenue dynamics, in principle, changes the quality of life of the citizens ' can be answered affirmatively. Indeed, administrative boundaries understood as enclosed area of tax collection over economic base and its investment as collective public services can alter the quality of life of citizens. The underlying question faced by this paper is the efficiency of the return of taxes to taxpayers. Is there a spatial, political and administrative configuration that is more efficient? This debate should be further discussed by following research.
Finally, this paper contributes to the methodological framework of economic tools, particularly those flexible and forward-looking, with applied realm to public policies of subnational entities.

APPENDIX A PSEUDOCODE: REAL ESTATE MARKET
Symbol "#" indicates comments about the procedures or functions.  (6) For each firm (7) If firm's distance is lowest Select candidate (5) Else Select candidate (6) # Choose randomly between best candidate or the one who lives closest Choose candidate Firm hires, candidate register job # Delete candidate and firm from the dictionary Delete firm that hired from dictionary Delete chosen candidate from dictionary

APPENDIX D ODD PROTOCOL
The model description follows the ODD (Overview, Design concepts, Details) protocol for describing individual and agent-based models [57], [58].

1) Purpose
The model is a first exercise to observe the economy in its full spatially explicit environment, its markets, and main agents in order to capture taxes mechanisms and their effects as a means to enable public policy evaluation exante. The model falls within the simple category and it is a loosely expansion of Lengnick [34] and Gaffeo [35] with the introduction of spatially bounded government regions. Proven its validity, Brazilian intricate tax system can be inserted into the model and subnational development in the medium term could be analyzed. The main hypothesis is that for a given labor market area where citizens commute daily; making changes to political administrative boundary impacts citizens quality of life. The results of the model suggest that it may be the case. 2) Entities, state variables, and scales The model contains classes of agents, families, dwellings, firms, and government, along with accessory classes. IDs. All members of all classes have their own unique identification (IDs). Agents keep their current workplace ID, family and dwelling IDs. Families keep track of all their members and current dwelling. Dwellings knows which family is currently hosting, if any, their government region ID. Firms knows all their employers IDs and its government region ID. Government is passive and money is transferred directly from consumers at the buying moment. Each government region has its own ID. The agents have age (in years), qualification (in years of study), utility and money attributes along with family and dwelling identification. They also have processes to update money balance and consumption procedures. Agents buy and work in firms, are members of families and can move among dwellings along with their families. Families are groups of agents. Consumption money is always equally divided among family members. Families move among dwellings. They register the current dwelling address and value. Dwellings are fixed in space, have prices (proportional to size and Quality Index of the government region), size and quality and addresses. Quality and prices are updated monthly, given that the Quality Index at the government region has been updated.
Governments are within sets of predefined boundaries. They have a Quality Index and collect taxes deducing amount from firms when selling to costumers within their territory. They invest all treasure into Quality Index updates.
Firms have one product (with price and quantity), monthly balance, profits, addresses (x, y), and constantly knows its employees. They are fixed in space and process sales, production (with product quantity update), hire and fire decisions, and make employers payment. Temporal extent. The model was designed to run for 20 years, but there is no strict limit applied. It runs in terms of days, months (of 21 days), quarters and years, following Lengnick [34]. In this configuration 5,040 days represent 20 years. Spatial extent. The spatial boundaries are determined exogenously through parameters. We used -10, 10 on horizontal and vertical axis with location within the square in float precision. Along with the main classes, accessory classes include a system of communication that holds the labor market procedures; statistics, output, plotting, main, control (that iterates over simulations), generator that creates the instances of agents, families, dwellings and firms before simulation; parameters; space and time iteration. A products class was also built to facilitate new products development. However, in the current model only one product is in effect.

3) Process overview and scheduling
The model runs in a discrete mode fully using the Object-Oriented Programming (OOP) paradigm. A time schedule procedure is described in section 2. The pseudocode of the main processes are also available as Annexes section A, section B, and section C.

) Design concepts
Basic principles. The model is an extension of some principles from Lengnick [34] and Gaffeo et al. [35] with many adaptations. Given the lack of simple models [30], some processes are new implementations. Mainly these processes are the markets of goods, labor and houses and the decision processes of firing and hiring, setting of goods prices and wages, following earlier literature [44], [64], [65], [70]. Prices. Firms rationalize on prices given their current stock. When quantity produced is below a given parameter threshold, firms raise prices by some parameter percentage, i.e. price is given by cost but when there is enough demand a mark-up value is added to price. Otherwise, when quantity is above that same parameter threshold price is given by cost.
Wages. Firms pay a constant wage plus a qualification additional. Goods market. Firms offer their products with given prices. Consumers choose from a subsample of firms; which is determined by a parameter of the model. When considering to purchase, consumers randomly decides from firms that either have the minimum price [67] or is the closest from its residence [68], [69]. Labor market. Candidates of age with a given qualification offer themselves repeatedly on the market. Firms offer posts. Matching happens between most qualified employee and either (randomly) or closest firm. Hiring and firing. Firms decide on hiring or firing periodically, given an exogenous parameter. Typically, once every four months. When profit or cashflow is positive or the firm has no employees, they offer one post. When profit is negative, they fire an employee. Hiring follows the process described in the labor market. The employee to be fired is chosen randomly from the pool of employees of the firm. Housing market. Families enter the housing market periodically, following an exogenous parameter [78]. Once in the market, their decision to move is for more quality, when families have wealth above the median of all families; or to move for cheaper houses and capitalizing on the difference, following a general model of urban economics [63], [61]. In the first case, for each family in search, the available houses are ranked in order of quality. If the familys wealth plus the value of the current house is enough to best house, the transaction and the move occurs. In the second case, each family goes for the cheapest house.
Emergence. As output of the model, typical indicators of the economy are produced. We believe many of the results to be endogenous and robust on the parameters of the model. Built-in the model is the idea of economies of agglomeration and disagglomeration [68] and urban economics in general [63], [61]. That is, the center (or the region) where there is a concentration of firms that are performing well tend to attract agents. Simultaneously, rent prices rise and such process expels families to poor suburbs. However, the central region is an endogenous result of the model. Adaptation and Learning. Agents, families or firms do not adapt in the sense that they change the process of decision-making. However, the looseness of families in respect to dwelling attachment along with the dynamics of price changing implies that families have to financially adapt to constant changing environment.
Objectives. Families' objective is either try to move to better quality places or have enough resources to keep consuming. Their success rate is measured by their members utility, which is an indicator that cumulatively measures their actual consumption. Firms objective is to increase in size and keep on hiring and producing more and more. However, when out of equilibrium, objective changes to restore financial health (firing employees). Government (implicit) objective is to increase Quality Index.
Prediction. Decisions of all agents are based on cross-sectional information and do not try to infer the future. The model as a whole is intended as a comprehension mechanism and as a provider to the specific questions posed. Sensing. Sensing is global for agents when looking for jobs. When consuming, sensing is restricted to the given number of firms defined (parameter) as its private market. Dwelling price and quality changing mechanism is proportional to the observed at their region; which in turn is proportional to the sales of firms acting in the region. Interaction. Interaction happens competitively at the three designed models. However, agents and firms interact directly only in the sense that they may be excluded from the selection process (of hiring or consuming), given that they have lower qualification, are offering lower salaries or expensive products. Implicitly, agents at the same region share the same Quality Index. Thus, families benefit from high quality dwellings that is given by profitable firms in the region. Stochasticity. Stochasticity plays an important role at this version of the model. All population of agents, families, firms, dwellings is generated from a random process. Random decisions between two alternatives occur when deciding either for closest or cheapest product and for most qualified or closest living employee. Further, there is a random process when the agent decides the amount for consumption monthly and when the firm makes its firing decision.
Collectives. The only collective in the present model are the families. They have been described as a class above. Observation. A number of statistics are collected on a monthly basis. However, they do not interfere endogenously, except for the average families wealth (interferes on moving decision). The indicators available are absolute production sold (GDP), unemployment, average number of employees per firm, average utility of agents, average prices, average firms' balance, sum of firms' profit, Gini inequality index (based on families' average utility). Firms individually calculate and use their profits endogenously. Every three months they record their total balance and then they calculate next months profit in relation to the recorded value. Parameters. The following parameters are requested from the modeler at every simulation (section 2). Iteration. Given the artificialness of the population and the stochasticity described, the model was run 1,000 times for each regional configuration (one, four or seven regions) and the results are presented in terms of distributional statistics.

5) Initialization
At time 0 of the simulation, a number of processes has already run and will not run again (section 2). Given that this model is an artificial test aimed at scrutinizing (and proposing) the model itself and allowing only a hinted indication of public policy, the population is always a different one for each different run, given the parameters discussed. It is our plan to apply the model to a metropolitan area with fixed given population.

6) Input data
The model does not use input data, as it is.

7) Submodels
There are no submodels in this version.