Skip to content

Commit

Permalink
Merge branch 'develop' of github.com:highperformancecoder/minsky into…
Browse files Browse the repository at this point in the history
… develop
  • Loading branch information
highperformancecoder committed Apr 29, 2024
2 parents b2abade + f826cbb commit 8aa9df2
Show file tree
Hide file tree
Showing 158 changed files with 105,329 additions and 1,662 deletions.
1,226 changes: 1,226 additions & 0 deletions doc/GettingStarted-Minsky.tex

Large diffs are not rendered by default.

1,086 changes: 198 additions & 888 deletions doc/GettingStarted.tex

Large diffs are not rendered by default.

223 changes: 223 additions & 0 deletions doc/Introduction-Minsky.tex
@@ -0,0 +1,223 @@
\chapter{Introduction}
\label{Introduction}

\section{New to system dynamics?}
\label{intro:new}

Minsky is one of a family of ``system dynamics'' computer
programs. These programs allow a dynamic model to be constructed, not
by writing mathematical equations or numerous lines of computer code,
but by laying out a model of a system in a block diagram, which can then
simulate the system. These programs are now the main tool used by
engineers to design complex products, ranging from small electrical
components right up to passenger jets.


Minsky adds another means to create the dynamic equations that are
needed to define monetary flows---the ``Godley Table''---which is
discussed in the next section for users who are experienced in
system dynamics. In this section, we'll give you a quick overview of
the generic system dynamics approach to building a model.


Though they differ in appearance, they all work the same way:
variables in a set of equations are linked by wires to mathematical
operators. What would otherwise be a long list of equations is
converted into a block diagram, and the block diagram makes the causal chain
in the equations explicit and visually obvious.

For example, say you wanted to define the rate of employment as
depending on output (GDP), labor productivity and population. Then you
could define a set of equations in a suitable program (like Mathcad):

\begin{eqnarray*}
\mathrm{GDP}&:=&100\\
\mathrm{LaborProductivity}&:=&1\\
\mathrm{Population}&:=&100\\
\mathrm{Workers}&:=&\mathrm{GDP}\div\mathrm{LaborProductivity}\\
\mathrm{EmpRate}&:=&\mathrm{Workers}\div\mathrm{Population}\\
\mathrm{EmpRate}&=&1
\end{eqnarray*}

Or you could define it using a block diagram, such as Minsky:

\begin{center}
%\fwhtmladdimg{NewItem1.png}
\resizebox{\textwidth}{!}{\includegraphics{images/NewItem1.eps}}
\end{center}

For a simple algebraic equation like this, modern computer algebra
programs like Mathcad are just as good as a block diagram programs like
Vissim or Minsky. But the visual metaphor excels when you want to describe a
complex causal chain.


These causal chains always involve a relationship between stocks and
flows. Economists normally model stocks and flows by adding an
increment to a stock. For example, the level of capital $K$ is defined as
a difference equation, where capital in year $t$ is shown as being
capital in year $t-1$ plus the investment that took place that year:

\begin{displaymath}
K_t=K_{t-1}+I_{t-1}
\end{displaymath}

The problem with this approach is that in reality, capital is
accumulating on a daily, or even hourly, basis. It is better to model
stock as continuous quantities and for this reason, all stocks and
flows in Minsky are handled instead as integral equations. The amount
of capital at time $t$ is shown as the integral of net investment
between time 0 and today:

\begin{displaymath}
K(t)=\int_0^t I(s)ds
\end{displaymath}

However, rather than being shown as an equation, the relationship is shown as a diagram:

\begin{center}
\includegraphics{images/NewItem7.eps}
\end{center}

The advantages of the block diagram representation of dynamic equations
over a list of equations are:
\begin{itemize}
\item They make the causal relationships in a complex model
obvious. It takes a specialized mind to be able to see the causal
relations in a large set of mathematical equations; the same
equations laid out as diagrams can be read by anyone who can read
a stock and flow diagram---and that's most of us;
\item The block diagram paradigm makes it possible to store components of
a complex block diagram in a group. For example, the fuel delivery
system in a car can be treated as one group, the engine as another,
the exhaust as yet another. This reduces visual complexity and also
makes it possible for different components of a complex model to be
designed by different groups and then ``wired together'' at a later
stage.
\end{itemize}

For example, here's a model of a 4 cylinder engine car---one of the
simple examples distributed with the program Vissim:

\begin{center}
\fwhtmladdimg{NewItem8.png}
\end{center}

Programs like Vissim and Simulink have been in existence for almost 2
decades, and they are now mature products that provide everything
their user-base of engineers want for modeling and analyzing complex
dynamic systems. \htmlref{So why has Minsky been
developed?}{intro:experienced}

