Difference between revisions of "Modeling 101"

From Numerus
Jump to navigation Jump to search
 
(22 intermediate revisions by 2 users not shown)
Line 1: Line 1:
==Dynamical System Models==
==The Fundamentals of Computational Modeling==
Dynamical system models represent systems that change over time. Typical examples include a population of organisms, the flow of money in the economy, or a manufacturing process. What each of these diverse ‘systems’ have in common is that they change over time.
Ultimately, everyone in the world is a modeler. We simply do not always realize it. To exist in the world, to try to understand a system, is to develop a model. Whether your model is that a ball will fall when you release it or a prediction of what your friend will like for their birthday, developing models of how the world behaves is fundamental to how humans approach the world.


At the heart of a dynamical system model is a set of rules and equations that reflect how the system changes in a particular instant. By rendering these rules in a simulation program like Nova and letting it run, you can see how these momentary changes lead the system to develop.
Computational modeling, then, is simply a process of formalizing these models and translating them to mathematics. This is done through reducing a complex system to individual components that can be understood. Virtually any system can be addressed this way. The demographics of a population, the movements of flocks of birds, or the spread of a forest fire are all relatively simple to model. It can even address more complicated issues, such as interpersonal interactions or the movements of crowds. Through the use of equations, and the rapid calculation speeds of computers, we can use computational modeling to study the evolution of a system over time. Computational modeling is a vast field, and an introduction such as this can only scratch the surface. But hopefully this brief introduction will give you an idea of the possibilities, and provide a starting point for going forward.  


Fundamental to a dynamical system model is an abstraction of the parts of the ‘system’. Choosing the appropriate level of abstraction is very important. For example, if we are building a population model of honey bees, should the entire population be stored in a single number or should they be divided by age class? What processes, such as birth and death, should be included in the model, and which ones can be ignored? These are the types of decisions modelers have to make.  
Fundamental to any model is an abstraction of the parts of the ‘system’. Choosing the appropriate level of abstraction is very important. For example, if we are building a population model of honey bees, should the entire population be stored in a single number or should they be divided by age class? What processes, such as birth and death, should be included in the model, and which ones can be ignored? These are the types of decisions modelers have to make.  


In general, it is best practice to make the model as abstract as possible while still getting meaningful results. There are two primary reasons, the first being a simple matter of conserving processing power. But more importantly, aggressively simplifying the model also simplifies analysis. It is the classic issue of the map and the territory. As the map becomes more detailed it also becomes harder to interpret, until the map and the territory become indistinguishable: perfectly accurate and perfectly useless. The art of modeling is in choosing the necessary level of detail to answer the question being asked.
In general, it is best practice to make the model as abstract as possible while still getting meaningful results. There are two primary reasons, the first being a simple matter of conserving processing power. But more importantly, aggressively simplifying the model also simplifies analysis. It is the classic issue of the map and the territory. As the map becomes more detailed it also becomes harder to interpret, until the map and the territory become indistinguishable: perfectly accurate and perfectly useless. The art of modeling is in choosing the necessary level of detail to answer the question being asked.


===Goals of Modeling Dynamical Systems===
When choosing the level of abstraction, it is important to remember that the goal of a model is not necessarily prediction. Prediction is certainly desirable, but not all systems are simple enough to be predicted exactly. Error will always creep in, whether from subtle missing factors or uncertainty in raw data. But this does not mean modeling these systems is useless. Even though specific outcomes will always come with uncertainty, models can tell us about sensitivity: which factors are important in the outcome. Modeling can also show where we are likely to see equilibrium points, and whether they will be stable or unstable. This can help answer very practical questions. Consider a model of a disease. Is the disease going to die out by itself or is it likely to explode? Are we better off trying to vaccinate people against it, or should we improve detection and treatment? What percentage of the population must be vulnerable to produce an outbreak? And given what we know, what are the most likely scenarios to plan for? These critical questions are precisely what computational modeling is designed to answer.
Many people think the goal of modeling is prediction. Prediction is certainly desirable, but the reality is that few systems are simple enough to be predicted exactly. Error will always creep in, whether from subtle missing factors or uncertainty in raw data. But this doesn’t mean modeling is useless. Even though specific outcomes will always come with a high degree of uncertainty, models can tell us about sensitivity: which factors are important in the outcome. Modeling can also show where we are likely to see equilibrium points, and whether they will be stable or unstable. This can help answer very practical questions. Consider a model of a disease. Is the disease going to die out by itself or is it likely to explode? Are we better off trying to vaccinate people against it, or should we improve detection and treatment? What percentage of the population must be vulnerable to produce an outbreak? And given what we know, what are the most likely scenarios to plan for? These critical questions are precisely what computational modeling is designed to answer.


