Thursday, May 9, 2013

Why Mathematica for economics?

Readers would have noticed that some of my previous posts containing interactive graphs that require Mathematica CDF Player to view. Which might leave you wondering why I choose to use Mathematica as my computational tool for ‘doing economics’.

So I thought I might outline here why I do. 


And the answer is, mostly, because it was easy to learn

1. The documentation in Mathematica is very comprehensive and delivered in a notebook format (Mathematica’s ‘front end’ interface), so you can modify the examples and test what your modification does to the output. 

Many useful functions are built in, and even better, functions are typically named by their real mathematical name. 

For me, I need a tool that can handle analysis of graphs and networks, can do symbolic manipulation, produce charts, handle diverse file types, analyse textual data (for matching names and other strings in large data sets). I have scraped data from websites using Mathematica, analysed social networks, and more.

Now, Mathematica is surely not the only tool for these jobs. Many like the open source R, others like Matlab, and for basic regressions Stata is a common tool. I don’t want to start a debate about which tool is better for which job - ultimately it is a user choice about investing their time to learn one or the other, and about the ongoing usability. 

2. I like the integration of different functionality. There are real and electronic books written completely in Mathematica. It has built-in slide show options to have live and interactive calculations and charts in presentations. Easy interactive tools and web deployment (but viewers do need the free CDF player). 

3. One thing that Mathematica users seem to emphasise is functional programming. Rather than writing loops to build up calculations, you simply write the function and it can automatically map across lists and various other data structures. Once you get used to this, you won’t want to write out loops again. This also means it is easy to get quite complex calculations coded up quickly. 

4. A very helpful user group, especially at StackExchange

Lastly the RBA produces their charts and does a lot of analysis with Mathematica (although using custom packages). Some useful Mathematica tips from the RBA’s Luci Ellis are here, and here is a useful blog on how the dynamic graphing capabilities make good teaching tools. 

Sunday, May 5, 2013

Life of an economics student?

Having studied the fundamental post-graduate economic courses last year I feel I can comment on this quite scary YouTube clip. Basically, the public perception of what economists do and the tools they use to understand the economic is completely out of whack with what most really do.

Yes, there are research frontiers in many areas that factor in the political and social realities we read about, but should it not be the case that all economists are equipped to understand these realities?

Teaching of economics really needs to get out of the 1980s and embrace all the knowledge the field has attained in the past couple of decades into their core curriculum.

Enjoy.

Friday, May 3, 2013

More housing market signals

My recent post about timing the Australian property cycle concluded that, all things considered, the period over the next 2-3 years will probably the best time to buy since the late 1990s.

My message, if it wasn’t clear, is that if you have been holding off purchasing a home because of the risk of capital losses, then these risks are probably lower now than at any time in the past decade.  Maybe prices will be a couple of percent lower at the end of next year, but I have a hard time wrapping my mind around downward price movement more severe than a couple more years of the slow melt, or around 3% in nominal terms.  The chances of price gains is also now much higher.

described in the past how each Australian city has its own cycle, and that aggregate data is may need to be assessed against local indicators. Sydney will probably be the first to start the next price cycle.

Now don't take this as a thumbs up from me for housing price growth.  High asset prices are not a particularly desirable feature of an economy.  However my strongly held view is that asset prices should not form part of the debate over housing affordability.  It is like having a debate over the affordability if steel by looking at the price of BHP shares.  No, the asset price will be subject to the whims of financial markets, and the affordability of steel can only be observed by looking at the price of steel.  In housing markets, land prices are asset price, and rental prices are the actual market price for housing.

Whether we also desire for social reasons broad access to the housing asset market, then we may consider severe changes to policy in this arena.

Further, I am merely observing the features of previous cycles.  This is a slightly better approach than just extrapolating recent trends, but there is no particularly strong theoretical reason why the next cycle should be identical to the last.  Though I do expect common features.

So what sort of indicators are crucial in observing the bottom of the cycle?

