NetLogo banner

 Contact Us

 Modeling Commons

 User Manuals:


NetLogo User Community Models

(back to the NetLogo User Community Models)


by Claudia van Borkulo (Submitted: 12/30/2013)

[screen shot]

Download Vulnerability_To_Depression



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, (4) weight gain, (5) decreased appetite, (6) increased appetite, (7) insomnia, (8) hypersomnia, (9) psychomotor agitation, (10) psychomotor retardation, (11) fatigue, (12) worthlessness or guilt, (13) concentration problems, and (14) suicidal thoughts.

It is hypothesized that if someone is vulnerable to depression (i.e., symptoms are strongly connected), mild stress could be enough to trigger a cascade of symptoms that can eventually lead to a full-blown depressive episode (Cramer et al., submitted). This model is made to illustrate this effect of vulnerability. This means that this model predicts that a person that is vulnerable and develops a depression due to, for example, severe marital problems, will not recover automatically when the marital problems are solved. More is needed to trigger recovery from depression. Conversely, for someone that is resilient to depression (i.e., symptoms are weakly connected), mild stress cannot trigger a cascade of symptoms. Severe stress can lead to a full-blown depression, but when the stress subsides, the depression will subside too. This effect is also known as the hysteresis effect.


The model is based on two parameters for the whole network that can be controlled by the sliders: CONNECTION-STRENGTH, EXTERNAL-ACTIVATION. Furthermore, the stress levels can be varied per symptom with the sliders on the right of the monitor.
The network architecture is based on partial correlations between symptoms of a dataset on psychiatric and substance use disorders (VATSPUD; Prescott, Aggen & Kendler, 2000; Kendler & Prescott, 2006).
At each time step (tick), the probability of a symptom being developed (turning red), is calculated for each symptom. This probability depends on certain parameters as well as the total activation of its neighbors at the previous tick. These parameters are regression parameters (a threshold and a slope) for each symptom by fitting a logistic regression model on the VATSPUD data in which each symptom was regressed on the total score of its neighbors). The probability to become activated for symptom i is represented as:

1 / 1 + e^(a(b - A))

Here, A is the total amount of stress on symptom i. The amount of stress consists of the individual stress level of symptom i (the value on the slider of symptom i), the amount of external activation (the amount of stress on the whole network, indicated by the slider EXTERNAL-ACTIVATION) and the influence of the activation of the neighbors of symptom i. The influence of the neighbors depends on whether or not they are activated and on the strength of the connection between the activated neighbor and symptom i. 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. The external activation can be seen as 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.
Parameter a is a symptom-specific parameter that controls the steepness of the probability function. When a is high, a change in A results larger change in the probability of becoming infected.
Parameter b is a symptom-specific parameter for the threshold of a symptom; a symptom with a higher threshold needs more activation (from its neighbors for example) to become infected than symptoms with a lower threshold.


Use the sliders CONNECTION-STRENGTH and EXTERNAL-ACTIVATION to choose the initial settings for the model. Press SETUP to create the network. To run the model, press the GO button. If you want to start a new simulation press SETUP again. The 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 (per tick). As the EXTERNAL-ACTIVATION slider is adjusted, the green line moves up or down accordingly. The same goes for the CONNECTION_STRENGTH slider and the grey line.
In the HYSTERESIS PLOT, the hysteresis effect can be demonstrated. At a certain fixed connection-strength and changing external activation, it will be made visible that the shifts from depressed to healthy states and vice versa generally follow a non-linear pattern (hysteresis).
The HISTOGRAM represents the frequency of the number of activated symptoms per tick of the last 1000 ticks.


The network can be regarded as disordered when the total number of active symptoms is larger than 7. In the NETWORK STATUS plot this is when the network is above the black line. Conversely, the network is regarded healthy when there are 7 or less symptoms activated (below the black line).


Press SETUP and then GO. When you let the network run for a while, notice that, with the initial settings (CONNECTION-STRENGTH 1.20, EXTERNAL-ACTIVATION 0.0 and stress levels of all symptoms 0), the activation of the network is around the black line in the NETWORK STATUS plot. Change the EXTERNAL-ACTIVATION and see how that affects the activity of the network. Then increase the CONNECTION-STRENGTH and see if the influence of the EXTERNAL-ACTIVATION is altered.

To demonstrate a hysteresis effect, choose a CONNECTION-STRENGTH. Now, increase the EXTERNAL-ACTIVATION slowly at a constant pace. At what level of external activation does the network switch to a depressed state? And when you decrease the external activation at the same pace: at what level does the network switch into a healthy state? Go back and forth with the EXTERNAL-ACTIVATION slider a couple of times. Can you find a way to make the hysteresis effect bigger?

With the ADMINISTER-SHOCK button, you can deactivate all symptoms at once. It is as if you give the network an electric shock that resets all the symptoms. Try to find a setting of the CONNECTION-STRENGTH and EXTERNAL-ACTIVATION that creates a disordered network (above the black line in the NETWORK STATUS plot) whereby administering a shock, makes the system healthy again.

With the stress sliders per symptom, you can intervene on a specific symptom by ‘curing’ that symptom (by lowering the stress level). Can you make a disordered network and make it healthy again by focusing your treatment on a few symptoms? What symptoms are most effective to intervene on?


The model could be extended by incorporating the kindling effect (Kraepelin, 1921). The kindling effect is the phenomenon that stressful life events play the greatest role in the first onset of Major Depression. Subsequent episodes are elicited by less and less severe life events (Monroe, Torres, Guillaumot, Harkness, Roberts, Frank & Kupfer, 2006). This could be incorporated in the model by making the connections between the symptoms stronger after every depressive episode. So, each time the network status goes above the black line (or after a certain amount of times in a certain period), the connections become a bit stronger.





Cramer, A. O. J., Giltay, E. J., Van Borkulo, C. D., Van der Maas, H. J., Kendler, K. S., Scheffer, M., and Borsboom, D. (submitted). I feel sad therefore I do not sleep: Major depression as a complex system.

Kendler, K. S., & Prescott, C. A. (2006). Genes, environment, and psychopathology: Understanding the causes of psychiatric and substance use disorders. Guilford Press.

Kraepelin E: Manic-depressive insanity and paranoia. Edinburgh, Scotland: E. & S. Livingstone, 1921

Monroe SM, Torres LD, Guillaumot J, Harkness KL, Roberts JE, Frank E, Kupfer D: Life stress and the long-term treatment course of recurrent depression: III. nonsevere life events predict recurrence for medicated patients over 3 years. J Consult Clin Psychol 2006; 74:112-120

Prescott CA, Aggen SH, Kendler KS: Sex-specific genetic influences on the comorbidity of alcoholism and major depression in a population-based sample of US twins. Arch Gen Psychiatry 2000; 57:803-811

Prescott, C. A., Aggen, S. H., & Kendler, K. S. (2000). Sex-specific genetic influences on the comorbidity of alcoholism and major depression in a population-based sample of US twins. Archives of General Psychiatry, 57, 803-811.



- Van Borkulo, C.D., Van der Maas, H.L.J., Borsboom, D., and Cramer, A.O.J. (2013). NetLogo Vulnerability_to_Depression. Center for Connected Learning and Computer-Based Modeling, Northwestern University, Evanston, IL.

In other publications, please use:
- Copyright 2013 Claudia D. van Borkulo, Han L. J. van der Maas, Denny Borsboom, and Angelique O. J. Cramer. All rights reserved. See for terms of use.

(back to the NetLogo User Community Models)