==Spatial Models==
Another goal of modeling can be to test a hypothesis. This is because what a model fails to predict can be just as revealing as what it does. If the model of a system behaves differently than the real data it is compared too, this means that our understanding of the model is incomplete. As an example, a model indicates that the prey population should be stable but the data indicates it is plummeting. This could indicate many things, whether a predator or disease or lowered birthrate. But clearly there is something strange going on that requires investigation.


===Goals of Modeling Spatial Models===
Hopefully this brief introduction to the field of Computation Modeling has given you a sense of it's versatility and applicability. The rest of this introduction will focus on the three primary specialties of Numerus: Dynamical Systems Models, Spatial Models, Agent-based Models, and Network Models.


===Spatial Models in NMB===
==Dynamical System Models==
Dynamical system models represent systems that change over time. Typical examples include a population of organisms, the flow of money in the economy, or a manufacturing process. What each of these diverse ‘systems’ have in common is that they change over time.


==Agent Based Models==
At the heart of a dynamical system model is a set of rules and equations that reflect how the system changes in a particular instant. By rendering these rules in a simulation program like Numerus and letting it run, you can see how these momentary changes lead the system to develop.
Agent based models study the interaction of objects in space. Agents are objects with a specific set of rules, and can represent anything from ants to grains of sand. They move and interact in a simulated region of space. The interaction between the Agents, and sometimes their interaction with the landscape, are the core of this field.  


Agent Based Models are a useful tool for describing how complex behavior emerges from the interactions of the individual components. The classic agent based model is a flock of birds organizing itself based on the simple rules followed by each agent. NMB includes a number of examples including the Game of Life, the SIR model, and Antz.
===Goals of Developing Dynamical Systems Models===
Dynamical Systems Models are used to describe when something you are measuring moves from one place to another, or transforms from one thing to something else. This may be modelling the flow of Carbon between various reservoirs, or it may be modeling the different cohorts in a population as they age. It can even represent the flow between sick and infected populations. The key point is that you have a measurable quantity being shuffled between categories without being lost in the transfer.


===Advantages and Disadvantages===
==Spatial Models==
Agent Based Models are a tool, and like any tool they are better at solving some problems and worse at solving others. They tend to be a bit harder both conceptually and practically to put together, since they have more components to them than simple analytical models. Despite this, however, they generally require a smaller base of knowledge about the system that someone is trying to model. It is easy, for example, to know that someone who is sick has a certain probability of infecting someone they interact with. It is more difficult to come up with an equation to demonstrate the rate at which someone infects other people without knowing how often they interact, how contagious they are, and whether or not people they interact with are susceptible to infection or not. In this situation, it makes sense simulate a spatial dimension in order to make up for information that is not necessarily obvious. Another situation in which agent based models shine is large systems whose group behavior is important. In the flocking model discussed above, the individual behavior of the birds is meaningless and even distracting. But when seen in the context of the larger group, important trends appear from the noise that define the model's behavior.
Spatial Models simply represent the behavior of a virtual landscape. The landscape is composed of cells, which can be thought of like pixels. They are the resolution with which we will study the processes of the landscape. As always when modeling, it is best to pick the broadest resolution that will answer your questions. Spatial models can also be combined with Agent Based models, to represent the interaction between the mobile agents and the landscape they inhabit.