Dwelling turnover
What we are looking for in this indicator is a slight uptick. We have bobbed along the bottom for three years now.  Can this go on, or are we due for a correction?  Will those reluctant landlords cash in once prices have stabilised?  Once turnover starts to noticeably increase, perhaps break through 5% toward 6%, I will have more confidence that it is a relatively advantageous time to buy.




Turning point of mortgage payments to income ratio 
We should see bottoming out of mortgage payments to household incomes at the bottom of the cycle.  With further interest rate cuts expected this year, this indicator should fall quickly below 8% in the next two years. 



Turning point in housing credit
Housing credit growth has been on the decline since the end of the national boom in 2003. However the short periods of increasing rates of growth also produced price gains.  It’s now been ten years since the peak, and a modest turn around looks imminent, especially considering the pattern of the second derivative of housing credit which is surging towards positive territory.



Falling rents
It may seem like an odd indicator, but falling rents (in terms of rent to income ratios) is a signature of increasing prices.  The last 5 years have seen rents tighten in relation to income.  This might be over for now and if we see this indicator start to fall I will have even more confidence about where we are in the cycle.



Of course, I noted earlier that the next housing price cycle will be far less severe than the last.  This is not a prediction of a huge nominal gains, but of relative returns from entering housing in 2014-2015 compared to the last 6 years.  For those interested in getting into the market it is time to start paying close attention to the market in your area.

Friday, April 26, 2013

Watts' model of cascading network failure

I have written in the past about how social and economic networks are a necessary ingredient for a proper understanding of economic patterns. The rise of social network platforms like Facebook and Twitter has allowed a thorough analysis of empirical regularities seen in networks in the social domain. Stephen Wolfram has a great blog about the regularities observed in Facebook data scraped using WolframAlpha.

One of the more interesting networks models is Duncan Watts' model of cascading network failure. Simply, each node in the network has a specific tolerance to failure, and it the share of adjoining nodes that have failed exceeds this tolerance, that node will also fail. For example, a node could have a tolerance of 0.5, so if more than half of its neighbours have failed, it will also fail, leading to a cascade of failures of its other neighbours.

This simple model is quite versatile. It suggests underlying mechanisms behind how fashion fads arise, or why investors tend to go with the herd, or why some industries produce superstars even though no one can objectively tell the difference in the quality of their skills

The methodological individualism so fondly embraced by the economics crowd has at its core the concept of utility, but stops short of answering the far more important question – where does our utility function come from if not our environment and our interactions with others? A model of networks can help explain the source of utility and begin to give a picture of how unique cultures and customs arise. 

In any case, I have generated an animated version of the model that simulates over a random network, with 5 random nodes ‘shocked’ to initiate the model. The histogram shows how many of the 20 different shocks have led to cascades of failure of a particular number of nodes. 

Enjoy. Follow me on Twitter. And please share.


Thursday, April 25, 2013

Timing the residential property cycle

One interpretation of recent data is that investors seem happy to jump back into Australian residential property markets. Perhaps due to a search for yield. Perhaps from foreign cash seeking a safe harbour. Or perhaps it’s simply time for the Aussie love affair to be rekindled. Holes are over. It’s houses turn.

With these winds of change in the air maybe it is time to take a step back and look at the long term property cycle itself.

Property industry types talk about the cycle like a mythical being - unless you have witnessed it yourself you won’t know how aggressive the beast can be to your leveraged finances.

Long term regularity of asset price cycles is an intriguing proposition. Is the 18 year cycle really a good rule of thumb? If so, why don’t investors expect the cycle, and remove it through their anticipatory actions?

A simple answer might be that investors would anticipate the cycle if credit markets would allow it. But the banks supplying credit are themselves constrained by previous movements of the market. Thus the interaction of prices and the willingness to supply credit seems to be pretty decent explanation of the peculiar regularity of long term cycles. Thanks Minksy.

One way to think about the nature of the cycle is in terms of returns from yield compared to capital growth. At the bottom of the cycle equities, including property, are seen as risky places to preserve capital. During the boom expectations of capital growth return, and equities become the assets to hold.

If this truly reflects some fundamental emergent dynamic in the economy, a simple rule of thumb is to buy the high yields at the bottom of the cycle, and sell capital gains at the top.

