Modeling Social Forces in Microsoft Excel
We know that we are heavily influenced by the opinions and decisions of others, but how can we create a visual representation of that?
Recently, for a problem set in my Behavorial Economics course, we were asked to create a three dimensional model of social forces. The inspiration for this model is derived from Chapter 2 of Weidlich and Haag.
Goals:
Clarification
The following words are not my own, but that of my professor, Raymond Hawkins. I believe that he does a really good job explaining this process so I included his outline of the steps for the process below. This is not my work, I only wanted to reproduce it because I was so fascinated with this problem set in particular. I find it quite interesting to share small snippets of my studies; it is quite a privilege.
From Professor Hawkins:
This involves using the master equation with boundary conditions and transition probabilities.
To solve the master equation numerically we will use a discretization known as the Euler approximation:
; + = ; +
which says that to advance the probability density from time to time + one simply adds to ; + the product . Since is given by the right-hand side of the master equation we have, for a chosen time step , a complete solution: given an initial probability density ( ), the temporal evolution of ( ) can be calculated.
The simulation includes:
: a preference parameter. A positive value increases the probability that an individual changes from opinion 2 to opinion 1. A negative value increases the probability that an individual changes from opinion 2 to opinion 1.
: an adapatation parameter. A positive value increases the probability of an individual changing to the majority opinion. A negative value decreases the probability of an individual changing to the majority opinion.
: a flexibility parameter. Determines the frequency with which (or time scale over which) opinion changes occur.
In cells B3-B9 we are given variables for the simulation. To be clear: there are economic agents with psychological parameters , and . The variables and will be used to specify the probability density at , and the time step for the simulation is . This simulates a situation where the economy for is governed by the variables and and for by the variables and .
The steps to complete the simulation are as follows:
We need to specify the time axis to create the graph. The values of the time axis are shown in column A, beginning in cell A25 with and increasing by until is reached in cell A625.
We also need to specify the configuration axis for the graph. The values of the configuration axis are shown in row 24, beginning in cell B24 with and increasing by 1 across row 24 until is reached in cell AZ24.
To simulate the temporal evolution of a probability density we need to provide the initial condition, or . There are a variety of ways of getting this of which the simplest is to use the stationary solution:
where
which is Eq. 2.126 of Weidlich & Haag with the normalization factor . To calculate the initial condition we start by calculating:
since this puts all the dependence on the right-hand side. These values are shown in row 23 (labeled “Prenormalized”) starting in cell B23 and continuing until cell AZ23: the Excel function COMBIN was used to calculate the binomial coefficient. To calculate the normalization factor , note that summing the left-hand side of
yields because is a normalized probability density that sums to one. Thus, the sum of the values we have in row 23 is equal to and that sum is shown in cell C22. The normalized initial condition, shown in cells B25 to AZ25 is obtained by dividing the corresponding cells in row 23 by the value in cell C22.
To evolve the probability density through time using the Euler algorithm given in the equation:
; + = ; +
we need values for which we can get from the master equation in the nearest-neighbor approximation. To this end we need values for and . The results of using the expressions on slide 13 of lecture 5 are shown in the screenshot below:
In columns AX-AZ we see in rows 23-25 the calculation described above for where . Beginning in column BC we see:
( a ) The values of in row 22.
( b ) The values of in row 23.
( c ) The values of in row 24 (a repeat of those to the left for convenience.)
( d ) The values of in cells BC25 through DA25
The values of in cells B26-AZ26 are computed from the values in row 25 using the Euler approximation:
,
and the corresponding are given in cells BC26-DA26. You can extend this to all - and thus complete the simulation - by repeating (copying) the calculations in row 26 (columns B to DA) through row 625.
The data in the rectangle defined by the cells from A24 to AZ625 can now be graphed.
End of Professor Hawkins
I decided to include a few screenshots of the simulation, for values of , and .
Here is the graph for :
For :
For :
For :
Notice how as we increase the value of , the graph becomes more splintered towards either side. For , the graph looks very evenly distributed. However, as increases, we see the graph start to split into two distinct sides. This illustrates how, as increases, individuals are more likely to change their opinion to that of the majority. A majority of either opinion represents a society that more closely resembles a totalitarian regime, while the opposite is that of a liberal one. I’ll end this short analysis with a quote from the last slide of lecture:
"[a] ‘sound’ banker, alas! is not one who foresees danger andavoids it, but one who, when he is ruined, is ruined in aconventional way along with his fellows, so that no one canreally blame him.”– Keynes 1931.