Recent Posts

Wednesday, March 29, 2017

The Tricky Question Of Matching Supply And Demand In SFC Models

One of the more challenging parts of developing my stock-flow consistent (SFC) models library was the question of how to match up supply and demand in a market. I generalised a technique used in Godley and Lavoie's Monetary Economics; I am still unsure whether there is a more general technique. [Update: I added some explanatory text.]

(This article is fairly tentative, and probably would not make into the book in this form. Suggestions from anyone familiar with the literature are welcome. I have not really tried digging into any research on this topic.)

Context for this Discussion

The reason why I wrote this article is that I need to develop the behaviour of my Python SFC model framework. Note that this is my framework, and does not capture the entire academic SFC literature. This framework generates the model equations with algorithms, based on the high-level structure of sectors that are set by the user. This framework could be placed within a graphical user interface: the user drags and drops sector objects into a model, and then the framework generates the equations that are implied by the high-level parameters.

It is not enough to give a set of equations that might have a solution from the perspective of mathematics; the equations have to be built to fit within the constraints of an equation solver.

The question here is how to match up supply and demand between competing sectors within the same market. Examples are given below.

Differences Between the Real World and SFC Models

There are two ways of creating coherent macro models.
  1. We could create a representative sample of transactions, and track the effects of the transactions on the model entities. (I believe this is how we would characterise agent-based modelling techniques.) Each transaction might occur at a different price.
  2. We aggregate transactions amongst sectors. We do not attempt to model the prices of individual transactions; we use the same price for all transactions in the model accounting period. (This is the conventional stock-flow consistent (SFC) modelling strategy.)
The first strategy would create models that match our intuition; real-world transactions do occur at different prices. The problem with the agent-based approach is that the overall complexity of the model is extremely high. A single agent would probably have more equations than a few sectors of a standard SFC model. We can run the economic simulations, but it is difficult to make authoritative statements about the model's aggregate behaviour: we can only comment on the simulations that we have run.

The problem with the aggregated approach is that behaviour can be not completely intuitive.

For one simple example, imagine that we calibrated two models against the same data, but one runs at a quarterly frequency, and the other monthly. The monthly model would generally not match the quarterly one, as it now has three price points that correspond to a single quarterly point, and so it has information that the quarterly model cannot replicate.

The rest of this article discusses a more complicated problem: matching supply and demand in markets. I needed to find a way to allocate supply or demand among multiple competing sectors in my Python SFC model framework.

The Case of Importers

If we are matching supply and demand between two sectors, matching them should be straightforward. The question then arises: what happens if there are multiple sectors?

In the rest of this article, I am discussing how to handle imports from a single country, but this matching problem is more general. Examples:

  • Three or more countries with imported goods. For example, in a model of the euro area, we could have the euro core, euro periphery, and the rest of the world. How do we determine market shares for three competing business sectors within this model?
  • What happens if we disaggregate the business sector into a labour-intensive versus capital-intensive subsectors? They would be competing for the same demand, but with different production profiles.
  • What happens if a labour market is running at capacity, and we have two business sub-sectors competing for labour? (For example, a consumer goods and a capital goods sector.) In the real world, wages rise, but not necessarily very quickly. Instead, one or more sectors would end up with staffing levels below the desired target.
The first models developed for the framework were straightforward: the business sector was always able to meet all the demanded goods from the consumer and government sectors. Therefore, there was no effective demand side competition, and there was only a single supplier.

The problems I describe here arose when it came time to build open economy models. In this case, we had two suppliers of goods:
  1. the domestic business sector; and
  2. imported goods from the foreign business sector.
(This competition was mirrored in the foreign goods market.)

How should demand be allocated between the competing business sectors? 

The instinctive reaction is to rely on price: consumers would but from the cheaper supplier.

