NetLogo banner

NetLogo Publications
Contact Us

Modeling Commons

Beginners Interactive NetLogo Dictionary (BIND)
NetLogo Dictionary

User Manuals:
Farsi / Persian


NetLogo User Community Models

(back to the NetLogo User Community Models)

[screen shot]

If clicking does not initiate a download, try right clicking or control clicking and choosing "Save" or "Download".(The run link is disabled for this model because it was made in a version prior to NetLogo 6.0, which NetLogo Web requires.)


This model is a representation of major depression. The nodes in this model represent the symptoms of major depression. According to the DSM-IV (APA, 2000) there are nine symptoms: (1) depressed mood, (2) loss of interest, (3) weight loss/gain or appetite loss/gain, (4) sleep problems (hypersomnia or insomnia), (5) psychomotor retardation/agitation, (6) fatigue, (7) worthlessness or guilt, (8) concentration problems, and (9) suicidal thoughts.
In this model, a recently emerging view on the relations between symptoms is illustrated. It is based on the hypothesis that symptoms of mental disorders have direct causal relations with one another and is called the causal network perspective (Borsboom, 2008; Cramer, Waldorp, van der Maas & Borsboom, 2010; Schmittmann, Cramer, Waldorp, Epskamp, Kievit & Borsboom, 2011). For instance, if one develops a symptom of major depression (e.g., insomnia) then this increases the likelihood of developing other symptoms (e.g., fatigue, lack of concentration). Conversely, if one of the symptoms disappears, this increases the likelihood that other symptoms disappear as well. The present model simulates the development of symptoms based on these assumptions.


The model is based on four parameters that can be controlled by the sliders: INITIAL-SYMPTOMS, NUMBER-OF-CONNECTIONS, CONNECTION-STRENGTH and EXTERNAL-ACTIVATION.
At each time step (tick), the probability to become activated (red) is calculated for each symptom. This calculation is based on a logistic function. This is an S-shaped, monotonically increasing function often used in item response theory (IRT, Reise & Waller, 2009). The probability to become activated for symptom i is represented as: e^(S[a*x]-b)/(1+e^(S[a*x]-b)). Here, S[a*x] designates the activation sum of the symptom's neighbors (a) times the weight of their connection (x), and b is a symptom specific threshold. The thresholds were set to values derived from appropriate transformations of the IRT difficulties reported by Aggen, Neale, & Kendler (2005). The model thus specifies that a symptom's activation probability increases monotonically with the activation of its neighboring symptoms; symptoms differ however in the level of input they need to become activated, which is controlled for with the empirically derived thresholds. For instance, suicidal ideation is less easily activated than sleep problems.
Besides the thresholds, the activation of a symptom depends also on four other factors. The first factor is the activation of the other symptoms in the network. The more symptoms that are active, the higher the probability that a symptom will become activated. But only connected activated symptoms can contribute to a higher probability of becoming activated. Therefore, the second factor on which activation of a symptom depends is whether or not the symptoms are connected. This is determined by the NUMBER-OF-CONNECTIONS slider, on which the created network is based. The connections can have a certain strength, which is the third factor. The strength of the connections determines the degree to which the activation signal of a symptom is sent to the other symptoms and is controlled by the CONNECTION-STRENGTH slider. Finally, the probability to become activated depends on influences from the environment (e.g., stressful life events like a romantic breakup or the loss of a loved one), controlled by the EXTERNAL-ACTIVATION slider. This slider serves to adjust the amount of influence from the environment that influences the activation probabilities of the symptoms. A positive value causes a heightened probability to become activated, while a negative value of external activation means a lowered probability to become activated.
Each network created in this manner has symptoms with fixed thresholds. The NUMBER-OF-CONNECTION slider, however, randomly adds connections to the network until the network has the chosen number of links.


Use the sliders to choose the initial settings for the model. Besides the INITIAL-SYMPTOMS slider, all sliders can be adjusted while the model is running. The INITIAL-SYMPTOMS slider determines with how many activated symptoms the simulation will start.
Press SETUP to create the network. To run the model, press the GO button. To stop (and continue) the simulation, press GO again. If you want to start a new simulation press SETUP to create a new network. The NUMBER-OF-CONNECTIONS, CONNECTION-STRENGTH and EXTERNAL-ACTIVATION sliders can be adjusted before pressing GO, or while the model is running.
The NETWORK STATUS plot shows the number of activated symptoms over time. The black horizontal line in this plot indicates the DSM-IV cut-off for a major depressive episode, namely five out of nine symptoms.
The plots of the separate symptoms show the level of influence of the whole network (i.e., the total amount of activation) on the particular symptom. The influence of the network depends on the connection strength, but also on whether symptoms have connections altogether. The purple horizontal line in these plots represents the threshold of the symptoms. When the activation level of the network is above the threshold for a particular symptom, there is a high probability that this symptom will be activated.