===Agent Based Models in NMB===
===Goals of Developing Spatial Models===
Agent based models in NMB are models that make use of either an agent vector or a cell matrix. Models that use both of these are known as Sim Worlds. The game of Life is an example of a model that uses only a cell matrix, with the cells turning “off” and “on” or “alive” and “dead” depending on the state of each individual patch’s neighbors. The SIR model is an example of an agent vector, with agents moving about an open space in three possible states, Susceptible, Infected, and Recovered. The Antz model is a more complicated model that uses both an agent vector and a cell matrix in order to simulate how ants collect food and leave a path for other ants to follow in order to find the same food.
Spatial models are, obviously enough, used for studying the behavior of entire landscapes. They can address the population density of a city, and misbehavior in a classroom, or the interaction between plant cover rainfall and wildfire. However it is important to note that the landscape can be metaphorical. The key requirement for a Spatial Model is simply that each cell has a fixed distance from each by some metric, and that the cells interact with each other. A Spatial Model can also provide critical context for an Agent Based model. In a model of honeybee behavior and pollination, for example, the bee agents will have a direct impact on the landscape and vice versa.


NMB has a lot of tools that make agent based models simpler and more robust. In particular, it is very easy to have access to all agents and cells from each individual agent, and to incorporate a wide variety of local and global effects. It also makes it simple to set up multiple Sim Worlds in order to see various outcomes simultaneously. It is also built on arrays and methods, which makes it simple to work on a small level to tweak the model to the user’s liking. On the other hand, the visual side of NMB makes it so that it is easy to quickly and efficiently set up the shell of an agent based model and immediately get down to the more important details involved in the model. A savvy NMB programmer will begin an agent based model visually and slowly transition over to handling the methods and functions in a more programming heavy reference frame.
==Agent Based Models==
Agent based models study the interaction of objects in space. Agents are objects with a specific set of rules, and can represent anything from ants to grains of sand. They move and interact in a simulated region of space. The interaction between the Agents, and sometimes their interaction with the landscape, are the core of this field. In some ways an Agent Based model is similar to Spatial Model, but unlike a Cell an Agent has no neighbors and it's position is not fixed.


==Basic Model Design==
Agent Based Models are a useful tool for describing how complex behavior emerges from the interactions of the individual components. The classic agent based model is a flock of birds organizing itself based on the simple rules followed by each agent. Numerus includes a number of examples including the SIR model, and Antz.


It is important to grasp the extent of the Nova platform in order to implement powerful and complex dynamical system and agent based models. As described above, Nova provides an impressive range and versatility of components to effectively execute both Dynamic Systems and Agent Based models. In addition, Nova has the capability to implement designs using specialized analysis like '''Perceptrons''' and other Neural Network prediction algorithms. To utilize Nova's capabilities we must first understand the basics of Nova's '''Chip''' component and '''Population Models'''.
===Advantages and Disadvantages===
 
Agent Based Models are a tool, and like any tool they are better at solving some problems and worse at solving others. They tend to be a bit harder both conceptually and practically to put together, since they have more components to them than simple analytical models. Despite this, however, they generally require a smaller base of knowledge about the system that someone is trying to model. It is easy, for example, to know that someone who is sick has a certain probability of infecting someone they interact with. It is more difficult to come up with an equation to demonstrate the rate at which someone infects other people without knowing how often they interact, how contagious they are, and whether or not people they interact with are susceptible to infection or not. In this situation, it makes sense simulate a spatial dimension in order to make up for information that is not necessarily obvious. Another situation in which agent based models shine is large systems whose group behavior is important. In the flocking model discussed above, the individual behavior of the birds is meaningless and even distracting. But when seen in the context of the larger group, important trends appear from the noise that define the model's behavior.
*Jump into Nova's [[Operational_Semantics|Operational Semantics]] here.
 
