Using TikZ and PGFPlots for Asset Pricing with Entry
July 29, 2021
TikZ and PGFPlots in “Asset Pricing with Entry and Imperfect Competition”
To use the code just insert it into any LaTeX code with the appropriate tikz libraries; see here for examples.
Summary of the economy #
From blueprints, to production across two industries and aggregation of varieties into a final consumption bundle:
\tikzset{
pil/.style={ ->, thick, shorten <=0.1pt, shorten >=0.1pt,},
dasharrow/.style={ ->, thick, shorten <=1pt, shorten >=1pt, dashed},
}
\begin{tikzpicture}[scale=0.75]
\begin{scope}[color=black]
\draw (7,5) circle (1.5 cm);
\end{scope}
\node (const) at (7,5) { $\mathbf{C_t}$ };
\node[anchor=west, text width=3.5cm] (cons) at (14,5) { {Final consumption:\\ aggregation of industry goods}};
% differentiate industries
\node[text width=3cm](industry1) at (4,2.4) {};
\node(industry2) at (10,2.4) {};
% consumption from industry east
\node (c1) at (8.5,5) {};
\node (c2) at (10,2) {};
\draw[pil, bend right=35, draw=blue ] (industry2.south) to (c1.east);
\node[anchor=west] (cons2) at (10,4) { $\mathcal{C}_{2,t}$ };
% consumption from industry west
\node (c3) at (4,2) {};
\node (c4) at (5.5,5) {};
\draw[pil, bend left=35, draw=red ] (industry1.south) to (c4.west);
\node[anchor=east] (cons1) at (4,4) { $\mathcal{C}_{1,t}$ };
\begin{scope}[color=red]
\draw (4,0) circle (2cm);
\end{scope}
\begin{scope}[color=blue]
\draw (10,0cm) circle (2cm);
\end{scope}
\node[anchor=west, text width=3cm] (cons) at (14,0) { {Industry Level Product Market Competition}};
%firms in first industry circle
\node (11) at (5,1) {\circle*{4}};
\node (12) at (3,-0.1) {\circle*{4}};
\node (13) at (5.1,-0.8) {\circle*{4}};
\node (14) at (3.6,-1.1) {\circle*{4}};
\node (15) at (4,1.6) {\circle*{4}};
\node (16) at (4,0) {\circle*{4}};
\node (17) at (3.8,-0.8) {\circle*{4}};
\node (18) at (3.2,-1) {\circle*{4}};
\node (19) at (4.8,-1.1) {\circle*{4}};
\node (110) at (3,1) {\circle*{4}};
\node (111) at (5.2,0.1) {\circle*{4}};
%firms in second industry circle
\node (21) at (11,1) {\circle*{4}};
\node (22) at (9,-1) {\circle*{4}};
\node (24) at (10,-.5) {\circle*{4}};
\node (25) at (11,0) {\circle*{4}};
\node[anchor=west] (omega11) at (0,1) {firm} ;
\draw[pil, bend left=30 ] (omega11.east) to (12.west);
\node[anchor=west] (omega12) at (0,-2.5) {industry} ;
\draw[pil, bend right=20 ] (omega12.east) to (3.5,-2cm);
%innovators
\draw[thin] (2.5,-2.8)--(6,-2.8);
\draw[ultra thick] (8,-2.8)--(11.5,-2.8);
\node (31) at (4.8,-3.2) {\circle{4}};
\node (32) at (4.4,-3.5) {\circle{4}};
\node (33) at (5.2,-3.8) {\circle{4}};
\node (34) at (5.8,-3.4) {\circle{4}};
\node (35) at (4.6,-4.2) {\circle{4}};
\node (36) at (5.5,-4.2) {\circle{4}};
\node (37) at (10,-3.2) {\circle{4}};
\node (39) at (10.2,-3.8) {\circle{4}};
\node (310) at (9.8,-3.4) {\circle{4}};
\node (312) at (9.9,-4.1) {\circle{4}};
\node (313) at (9.1,-4) {\circle{4}};
\node (314) at (9.2,-3.2) {\circle{4}};
\node[anchor=west, text width=3cm,] (omega13) at (0,-4.8) {potential entrant \\(blueprint)} ;
\node (omega13b) at (3.3,-4.6) {} ;
\draw[pil, bend right=10 ] (omega13b.east) to (35.west);
\draw[dasharrow, bend right=30, draw=red ] (31.east) to (13.south);
\draw[dasharrow, bend left=30, draw=blue ] (310.west) to (22.south);
\node [anchor=west, text width=3.5cm, ] (innov) at (14,-3.5) {Innovation Sector};
\end{tikzpicture}
Industry Competition #
Hotelling-Salop model of competition:
\newcommand{\overbar}[1]{\mkern 1.5mu\overline{\mkern-1.5mu#1\mkern-1.5mu}\mkern 1.5mu}
\begin{tikzpicture}
\begin{scope}[shift={(-7,0)}]
\foreach \x [count=\p] in {0,...,5} {
\node[shape=circle,fill=black, scale=0.5] (\p) at (\x*60:1) {};
\node[shape=circle,fill=red, scale=0.5] (\p) at (-30-\x*60:1) {};
};
\draw (1) arc (-30:360:1);
\draw [dotted, gray] (-1,0) -- (1,0);
\node[] (Mlo) at (0,0.2) {$\overbar{M}_{lo}$};
\end{scope}
\foreach \x [count=\p] in {0,...,5} {
\node[shape=circle,fill=black, scale=0.5] (\p) at (\x*60:3) {};
\node[shape=circle,fill=red, scale=0.5] (\p) at (-30-\x*60:3) {};
};
\draw (1) arc (-30:360:3);
\draw [dotted, gray] (-3,0) -- (3,0);
\node[] (Mhigh) at (0,0.2) {$\overbar{M}_{hi}$};
\end{tikzpicture}
Entry Elasticity #
\begin{tikzpicture}[domain=0:5,
scale=1, thick]
\tikzset{
% >=stealth' ,
pil/.style={ ->, thick, shorten <=0.1pt, shorten >=0.1pt,},
dasharrow/.style={ ->, thick, shorten <=1pt, shorten >=1pt, dashed},
%Define style for boxes
}
\usetikzlibrary{calc} %allows coordinate calculations.
\tikzstyle{loosely dashed} = [dash pattern=on 6pt off 6pt]
\tikzstyle{dasharrow} = [->, thick, shorten <=1pt, shorten >=1pt, dashed]
% dot/.style={circle,fill=black,minimum size=4pt,inner sep=0pt, outer sep=-1pt},
%Define linear parameters for supply and demand
\def\dint{4.5} %Y-intercept for DEMAND.
\def\dslp{-0.5} %Slope for DEMAND.
\def\sint{2} %Y-intercept for SUPPLY.
\def\sslp{0.5} %Slope for SUPPLY.
\def\demand{\x,{\dslp*\x+\dint}}
\def\supply{\x,{\sslp*\x+\sint}}
% Define coordinates.
\coordinate (ints) at ({(\sint-\dint)/(\dslp-\sslp)},{(\sint-\dint)/(\dslp-\sslp)*\sslp+\sint});
\coordinate (ep) at (0,{(\sint-\dint)/(\dslp-\sslp)*\sslp+\sint});
\coordinate (eq) at ({(\sint-\dint)/(\dslp-\sslp)},0);
\coordinate (dint) at (0,{\dint});
\coordinate (sint) at (0,{\sint});
% DEMAND
\draw[thick,color=dark-gray, domain=0.25:5.25] plot (\demand) node[right] {Demand};
% SUPPLY
\draw[very thick,color=black, domain=0.25:5.25] plot (\supply) node[right] {Supply};
% supply going to infinity
\def\fe{3.25}
\draw [loosely dashed, color=black] (0.2, \fe) -- (5.5,\fe);
\filldraw[fill=black, draw=black] (0,\fe) circle (0.1);
\node[anchor=east] (fe) at (-0.1,\fe) { $\bar{v}_h$ };
\node[anchor=south, color=dark-gray] (zeta) at (6,\fe) { $\zeta \to \infty$};
\draw[->, bend left=30, draw=dark-gray] (4.6,4.2) to (5.25,\fe+0.1);
% Draw axes, and dotted equilibrium lines.
\draw[->] (0,0) -- (6.2,0) node[right] {\Large{ $M_h$ }}; % axes
\draw[->] (0,0) -- (0,6.2) node[above] {\Large{ $v_h$ }};
\end{tikzpicture}
\begin{tikzpicture}[domain=0:5,
scale=1,thick]
\usetikzlibrary{calc} %allows coordinate calculations.
\tikzstyle{loosely dashed} = [dash pattern=on 6pt off 6pt]
\tikzstyle{dasharrow} = [->, thick, shorten <=1pt, shorten >=1pt, dashed]
%Define linear parameters for supply and demand
\def\dint{4.5} %Y-intercept for DEMAND.
\def\dslp{-0.5} %Slope for DEMAND.
\def\sint{-2} %Y-intercept for SUPPLY.
\def\sslp{2} %Slope for SUPPLY.
\def\demand{\x,{\dslp*\x+\dint}}
\def\supply{\x,{\sslp*\x+\sint}}
% Define coordinates.
\coordinate (ints) at ({(\sint-\dint)/(\dslp-\sslp)},{(\sint-\dint)/(\dslp-\sslp)*\sslp+\sint});
\coordinate (ep) at (0,{(\sint-\dint)/(\dslp-\sslp)*\sslp+\sint});
\coordinate (eq) at ({(\sint-\dint)/(\dslp-\sslp)},0);
\coordinate (dint) at (0,{\dint});
\coordinate (sint) at (0,{\sint});
% DEMAND
\draw[thick,color=dark-gray, domain=0.25:5] plot (\demand) node[right] {Demand};
% SUPPLY
\draw[very thick,color=black, domain=1.25:4] plot (\supply) node[right] {Supply};
\def\Me{2.6}
\draw [loosely dashed, color=black] (\Me, 0) -- (\Me, 6);
\filldraw[fill=black, draw=black] (\Me, 0) circle (0.1);
\node[anchor=north] (me) at (\Me, -0.1) { $\bar{M}_h$ };
\node[anchor=west, color=dark-gray] (zeta) at (\Me, 0.5) { $\zeta \to 0$};
\draw[->, bend right=20, draw=dark-gray] (1.6,1) to (2.5,0.5);
% Draw axes, and dotted equilibrium lines.
\draw[->] (0,0) -- (6.2,0) node[right] {\Large{ $M_h$ }}; % axes
\draw[->] (0,0) -- (0,6.2) node[above] {\Large{ $v_h$ }};
\end{tikzpicture}