\section{Experienced in system dynamics?}
\label{intro:experienced}

As an experienced system dynamics user (or if you've just read \htmlref{``New to
system dynamics?''}{intro:new}), what you need to know is what Minsky
provides that other system dynamics programs don't. That boils down to
one feature: The Godley Table. It enables a dynamic model of
financial flows to be derived from a table that is very similar to the
accountant's double-entry bookkeeping table.


The dynamics in financial flows could be modeled using the block diagram
paradigm. But it would also be very, very easy to make a mistake
modeling financial flows in such a system, for one simple reason:
every financial flow needs to be entered at least twice in a
system---once as a source, and once as a sink.


For example, if you go shopping and buy a new computer with your
credit card, you increase your debt to a bank and simultaneously
increase the deposit account of the retailer from whom you buy the
computer. The two system states in this model---your credit card
(``BuyerCredit'') and the retailer's deposit account
(``SellerDeposit'')---therefore have to have the same entry (let's call
this ``Card'') made into them. Such a transaction would look
like this:


\begin{center}
\includegraphics{images/NewItem11.eps}
\end{center}

That would work, but there's nothing in the program that warns you if
you make a mistake like, for example, wiring up the BuyerCredit entry,
but forgetting the SellerDeposit one:

\begin{center}
\includegraphics{images/NewItem12.eps}
\end{center}

Or, perhaps, wiring up both blocks, but giving one the wrong sign:

\begin{center}
\includegraphics{images/NewItem51.eps}
\end{center}

In a very complex model, you might make a mistake like one of the above, run the simulation and get nonsense results, and yet be unable to locate your mistake.


Minsky avoids this problem by using the paradigm that accountants
developed half a millennium ago to keep financial accounts accurately:
double-entry bookkeeping. Here is the same model in Minsky:

\begin{center}
\begin{tabular}{|c|cc|c|}
\hline
Flows $\downarrow$ / Stock Variables
$\rightarrow$&\multicolumn{1}{|c|}{$BuyerCredit$}&\multicolumn{1}{|c|}{$SellerDeposit$}&Row Sum\\\cline{2-3}&\multicolumn{1}{|c|}{asset}&\multicolumn{1}{|c|}{liability}&\\\hline
Initial Conditions&$0$&$0$&0\\
Buyer Accesses Credit&$Card$&$Card$&0\\
\hline
\end{tabular}
\end{center}

This is an inherently better way to generate a dynamic model of financial flows, for at least two reasons:
\begin{itemize}
\item All financial transactions are flows between entities. The
tabular layout captures this in a very natural way: each row shows
where a flow originates, and where it ends up
\item The program adopts the accounting practice of double-entry
bookkeeping, in which entries on each row balance to zero according
to the {\em accounting equation} (Assets=Liabilities+Equities). The source is
shown as a positive value increasing the value of assets, the sink
is a positive value increasing a corresponding liability. If you
don't ensure that each flow starts somewhere and ends
somewhere---say you make the same mistake as in the block diagram
examples above, then the program will identify your mistake.
\end{itemize}

If you forget to enter the recipient in this transaction, then the Row
Sum identifies your mistake by showing that the row sums to ``Card''
rather than zero:

\begin{center}
\begin{tabular}{|c|cc|c|}
\hline
Flows $\downarrow$ / Stock Variables
$\rightarrow$&\multicolumn{1}{|c|}{$BuyerCredit$}&\multicolumn{1}{|c|}{$SellerDeposit$}&Row Sum\\\cline{2-3}&\multicolumn{1}{|c|}{asset}&\multicolumn{1}{|c|}{liability}&\\\hline
Initial Conditions&$0$&$0$&0\\
Buyer Accesses Credit&$Card$&&$Card$\\
\hline
\end{tabular}
\end{center}

And it also identifies if you give the wrong sign to one entry:

\begin{center}
\begin{tabular}{|c|cc|c|}
\hline
Flows $\downarrow$ / Stock Variables
$\rightarrow$&\multicolumn{1}{|c|}{$BuyerCredit$}&\multicolumn{1}{|c|}{$SellerDeposit$}&Row Sum\\\cline{2-3}&\multicolumn{1}{|c|}{asset}&\multicolumn{1}{|c|}{liability}&\\\hline
Initial Conditions&$0$&$0$&0\\
Buyer Accesses Credit&$Card$&$-Card$&$2Card$\\
\hline
\end{tabular}
\end{center}

Minsky thus adds an element to the system dynamics toolkit which is
fundamental for modeling the monetary flows that are an intrinsic
aspect of a market economy. Future releases will dramatically extend
this capability.

0 comments on commit 8aa9df2

Please sign in to comment.