*Get a run through of Nova's [[Frames,_Menus,_Toolbars,_Pallets|GUI here]].
 
===Chip Basics===
 
As the [[Glossary|Nova Glossary]] states, a '''Chip''' is a Container component which contains a single '''Capsule''' instance. A '''Capsule''' is a prototype for a simulation unit. It contains base components and may contain other chips, inputs, and / or outputs. These definitions may appear a bit vague or broad, however, that is simply because '''Chips''' and '''Capsules''' are widely used in a variety of ways within Nova.  


Chip structure and usage in Nova may best be understood through example. Click [[Using_Chips:_Example|here]] for an example of using a preexisting model (from the Model Library) and manipulating the ideas of model layers and chips.
==Network Based Models==


===Population Model 101===
===Goals of Development Network Based Models===


See the [[Example_1:_Simple_Population_Model|Simple Population Model]] tutorial in the Model Library. This tutorial demonstrates fundamental Nova usage, including how to operate the Graphical User Interface, or '''GUI''', and its algorithmic and mathematical design. You will see basic usage of the ''Modeling Canvas'' and the ''Dashboard'' as well as Nova's intuitive mathematical design.
==Basic Model Design in Numerus==
Click [[Modeling in Numerus|here]] to see how these concepts are implemented in Numerus.

Latest revision as of 18:19, 28 January 2018

The Fundamentals of Computational Modeling

Ultimately, everyone in the world is a modeler. We simply do not always realize it. To exist in the world, to try to understand a system, is to develop a model. Whether your model is that a ball will fall when you release it or a prediction of what your friend will like for their birthday, developing models of how the world behaves is fundamental to how humans approach the world.

Computational modeling, then, is simply a process of formalizing these models and translating them to mathematics. This is done through reducing a complex system to individual components that can be understood. Virtually any system can be addressed this way. The demographics of a population, the movements of flocks of birds, or the spread of a forest fire are all relatively simple to model. It can even address more complicated issues, such as interpersonal interactions or the movements of crowds. Through the use of equations, and the rapid calculation speeds of computers, we can use computational modeling to study the evolution of a system over time. Computational modeling is a vast field, and an introduction such as this can only scratch the surface. But hopefully this brief introduction will give you an idea of the possibilities, and provide a starting point for going forward.

Fundamental to any model is an abstraction of the parts of the ‘system’. Choosing the appropriate level of abstraction is very important. For example, if we are building a population model of honey bees, should the entire population be stored in a single number or should they be divided by age class? What processes, such as birth and death, should be included in the model, and which ones can be ignored? These are the types of decisions modelers have to make.

In general, it is best practice to make the model as abstract as possible while still getting meaningful results. There are two primary reasons, the first being a simple matter of conserving processing power. But more importantly, aggressively simplifying the model also simplifies analysis. It is the classic issue of the map and the territory. As the map becomes more detailed it also becomes harder to interpret, until the map and the territory become indistinguishable: perfectly accurate and perfectly useless. The art of modeling is in choosing the necessary level of detail to answer the question being asked.

When choosing the level of abstraction, it is important to remember that the goal of a model is not necessarily prediction. Prediction is certainly desirable, but not all systems are simple enough to be predicted exactly. Error will always creep in, whether from subtle missing factors or uncertainty in raw data. But this does not mean modeling these systems is useless. Even though specific outcomes will always come with uncertainty, models can tell us about sensitivity: which factors are important in the outcome. Modeling can also show where we are likely to see equilibrium points, and whether they will be stable or unstable. This can help answer very practical questions. Consider a model of a disease. Is the disease going to die out by itself or is it likely to explode? Are we better off trying to vaccinate people against it, or should we improve detection and treatment? What percentage of the population must be vulnerable to produce an outbreak? And given what we know, what are the most likely scenarios to plan for? These critical questions are precisely what computational modeling is designed to answer.