Dependent on the settings of the parameters, the network exhibits three states: a 'healthy' state, a depressive state or a bistable state. A network has a healthy state when there are no or only a few symptoms active. A network has a depressive state when all or almost all symptoms are active. A bistable state, however switches periodically between a healthy and a depressive state.


The simplest network is a network with the following settings:
Which of the three possible states (healthy, depressive or bistable) does this network exhibit? How is the state of the network affected by changing the CONNECTION-STRENGTH? And how does the EXTERNAL-INFLUENCE affect the behavior of the network?
Use the settings of the simplest network again and try altering the number of connections. See what happens in a network with only 20 connections. Press the SETUP button again after a while and see how the connections change. Can the network enter a depressive state in which all or almost all symptoms are active? And what if you combine the 20 connections with a CONNECTION-STRENGTH of 1.5? Does the network status plot pattern changes? Create different networks by pressing the SETUP button repeatedly. Check the Network status plot. Are the peaks higher or lower, or more or less frequent? Can you create a network that is bistable; that is, a network that switches between a healthy and a depressive state? It may take a number of attempts to create such a network. How, do you think, is it possible that some networks can get "depressed" and other networks cannot?
Bistability is a feature of many complex dynamic systems and is an indication for a hysteresis effect. To see this effect, set up a network with the following settings:
With these setting the network will not be able to reach a depressive state. Now increase the connection strength constantly step by step, for example by 0.1 every second by clicking on the slider. At what connection strength does the network get depressed? And when you decrease the connection strength at the same pace: at what connection strength does the network go into a healthy state? Is the connection strength at which the network switches from healthy to depressed and vice versa the same when you gradually increase or decrease the connection strength?


This model could be extended with phenomena related to major depression. An interesting example is comorbidity of major depression with generalized anxiety. Comorbidity means that the two disorders exist simultaneously. In recent scientific research it has been suggested that comorbidity can be explained from a network perspective through the role of bridge symptoms between two disorders. These are symptoms that are part of both disorders and thus exert their influence on the networks of both major depression and generalized anxiety (Cramer, Waldorp, Van der Maas & Borsboom, 2010). In the case of depression and generalized anxiety, such symptoms are sleep problems, concentration problems, fatigue and psychomotor problems. This could be modeled by including another network containing the symptoms of generalized anxiety; the overlapping symptoms should be part of both networks. Via these bridge symptoms, the activity of one network can spread to the other network.


To calculate the influence of the network on a symptom, the matrix extension is used. The weights of the connections are represented in a 9 by 9 matrix. The value in cell (2,3) for example, represents the weight of the connection between symptom 2 and 3. Row 4, for example, represents the weights of the links of symptom 4 to all other symptoms.


Aggen, S. H., Neale, M. C., and Kendler, K. S. (2004/5). DSM criteria for major depression: evaluating symptom patterns using latent-trait item response models. Psychological Medicine 35, 475-487.

APA (2000). Diagnostic and Statistical Manual of Mental Disorders, 4th edition, text revision. American Psychiatric Association: Washington, DC.

Borsboom, D. (2008). Psychometric perspectives on diagnostic systems. Journal of Clinical Psychology, 64, 1089-1108.

Cramer, A. O. J., Waldorp, L. J., Van der Maas, H. L. J., and Borsboom, D. (2010). Comorbidity: A network perspective. Behavioral and Brain Sciences, 33, 137-193.

Reise, S. P., and Waller, N. G. (2009). Item Response Theory and Clinical Measurement. Annual Review of Clinical Psychology, 5, 27-48.

Schmittman, V. D., Cramer, A. O. J., Waldorp, L. J., Epskamp, S., Kievit, R. A., and Borsboom, D. Deconstructing the construct: A network perspective on psychological phenomena. New Ideas in Psychology (2011), doi:10.1016/j.newideapsych.2011.02.007


If you mention this model in an academic publication, we ask that you include these citations for the model itself and for the NetLogo software:
- Van Borkulo, C.D., Borsboom, D., Nivard, M.G. and Cramer, A. O. J. (2011). NetLogo Symptom Spread model. Center for Connected Learning and Computer-Based Modeling, Northwestern University, Evanston, IL.
- Wilensky, U. (1999). NetLogo. Center for Connected Learning and Computer-Based Modeling, Northwestern University, Evanston, IL.

In other publications, please use:
- Copyright 2011 Claudia D. van Borkulo, Denny Borsboom, Michel G. Nivard and Angelique O. J. Cramer. All rights reserved. See for terms of use.

(back to the NetLogo User Community Models)