But how do we know when yields are high? We need a relative measure rather than an absolute measure.

In the past I have used the mortgage rate divided by gross yield as a measure of the relative value of residential property. The theoretical picture is the the mortgage rate is a good proxy for the yields, net of capital growth, available in the economic generally. Gains above this rate typically arise from capital gains.

When the gross yield is close to the mortgage rate, theory says that the price is reflecting an expectation of low capital gains. But that would be wrong, given that it is the same theory predicts and equilibrium asset price.

In reality this would be a good time to buy.

The theoretical explanation is that these low growth expectations arise from recent experience of low growth - the same feedback that feeds the cycle upswing when high prices feed into expectation. If markets are myopic, you can forget about finding anything useful about expectations in the prices themselves.

So where’s my evidence for this? The graph below is an update from a previous post. With recent rental growth, price falls, and falling interest rates, this simple measure is showing that now is a good time to buy.

I have also created a second measure - the mortgage payment per dollar of a 30 year loan divided by the yield. The second measure adjusts for the fact that the cost of buying asset, in addition to the cost of interest, is a higher portion of the total cost at lower interest rates.


What is more surprising is the regularity of a head and shoulders-type pattern - similar tops and bottoms, and a similar period to the cycle, in this case 15 years. Not too far from the 18 year rule of thumb. And not too far off the stylised asset price cycle seen so regularly when discussing the latest housing boom

Given this regularity, and the strong buy signal, my internal model of the market suggests two possible future paths.

1. Renewed cycle

A great time to buy in most capital cities was around 1998. This year preceded a boom in Sydney, that cascaded across the country for the next 8 years. My chart shows the cycle at around 15 years, meaning this year is a good time to buy. The 18 year rule of thumb is then 2016 - just three years time.

Given the expected resources shock in the second half of this year and early next, I would not be in a rush. Also it may be wise to get better signals about the direction of international markets, particularly the US before leveraging into Australian housing.

I expect to be on the lookout for well located land in about two years time unless I get strong signals that the second path is playing out.

2. Stagnation

Given the weight of private debt, the already low interest rates across most of the developed economies, and a general reluctance for increased public spending to maintain employment and stimulate private investment, could we be heading to a long credit-constrained stagnation that requires major price adjustments in wages, rents, and currencies.

I have no good reason to believe one way or another. Political outcomes in Europe, China and Japan will be critical, as will our domestic adjustment following the mining investment peak.

My gut says that the fundamentals of continued current account deficits, which reflect inflow of foreign asset demand, and scope for much lower mortgage rates will probably allow for another cycle to ramp up by 2017.

I don’t expect it to be as severe as the last cycle for a few reasons.

  • Inflation will be low unless the AUD falls significantly. Thus real gains could be high without such dramatic nominal gains.
  • Mortgage rates still have scope to fall to around 4% in the next two years.
  • But I expect the memory of the financial crisis and a stricter regulatory environment will mean tighter bank lending
  • The demographic shift of baby boomers seeking to get out of negatively geared residential property will dampen capital gains

If most investors are myopic, those who consider the long term will have an advantage in any market. And what we have seen here is that we seem to be in a relatively attractive period for buying residential property assets. Just remember to consider all the other macro and political factors in your own assessment of the market.

Tuesday, April 23, 2013

Australian age-dependency ratios

Everywhere you turn it seems that higher rates of population growth are seen as a 'solution' to an ageing population.  Here's one recent example.  My general views on this matter are found here.

At the very least there should be a publicly accessible model of population growth to verify the claims being made in this debate.  The productivity commission has modelled population growth for this purpose, although the intricacies of the model are not at all clear or public.

My first step towards this is to actually look at the historical demographic record in Australia.  As you can see from the interactive chart below, the country's age dependency ratio has been steadily increasing since at least the 1970s.

Offsetting this age dependency has been a quite dramatic decline in youth dependency as fertility rates fall. The total dependency, or number of children and retirement age people per working age person is at record lows.

