Economic Simulation in SWARM: Based on Agent Modeling and Object-Oriented Design

Author: (Italian) Francesco LUNA et al. (editors), Jing Tihua et al. (translators)
Translators: Jing Tihua, Jing Xu, Ling Ning
Country:
Publisher:
Publish Date: 2004-07-01
Features: [Excerpt:] Clearly, if a computer program is computable, it is of a certain type of algorithm and accepts the Church Thesis, thus having a Turing machine that can be simulated. From this perspective, using a computer can naturally make an economist an expert in computability theory. However, the situation is not always so, as the models executed on computers are often built upon theory and may not necessarily conform to computability principles. Since simulation results are constrained by some "habitual" behavioral rules, i.e., limitations of special functions. In such cases, for example, when dealing with a Cobb-Douglas function, an utility function based on rational preference ordering, its general superiority and generality are lost. Real economic models are metaphors. It should be said that as long as these models can successfully guide our behavior, they are useful. Precisely for this reason, we believe that how these metaphors are obtained should not be the primary issue, and a researcher studying economic phenomena should have complete freedom. However, we also know that the institutional characteristics of different historical and geographical contexts in which policies operate must be considered, and therefore, policy standards must be carefully designed. Of course, this issue has two sides. On one hand, we do not know whether the computable models derived from incomputable theoretical models can yield results, although these incomputable theoretical models can cite principles to prove their correctness and even serve as arguments against different viewpoints. On the other hand, the theoretical models designed are, in principle, computable, and they "naturally" generate computable models, but the question is whether these models will necessarily yield substantive gains (deviation from logical consistency)? It is evident that the application of computers in the field of economics has been widely recognized, just as in other fields, and this is an inevitable trend. Some may argue that an economist using a computer is not enough to consider himself an expert in computability theory. Our expectation is that the application of computer technology can spark a fundamental interest in computer science. We sincerely invite economists to study computability theory. In this way, it can ensure mathematical consistency between economic models and the tools used to complete them. Now, we begin to create a population, which includes more than two agents. It is particularly noteworthy that we will create a model using a simple evolutionary algorithm (EA) to describe the evolutionary model of a population composed of different types of prisoners. The prisoners will engage in four rounds of repeated Iterated Prisoner's Dilemma (IPD) with opponents randomly selected from the population. In each competition, the prisoner with the higher profit will pass on his strategy to his offspring with a higher probability. This selection pressure, combined with the special competition process, will lead some strategies to gain significant support in the population. The model will consist of two "cycles": the outer cycle will iterate over the population of agents across generations, and the inner cycle will match agents in a random order. After each pair of agents completes the IPD game developed earlier, the winner (i.e., the agent with higher profit) will be cloned and inserted into the new generation. By setting the parameter `selectionPressure` to a value less than 1, the loser will also be cloned with a certain probability. After the competition ends, the old generation is erased, and the new generation begins to compete. This model only runs the outer cycle, and a new class `GenerationSwarm` will run the inner cycle. Therefore, most of the code in the model's `run` method is ported to the new population. In the evolutionary version of IPD, we need a simple method to clone agents. Since the only characteristic of an agent that needs to be replicated is its strategy, it makes sense to divide the agent into two parts: one object that interacts with the environment and obtains profit, and another object representing the strategy, which can be copied from one agent to another. Thus, we moved the code describing the strategy from the `Prisoner` class to a new class named `Strategy`. The strategy instance becomes an instance variable of `Prisoner`, and the agent only needs to send a message to its strategy to query the next possible action of its opponent. In fact, if we create `n` instances of `Prisoner` and replace them with `n` new objects in each new generation, we only need to create one instance of `Strategy` for each assumed different strategy type in the population. Here, by simply setting the instance variable `strategy` value to the same as the parent, the agent can inherit its ancestor's strategy. In the `buildObjects` method of `ModelSwarm`, we created instances of and `GenerationSwarm`.
7.1 ObjectLoader and InFile: Setting Parameters with Files
In this example, we will use a new feature of the Swarm library, which is its ability to read instance variables from simple text files. This instance variable is set using class instances. This feature is provided by the `ObjectLoader` class in the `simtools` library. `ObjectLoader` is the only class in the library that can read data from files, even from different processes or communication connections, and provides programmers with concrete examples to illustrate object instances. Other implementations are relatively more complex. In these examples, we use `ObjectLoader` because it is based on a very simple file format, which is easy to interpret and understand. In the code listed in Table 8, we used `ObjectLoader` in two cases. First, we read simulation parameters, which are instance variables of `ModelSwarm`, by reading them from a file using the `loadFromFileNamed` method of `ObjectLoader`. Note that we do not need to create an instance of the class; we only need to call the class itself. This is an example of a "class method," which can be called directly without creating an instance of the class.
To develop agent-based experiments, we introduce the following general hypothesis (GH): An agent operating in an economic environment must develop and adjust its evaluation capabilities in a consistent manner, which includes: ① what the agent must do to achieve a specific effect; ② how the agent predicts the effects of its own behavior. This is also true when the agent interacts with other agents. In addition to this internal consistency (IC), the agent can develop other characteristics, such as the ability to act based on external environments (e.g., according to certain rules) or other agents (e.g., by imitating them) (external proposals, EPs) or estimating effects (external objectives, EOs). These additional characteristics are very useful for better adjusting the agent during the experiment.
To apply this hypothesis (GH), we use artificial neural networks here. We find that this hypothesis can also be applied to other algorithms and tools to reproduce the cycle of experience-learning-consistency-behavior, regardless of whether neural networks are used. Here are some introductory general remarks: In all cases where this hypothesis (GH) is applied, classifying the agent's output as behavior and effects has been used as an initial choice. This can: ① clarify the role of the agent; ② demonstrate the rationality and effectiveness of the model; ③ avoid the necessity of pre-interpreting the optimal behavior of economic rationality (Beltratti et al., 1996). Economic behavior, whether simple or complex, can be directly regarded as a byproduct of EPs and EOs. For external observers, our artificial adaptive agents (AAAs) operate according to certain purposes and plans. It is clear that economic behavior does not have such symbolic entities; it is abstract for the observer. Here, the similarity we have in mind is that observing and analyzing the behavior of real-world agents also faces the same problems. Moreover, for an external observer, AAAs always represent an example of rational behavior maximization. Complexity can be more easily seen externally, as the complexity emerging from the framework of interactions, adaptation, and learning of agents is often greater than that within the agents. Similarly, rationality (and Olympic rationality) can also be found externally as a byproduct of environmental constraints and the limited capabilities of agents. Just as optimization can also emerge externally as a byproduct of interactions and constraints, as the intention of agents. The main issue is: the behavior of agents is clearly goal-oriented, i.e., to increase or decrease something, but this does not mean that all attention should be focused on searching for complexity internally in the agent, and there should be no hesitation.
According to our hypothesis and the resulting cross-targeting method (CT), we can say that our work expands from the edge of biotechnology to the artificial world of rational AAAs under bounded rationality: complexity, optimization behavior, and Olympic rationality can emerge from their interactions, but externally.
From both theoretical and experimental perspectives, tax evasion has always been a widely studied topic in microeconomic literature. The theoretical study of tax evasion began with the innovative paper by Allingham and Sandmo (1972). They regarded the issue of tax evasion as an analysis of expected utility maximization within a framework of von Neumann-Morgenstern theory. A lot of work has also been done on the experimental side, mainly focused on verifying theoretical results and discussing behavioral assumptions. Allingham and Sandmo's model soon attracted criticism from both theoretical and empirical perspectives. The main theoretical flaw of the model lies in the uncertainty of evaluating the impact of tax rate increases due to the effects of two opposite-sign operations—a positive income effect and a negative substitution effect. This flaw was addressed by Yitzhaki (1974), who modified the assumptions of the Allingham-Sandmo model by linking sanctions to unpaid taxes rather than unreported income. Yitzhaki also pointed out that if the risk aversion assumption is retained, then changes in reported income will be slower than changes in taxable income. This means that high-income groups will tend to move to regions with lower tax rates to avoid taxes. Yitzhaki's corrections did not quell the numerous criticisms of the Allingham-Sandmo model, and its conclusion that the wealthy evade less tax than the poor even drew more criticism.
In summary, despite the modifications made by Yitzhaki and other scholars (such as Srivansan, 1973) to the above model, many of its flaws remain unresolved. From our perspective, the interesting aspect of this discussion is the analysis of the role of psychological motivations in the behavioral choices of taxpayers. The implicit assumption of the neoclassical model structure used by Allingham-Sandmo and Yitzhaki is that tax evasion decisions are part of a utilitarian budget and are determined by the preference structure of taxpayers. It is well known that the neoclassical approach does not study preferences; it treats them as exogenously given. This apparent neglect of psychological mechanisms in microeconomic theory has been widely criticized, and these criticisms are largely based on empirical evidence, involving many aspects and assumptions of the theory, and the preferences of agents are formed by psychological mechanisms and optimization behavior assumptions. Taxpayer theory, without exception, has been widely criticized from psychological, motivational, and experiential perspectives.

📌 Related Posts