However, this does not work, since we assume that all goods are traded at the same price within the accounting period. By assumption, there is no way of competing on price. (If we fixed the prices of the two sectors at different levels, why would demand not be 100% fulfilled by the cheaper supplier? We generally do not see massive high frequency switches in suppliers in real-world data, which is what would happen if demand sectors optimally allocated among suppliers with flexible prices.)

(Upon re-reading what I wrote, I realise that classical arguments about supply and demand curves would appear to solve this issue. Since the post-Keynesian SFC models reject some of the embedded assumptions that are required in this argument -- on the entirely reasonable argument that the assumptions are rejected by real-world data for real goods and services -- I ignored this angle of attack.* That said, supply and demand flexibility is a feature of financial markets, and one of the items to be implemented in the framework is the use of currency adjustments to balance the foreign exchange markets. I may try addressing the supply and demand argument for goods argument later, but this is not a high priority. Most engineers involved in turbine design do not spend time reflecting on what the phlogiston theory of combustion would have to say; similarly, I see little value-added in discussing arguments that are obviously wrong.)

The solution to this particular problem from the models within  Chapter 6 of Monetary Economics was to fix the propensity to import. This meant that imports were determined by multiplying domestic income by this parameter. The domestic business sector supplied the remaining demand.

(The general solution to the matching problem within the Python framework was that if there are N suppliers, the first N-1 have fixed allocation functions, and the last sector is the residual sector that supplies all remaining demand.)

Therefore, we have to assume that the goods in question were not perfect commodities in which the demand side only distinguishes suppliers by price. Instead, there is an allocation rule between the suppliers, and price does not matter. (Complicating matters is that the simple models that have been dealt with do not track prices, but they can be interpreted as the price level being fixed.)

In order to get competition based on price, it appears necessary for us to treat the two suppliers output as being distinct goods. In which case, the allocation function will occur in the consuming sectors' demand functions. 

Concluding Remarks

Supply and demand matching is an example where intuition about individual transactions does not match up with the assumptions about aggregation in SFC models.


* The doctrinaire supply and demand argument about allocations would rely on two key arguments: that prices are not administered, and that production functions have a negative return to scale. The first assumption is rejected by any empirical analysis of price setting, and the second flies in the face of the engineering and empirical economic literature. The point about economies of scale is not obvious, so I will try to quickly explain my logic. The implication is that firms would be happy to supply goods at a lower price if they could guarantee a larger volume of sales. Since sales volumes cannot be guaranteed, setting prices becomes a very complex game, and depends on judgement calls about the state of the market.

(c) Brian Romanchuk 2017


  1. I'm not really sure what you're saying here, Brian.

    I think the general approach in post-Keynesian SFC models is to assume that the propensity to import (m) is of the form m = a + b.p, where p is the relative price, with m and p in logs. This deals with the demand side.

    On the supply side, the approach is to vary the mark-up to reflect competing prices. So, for example, the price of import goods (pm)might be expressed as pm = a + b.wulc + (1-b).pd, where wulc is unit labour costs for the countries where the imports are sourced and pd is prices of domestically produced goods, again all in logs.

    This is the approach used in G&L ch12. This form of relationship seems plausible and is easy to estimate. Care must be taken however when models are producing results far outside of the tested range.

    1. You're way ahead of my code. I'm referring to Chapter 6, where the prices don't exist yet.

      I realise that this article was somewhat unclear. The problem: the user has a lot of flexibility in model design, and my code has to handle all cases. For example, imagine a three country model, in which you have three business sectors supplying the same consumer sector. How is demand allocated then?

  2. "For example, imagine a three country model, in which you have three business sectors supplying the same consumer sector. How is demand allocated then?"

    Isn't this a micro question and not a macro question?

    1. Yes, I assume as much. Although I might be able to guess the mainstream micro solution, less clear how the SFC modelling literature does it.


Note: Posts are manually moderated, with a varying delay. Some disappear.

The comment section here is largely dead. My Substack or Twitter are better places to have a conversation.

Given that this is largely a backup way to reach me, I am going to reject posts that annoy me. Please post lengthy essays elsewhere.