The next step is the add some features to this model to allow a choice of assumptions about immigration rates (and ages) as well as birth and death rates, to see exactly what how immigration policy is affecting demographics and whether there are some circumstances in which the 'immigration solves ageing' slogan may hold.

Enjoy.

Thursday, March 21, 2013

Are there supply curves in a theory of return-seeking firms

In the theory of return-seeking firms there is no supply curve as such.  There are simply reactions by firms given their expectations about 1) the persistence of a demand shock, 2) their competitiveness.

Under normal conditions where demand increases in line with expectations, mark-up pricing that is set at a level to discourage competitor entry, can continue to be used.  However, there are many pricing options available to a firm to win market share (a discussion for a later post). 

The below model shows the case of three firms in a market.  The rate of return earned at the starting position is proportional to the market power/competitiveness of the industry.  The theory has nothing to say about whether three firms will result in reduced competition.  Competition, or lack thereof, is an artifact of local monopolies, regulatory frameworks, capital barriers and so forth. In a market with free entry and local competition, three firms can easily be very competitive. 

A shift in the demand curve in this model need not have any special impacts on prices under any period of analysis.  There are no assumptions about the slope of a supply curve.  What exists is an ability to interpret price changes as evidence of market/monopoly power.  For example, if demand for oil tankers increased over a short period, ship builders would have years to increase their mark-ups and returns before a competitor could become established.  However, they may choose not to take all the possible increase in returns to decrease the attractiveness for a new competitor, or to win market share from an existing competitor - no use making high return now, but being forced to accept very low returns in the future when new firms enter the market.  

The price setting during a short term demand shock is not at all the result of costs faced by firms, but of market power. 

To recap, an unexpected sudden shift in demand can provide temporary monopoly power for firms currently in the market (since the shift is beyond the planned capital investments in the market). In markets where new capital takes many years of investment, or there are regulatory barriers to investment, higher prices would be expected.  However in markets where production is highly competitive between established firms vying for market share,  sudden shifts in market demand may lead to falling prices. 

The below interactive graph the demand shock slider shifts the demand curve.  The market power slider sets the starting market power and shows that higher mark-ups / returns will be acheived with greater market power. The checkbox allows market power to be related to demand shocks to demonstrate the case that even in apparently competitive markets unexpected demand shocks might themselves create temporary market power. 


Saturday, March 16, 2013

How economists think of themselves


Tyler Cowen has an article in the New York Times about the egalitarian tradition of economics.  It appears to be a genuine effort to promote economic analysis and rationale as THE tool for social analysis, since it is the only value-free objective way to look at society.  My experience in the profession has given me strong reasons not to be easily convinced.  The very fact that most economists I know have linked to the article with ringing endorsements sheds some light on how economists perceive their role.  

In fact economics has a very distinct moral alignment, and even the basic notion of utility merely reflects an individual’s interpretation of contemporary morals. 

Cowen builds this backdrop of value-free objectivity as a foundation for his pro-immigration arguments. 

Let’s take it one point at a time.  
Economic analysis is itself value-free, but in practice it encourages a cosmopolitan interest in natural equality
What is “natural equality”? No seriously.  What is it?
Many economic models, of course, assume that all individuals are motivated by rational self-interest or some variant thereof; even the so-called behavioral theories tweak only the fringes of a basically common, rational understanding of people. The crucial implication is this: If you treat all individuals as fundamentally the same in your theoretical constructs, it would be odd to insist that the law should suddenly start treating them differently.
Behavioural theories that economists themselves accept could be considered minor tweaks - by definition the discipline won’t accept a rewrite of their fundamental belief structure. A genuinely objective, or value-free, observer of the behavioural tradition would reject the notion of rational self-interest, especially rationality as defined by consumer theory. 

Further, treating all individuals the same in theory is not what economists have set out to do, but what they are required to do to gain mathematical tractability of their core model.  It is equivalent to assuming a single person is the average of all.  Economic models can and do treat different people and groups differently.  For example the overlapping generations model.
 And the classical economists Jeremy Bentham and John Stuart Mill promoted equal legal and institutional rights for women long before such views were fashionable. Their utilitarian moral theories placed individuals on a par in the social calculus by asking about the greatest good for the greatest number.
