Contents:
1. Introduction
2. Getting Started
3. Custom Installation
4. Requirements
5. Acknowledgment
6. License
7. Citation
The MATLAB toolbox MatTuOlig contains a set of functions to study problems of industrial cooperation. From a linear Cournot/Bertrand oligopoly situation of Shubik/Dixit type different transferable utility games can be constructed from the associated partition function games. In this context, pre- and post-merger Nash equilibria are derived from the so-called gamma and delta partition of the player set (see Hart and Kurz (1983)) from which the gamma and delta TU games are obtained. These resultant transferable utility games can then be used as inputs by the toolbox MatTuGames from the same author to calculate some solutions as well as properties for these cooperative game types.
In order to get some insight how to derive from a linear Cournot/Bertrand oligopoly situation of Shubik/Dixit type different transferable utility games, we construct several gamma and delta 12-person TU oligopoly games. For the linear type of Shubik/Dixit oligopoly situation it is sufficient to consider three parameter values. The intercept of a linear (inverse) demand denoted by the symbol a, a substitution parameter denoted by the symbol g, and a vector of marginal costs of the firms. These pieces of information are enough to compute in a first step the pre-merger equilibria. However, to get the associated gamma and delta oligopoly transferable utility games, the corresponding partitions must be passed to the function body from which in an initial step the post-merger equilibria are computed.
Before we can proceed, we need to check a basic installation of the toolbox MatTuGames to check the resultant solution concepts and game properties. Otherwise, the user must proceed stepwise till the first error occurs, which indicates that the called function is part of the MatTuGames toolbox.
>> disp('Checking basic MatTuGames installation, before we proceed');
Checking basic MatTuGames installation, before we proceed
>> rtv = exist('PreKernel', 'file')
rtv =
2
>> if rtv>0
else
disp('https://github.com/himeinhardt/MatTuGames');
error('MatTuGames is not installed or it is not in the Matlab path!')
end
To start with, let us consider a 12-firm TU oligopoly situation. First, we define the cardinality of the set of firms by
>> n=12;
>> pl=1:n;
Then, we specify the substitution parameters of the Cournot and Bertrand oligopoly situation respectively by
>> g_c=28/29;
>> g_b=28;
Furthermore, we need to construct the vector of intercepts of Shubik demand functions, which is accomplished by initializing the subsequent vector
>> a1=ones(1,n)*10;
To complete parameter set, the vector of marginal costs of the firms must be given.
>> slc=1;
>> c1=(slc*pl-1)/8;
Finally, a numerical tolerance value is introduced with
>> tol=10^4*eps;
To proceed further, we need to determine a coalition structure. We decide to start with a gamma coalition structure, which is computed with the command:
>> cs_g=gamma_cs(n);
To see that the TU oligopoly situation is well-defined, we calculate the Cournot-Shubik pre-merger equilibrium by
>> [cpf1,x1]=ShubikPreMergerEq(a1,g_c,c1)
cpf1 =
19.2863 16.8757 14.6260 12.5371 10.6091 8.8420 7.2358 5.7904 4.5059 3.3823 2.4195 1.6177
x1 =
12.9534 12.1169 11.2803 10.4438 9.6073 8.7707 7.9342 7.0976 6.2611 5.4246 4.5880 3.7515
Notice that the first array returns the associated profits of firms at the Cournot equilibrium (pre-merger, situation before firms can merge activities). However, the second array contains the quantities sold by the firms at the Cournot equilibrium.
Similarly, we evaluate the Bertrand-Shubik pre-merger equilibrium by
>> [bpf1,p1]=ShubikBertPreMergerEq(a1,g_b,c1)
bpf1 =
12.8716 10.5717 8.4981 6.6506 5.0292 3.6340 2.4650 1.5222 0.8055 0.3150 0.0506 0.0124
p1 =
0.6948 0.7546 0.8145 0.8744 0.9343 0.9942 1.0540 1.1139 1.1738 1.2337 1.2936 1.3534
To compute some post-merger equilibria of Cournot/Bertrand Shubik type, some coalition structures need to be selected. We choose exemplarily the following coalition structures:
>> cs_g{1}
cs_g{1} =
1 2 4 8 16 32 64 128 256 512 1024 2048
>> cs_g{5}
cs_g{5} =
5 2 8 16 32 64 128 256 512 1024 2048
>> cs_g{155}
cs_g{155} =
155 4 32 64 256 512 1024 2048
From this, the post-merger Cournot and Bertrand equilibria of Shubik type are evaluated for coalition structure:
>> dec2bin(cs_g{1},12)
ans =
12×12 char array
'000000000001'
'000000000010'
'000000000100'
'000000001000'
'000000010000'
'000000100000'
'000001000000'
'000010000000'
'000100000000'
'001000000000'
'010000000000'
'100000000000'
The post-merger Cournot equilibrium w.r.t. coalition structure cs_g{1} is given by:
>> [cpf_csg1,x_csg1]=ShubikPostMergerEq(cs_g{1},a1,g_c,c1)
cpf_csg1 =
19.2863 16.8757 14.6260 12.5371 10.6091 8.8420 7.2358 5.7904 4.5059 3.3823 2.4195 1.6177
x_csg1 =
12.9534 12.1169 11.2803 10.4438 9.6073 8.7707 7.9342 7.0976 6.2611 5.4246 4.5880 3.7515
The first array provides the profit profile of firms at the Cournot equilibrium of quantities sold by the firms. In contrast, the second array returns the Cournot equilibrium profile of quantities sold.
The post-merger Bertrand equilibrium w.r.t. coalition structure cs_g{1} is given by:
>> [bpf_bsg1,p_csg1]=ShubikBertPostMergerEq(cs_g{1},a1,g_b,c1)
bpf_bsg1 =
12.8716 10.5717 8.4981 6.6506 5.0292 3.6340 2.4650 1.5222 0.8055 0.3150 0.0506 0.0124
p_csg1 =
0.6948 0.7546 0.8145 0.8744 0.9343 0.9942 1.0540 1.1139 1.1738 1.2337 1.2936 1.3534
The first array provides the profit profile of firms at the Bertrand equilibrium of the charged prices by the firms. In contrast, the second array returns the Bertrand equilibrium profile of the charged prices.
We proceed to get the equilibria for the coalition structure
>> dec2bin(cs_g{5},12)
ans =
11×12 char array
'000000000101'
'000000000010'
'000000001000'
'000000010000'
'000000100000'
'000001000000'
'000010000000'
'000100000000'
'001000000000'
'010000000000'
'100000000000'
Again, we compute the Cournot-Shubik equilibrium and the associated profits for coalition structure cs_g{5}:
>> [cpf_csg5,x_csg5]=ShubikPostMergerEq(cs_g{5},a1,g_c,c1)
cpf_csg5 =
27.1166 18.7191 14.1326 12.0807 10.1896 8.4594 6.8900 5.4815 4.2340 3.1472 2.2214
x_csg5 =
10.1075 12.7615 6.4825 11.0884 10.2519 9.4154 8.5788 7.7423 6.9058 6.0692 5.2327 4.3961
Next, we focus on the Bertrand-Shubik equilibrium and the associated profits for coalition structure cs_g{5}:
>> [bpf_bsg5,p_csg5]=ShubikBertPostMergerEq(cs_g{5},a1,g_b,c1)
bpf_bsg5 =
21.5588 10.7295 6.7758 5.1382 3.7268 2.5415 1.5824 0.8494 0.3427 0.0621 0.0076
p_csg5 =
0.7246 0.7593 0.8496 0.8791 0.9390 0.9988 1.0587 1.1186 1.1785 1.2384 1.2982 1.3581
And finally, we focus on the post-merger equilibria for coalition structure:
>> dec2bin(cs_g{155},12)
ans =
8×12 char array
'000010011011'
'000000000100'
'000000100000'
'000001000000'
'000100000000'
'001000000000'
'010000000000'
'100000000000'
For this coalition structure, the Cournot-Shubik equilibrium and the associated profits are given by
>> [cpf_csg155,x_csg155]=ShubikPostMergerEq(cs_g{155},a1,g_c,c1)
cpf_csg155 =
45.5688 24.8223 17.0682 14.8052 10.7618 8.9815 7.3620 5.9034
x_csg155 =
9.8318 8.0193 14.6954 4.3943 2.5818 12.1858 11.3492 -2.8557 9.6762 8.8396 8.0031 7.1665
Similarly, we get the Bertrand-Shubik equilibrium and the associated profits through
>> [bpf_bsg155,p_csg155]=ShubikBertPostMergerEq(cs_g{155},a1,g_b,c1)
bpf_bsg155 =
40.6590 9.9511 4.6041 3.2740 1.2925 0.6410 0.2156 0.0164
p_csg155 =
0.8432 0.9057 0.8609 1.0307 1.0932 1.0405 1.1004 1.2807 1.2202 1.2800 1.3399 1.3998
By these samples, we saw that the post-merger equilibria can be successfully computed, allowing us to construct the associated Cournot/Bertrand Shubik TU oligopoly game w.r.t. the gamma coalition structure as follows:
>> vcg=ShubikGammaGame(a1,g_c,c1);
>> vbg=ShubikBertGammaGame(a1,g_b,c1);
A pre-kernel element of the Cournot-Shubik gamma oligopoly game can be computed through
>> tic;pk_vcg=PreKernel(vcg);pk_vcgt=toc
pk_vcgt =
0.0105
>> pk_vcg
pk_vcg =
33.3396 30.9290 28.6793 26.5904 24.6624 22.8953 21.2891 19.8437 18.5592 17.4356 16.4728 15.6709
whenever the MatTuGames toolbox is installed on the system.
Similar, a pre-kernel element of the Bertrand-Shubik gamma oligopoly game is obtained by
>> tic;pk_vbg=PreKernel(vbg);pk_vbgt=toc
pk_vbgt =
0.0042
>> pk_vbg
pk_vbg =
31.5334 29.2335 27.1599 25.3123 23.6910 22.2958 21.1268 20.1839 19.4673 18.9767 18.7124 18.6742
Of course, the Shapley value for these games is also be computable whenever the toolbox MatTuGames is installed on the computer.
The Shapley value of the Cournot-Shubik gamma oligopoly game can be computed while executing:
>> tic;sh_vcg=ShapleyValue(vcg);sh_vcgt=toc
sh_vcgt =
0.0123
>> sh_vcg
sh_vcg =
33.3179 30.7340 28.3642 26.2084 24.2666 22.5389 21.0252 19.7255 18.6399 17.7684 17.1108 16.6673
Analogously, to compute the Shapley value of the Bertrand-Shubik gamma oligopoly game is achieved while invoking
>> tic;sh_vbg=ShapleyValue(vbg);sh_vbgt=toc
sh_vbgt =
0.0061
>> sh_vbg
sh_vbg =
34.8008 31.9321 29.2821 26.8506 24.6378 22.6434 20.8677 19.3105 17.9720 16.8520 15.9505
Next, let us verify the computed pre-kernel elements. By doing so, we examine in an initial step the computed per-kernel element of the Cournot-Shubik gamma oligopoly game. Invoking the checking routine confirms that the calculated vector is indeed a pre-kernel element.
>> PrekernelQ(vcg,pk_vcg)
ans =
logical
1
The same argument holds true for the Bertrand-Shubik gamma oligopoly game, as we observe through:
>> PrekernelQ(vbg,pk_vbg)
ans =
logical
1
Moreover, we can even examine on the correctness of the Shapley value. Exemplarily, we illustrate this on the computed pre-kernel of the Cournot-Shubik gamma oligopoly game. As expected, the pre-kernel element is not the Shapley value.
>> ShapleyQ(vcg,pk_vcg)
ans =
logical
0
By contrast, verifying the computed Shapley value of the game, returns an affirmation, as shown by
>> ShapleyQ(vcg,sh_vcg)
ans =
logical
1
Not only a pre-kernel element or the Shapley value is computable, but also the pre-nucleolus/nucleolus. This simply accomplished through
>> tic;prnc_vcg=PreNucl_llp(vcg);toc
Elapsed time is 0.092432 seconds.
>> prnc_vcg
prnc_vcg =
33.3396 30.9290 28.6793 26.5904 24.6624 22.8953 21.2891 19.8437 18.5592 17.4356 16.4728 15.6709
The computed array is indeed the pre-nucleolus of the Cournot-Shubik gamma game while checking a Kohlberg criterion by
>> balancedCollectionQ(vcg,prnc_vcg)
ans =
logical
1
This vector coincides with computed pre-kernel element from above.
>> balancedCollectionQ(vcg,pk_vcg)
ans =
logical
1
Analogously, we illustrate it for the Bertrand-Shubik gamma game through:
>> tic;prnc_vbg=PreNucl_llp(vbg);toc
Elapsed time is 0.028489 seconds.
>> prnc_vbg
prnc_vbg =
31.5334 29.2335 27.1599 25.3123 23.6910 22.2958 21.1268 20.1839 19.4673 18.9767 18.7124 18.6742
Again, we show that this vector satisfies a Kohlberg criterion through:
>> balancedCollectionQ(vbg,prnc_vbg)
ans =
logical
1
This solution vector is once again identical to the computed pre-kernel element.
>> balancedCollectionQ(vbg,pk_vbg)
ans =
logical
1
Core existence of both games can be checked out by
>> CddCoreQ(vcg)
ans =
logical
1
>> CddCoreQ(vbg)
ans =
logical
1
And convexity of the games by
>> convex_gameQ(vcg)
ans =
logical
0
>> convex_gameQ(vbg)
ans =
logical
1
and much more. For a deeper discussion of the function set provided by the toolbox consult the Manual or type help mat_tug to get a short overview.
To install the toolbox, we recommend a custom installation. Having downloaded the file with the suffix .mltbx file, navigate to it within the Matlab file explorer, double-click on the mltbx file mat_tuoligV1d0.mltbx and click "install". Alternatively, right-click on the file with the suffix .mltbx, and click "Install."
Additional instructions can be found at the URL:
The mltbx file mat_tuoligV1d0.mltbx is provided at
This release of MatTuOlig was developed and tested using Matlab R2024b and earlier releases. To study cooperative game solutions or properties the toolbox MatTuGames is required, which can be found at the URL:
To run the toolbox even in parallel mode, Matlab's Parallel Computing Toolbox is needed.
For connecting the Mathematica Package TuGames, the Mathematica Symbolic Toolbox is required, which can be found under the URL:
whereas TuGames Version 3.1.4 can be downloaded from the URL:
We recommend a custom installation with paclet, which can be found at
The MatTuOlig toolbox should work with all platforms.
Moreover, the toolbox works also with the game theory toolbox written by Jean Derks, which can be requested from:
Some adjusted files that fix a problem with closed loops under certain game classes ships with the toolbox MatTuGames.
The toolbox of Jean Derks can be used to compute the pre-nucleolus up to 10-persons, if one has no license of Matlab's optimization toolbox.
To summarize, apart from the mentioned software, the toolbox requires the following MATLAB toolboxes:
MATLAB Parallel Server, Parallel Computing Toolbox,
to get full functionality in serial as well as in parallel.
The author acknowledges support by the state of Baden-Württemberg through bwHPC.
Of course, the usual disclaimer applies.
This project is licensed under the FreeBSD License - see the LICENSE file.
For citation consult the URL:
Holger I. Meinhardt Institute of Operations Research University of Karlsruhe (KIT) E-mail: holger.meinhardt ät partner.kit.edu