Another goal of modeling can be to test a hypothesis. This is because what a model fails to predict can be just as revealing as what it does. If the model of a system behaves differently than the real data it is compared too, this means that our understanding of the model is incomplete. As an example, a model indicates that the prey population should be stable but the data indicates it is plummeting. This could indicate many things, whether a predator or disease or lowered birthrate. But clearly there is something strange going on that requires investigation.

Hopefully this brief introduction to the field of Computation Modeling has given you a sense of it's versatility and applicability. The rest of this introduction will focus on the three primary specialties of Numerus: Dynamical Systems Models, Spatial Models, Agent-based Models, and Network Models.

Dynamical System Models

Dynamical system models represent systems that change over time. Typical examples include a population of organisms, the flow of money in the economy, or a manufacturing process. What each of these diverse ‘systems’ have in common is that they change over time.

At the heart of a dynamical system model is a set of rules and equations that reflect how the system changes in a particular instant. By rendering these rules in a simulation program like Numerus and letting it run, you can see how these momentary changes lead the system to develop.

Goals of Developing Dynamical Systems Models

Dynamical Systems Models are used to describe when something you are measuring moves from one place to another, or transforms from one thing to something else. This may be modelling the flow of Carbon between various reservoirs, or it may be modeling the different cohorts in a population as they age. It can even represent the flow between sick and infected populations. The key point is that you have a measurable quantity being shuffled between categories without being lost in the transfer.

Spatial Models

Spatial Models simply represent the behavior of a virtual landscape. The landscape is composed of cells, which can be thought of like pixels. They are the resolution with which we will study the processes of the landscape. As always when modeling, it is best to pick the broadest resolution that will answer your questions. Spatial models can also be combined with Agent Based models, to represent the interaction between the mobile agents and the landscape they inhabit.

Goals of Developing Spatial Models

Spatial models are, obviously enough, used for studying the behavior of entire landscapes. They can address the population density of a city, and misbehavior in a classroom, or the interaction between plant cover rainfall and wildfire. However it is important to note that the landscape can be metaphorical. The key requirement for a Spatial Model is simply that each cell has a fixed distance from each by some metric, and that the cells interact with each other. A Spatial Model can also provide critical context for an Agent Based model. In a model of honeybee behavior and pollination, for example, the bee agents will have a direct impact on the landscape and vice versa.

Agent Based Models

Agent based models study the interaction of objects in space. Agents are objects with a specific set of rules, and can represent anything from ants to grains of sand. They move and interact in a simulated region of space. The interaction between the Agents, and sometimes their interaction with the landscape, are the core of this field. In some ways an Agent Based model is similar to Spatial Model, but unlike a Cell an Agent has no neighbors and it's position is not fixed.

Agent Based Models are a useful tool for describing how complex behavior emerges from the interactions of the individual components. The classic agent based model is a flock of birds organizing itself based on the simple rules followed by each agent. Numerus includes a number of examples including the SIR model, and Antz.

Advantages and Disadvantages

Agent Based Models are a tool, and like any tool they are better at solving some problems and worse at solving others. They tend to be a bit harder both conceptually and practically to put together, since they have more components to them than simple analytical models. Despite this, however, they generally require a smaller base of knowledge about the system that someone is trying to model. It is easy, for example, to know that someone who is sick has a certain probability of infecting someone they interact with. It is more difficult to come up with an equation to demonstrate the rate at which someone infects other people without knowing how often they interact, how contagious they are, and whether or not people they interact with are susceptible to infection or not. In this situation, it makes sense simulate a spatial dimension in order to make up for information that is not necessarily obvious. Another situation in which agent based models shine is large systems whose group behavior is important. In the flocking model discussed above, the individual behavior of the birds is meaningless and even distracting. But when seen in the context of the larger group, important trends appear from the noise that define the model's behavior.

Network Based Models

Goals of Development Network Based Models

Basic Model Design in Numerus

Click here to see how these concepts are implemented in Numerus.