Bentham and Mill didn’t support personal liberty in every instance — Mill was a proud imperialist when it came to India, and Bentham’s idea for a Panopticon prison was a model of state-sponsored surveillance. But they prepared the way for dissecting the prevailing defenses of hierarchy and injustice.
So basically if you look hard you can find instances where economists historically appeared to be value-free or egalitarian, but if you look even harder you realise that this is chance, and you are equally likely to find the opposite. 
Gary Becker, the Nobel laureate who is one of the founders of this approach, used the economic method to lay bare the selfish motives behind racial and ethnic discrimination. 
In my view Thomas Schelling was perhaps more influential in this area, but of course doesn’t identify as an economist, so his ideas can be dismissed.  Also, Becker’s model “often includes a variable of taste for discrimination in explaining behavior”.  So if people have a taste for it, they derive utility, the economic answer is that discrimination is good.

At this point Cowen turns to immigration an makes the point that we should include the benefits to immigrants in the cost-benefit analysis of immigration, rather than just the current citizens. 
The obvious but too-often-underemphasized reality is that immigration is a significant gain for most people who move to a new country.
In fact the key point of the whole article is in the following two paragraphs
In any case, there is an overriding moral issue. Imagine that it is your professional duty to report a cost-benefit analysis of liberalizing immigration policy. You wouldn’t dream of producing a study that counted “men only” or “whites only,” at least not without specific, clearly stated reasons for dividing the data.
So why report cost-benefit results only for United States citizens or residents, as is sometimes done in analyses of both international trade and migration? The nation-state is a good practical institution, but it does not provide the final moral delineation of which people count and which do not. So commentators on trade and immigration should stress the cosmopolitan perspective, knowing that the practical imperatives of the nation-state will not be underrepresented in the ensuing debate.

I can tell you a good answer of why to report costs and benefits only for the US when considering new laws, particularly with respect to trade and immigration.  Imagine you have the without immigration case.  You don’t draw the line at national borders so you need to include potential immigrants staying in their home country to understand the current situation.  But you don’t know who they are. So you have to take the whole origin country, and since you don’t know which countries they will all come from, you have to take all countries.  If you can’t draw the line as Cowen argues, you have to conduct a global analysis of every decision. 

If, as Cowen suggests, there are massive benefits from immigration at destination countries, then there may very well be massive costs to emigration from origin countries. Yet Cowen expressly ignores these in his supposedly value-free analysis, even though they may very well be higher in welfare terms because of wealth disparities - small benefits are valued more highly the lower your wealth.  

So much for value-free analysis then.  How about we actually consider these important issues like immigration from a moral standpoint instead - at least then we are debating our shared group values rather than using economic analysis to disguise one particular moral judgement. 

Monday, September 24, 2012

Network map of Australian lobbyists

The image below is a network image of Australian lobbyists and their clients.  Click for full size image.


Tuesday, August 28, 2012

An interactive growth model

Earlier this year I wrote a Mathematica model to demonstrate some of the fallacies of neo-classical models of economic growth.  For some reason the fact that the basic models did not result in growth when time equals infinity, was cause for alarm.  New models that grew for infinite time must be found.

I argued that perhaps we don't yet have the evidence to dismiss models that show diminishing growth over time.  At least it doesn't feel like I am at the end of time yet.

So I wanted to have a closer look at what sort of rates of growth we could expect, and for how long they persist, with reasonable parameters for models with diminishing returns.

This post is simply to test whether I can embed the interactive results of one of my early models into a blog (and after 9 attempts, the answer is yes).

The basic gist of the model is that it growth is dependent on capital, but with diminishing returns (alpha is less than 1).  Economies with higher investment ratios will have higher growth in the long run, but less consumption in the short run.

The market/institution multiplier is just a way of adjusting the resulting output from a given level of capital.  It is designed to represent the governance and institutions that allow more efficient use of capital.

And the technology parameter is meant to represent new methods of production.

For now, I am just glad I finally have it working on the blog.