Friday, January 13, 2017

What can a pencil teach us about economic theory?


How is a pencil created? This question was posited by Leonard Read in his popular story, “I, Pencil”. A pencil is a relatively simple product – relatively meaning, in comparison to other products. Still, it would be impossible for any one person to oversee the entire process of producing a pencil. Where does the wood for the pencil come from? How is it processed? How do the lumberjacks acquire sustenance? Where does the graphite lead come from? How is it processed? Who makes the lacquer? Where does the rubber for the eraser come from? Who brings all of these elements together? "I, Pencil" is a foray into the world of economic complexity.

   

Richard Wagner describes the economy as including an ecology of plans (2010). Bryan Arthur describes the complexity paradigm as an accounting of continual emergence in an economy as plans of agents are constantly upset and readjusted (2013). Not every plan that exists can be executed. Some plan to use scarce resources must be chosen over other plans. Economic theory identifies certain regularities that arise as plans of actors compete for resources.

Economics is the study of human action. Action entails the execution of a plan or plans. Categorically, a human agent acts to improve one’s state of well-being, however the agent defines this. We may say, more generally, that action is aimed at improving the state of the world that the acting agent will inherit in the future. While all action occurs at the level of the individual, interaction between agents requires coordination. This requires that agents come to share and interact with knowledge that impinges upon their decisions. As F. A. Hayek noted, “the empirical element in economic theory . . . consists of propositions about the acquisition of knowledge (33, 1937).”  

Under a system of private property, much of the work of knowledge transmission is performed by market prices. Prices help coordinate economic activity. Having a finite budget, each agent must choose what he will and will not consume. He must choose which inputs to use. He must plan accordingly so that his flow of income at least offsets expenditures. Agents all follow some form of this rule, and must change their approach if the rule is violated. Otherwise, they will go bankrupt. 

For a price to exist, there must be an exchange executed between two parties. We know that this price will lie somewhere above the willingness to accept of the seller and below the willingness to pay of the bidder. As long as the price lies somewhere between these two points, markets will approximate the efficient outcome predicted by neoclassical economic theory (Gode and Sunder 1993; Axtell 2005) and we will observe coordination at the system level (Caton 2016). The price I pay in an exchange is simply that which is given up in order to gain the good I desire. If I am willing to pay a price that is greater than the price willing to be paid by any competing bidder, I can assure control of the desired good. Consider a house that is for sale. If I and another person both desire the house, we will both have to guess at the bid price that will secure the house. One of us will earn claim to this physical capital with a higher bid, the other will not.

The party who owns a resource is the one who is able to choose how the resource will be used and toward what end. Thus, in constructing a theoretical system of exchange, we must include a theory of property rights. The parameters of such rights depend upon the community in which a person operates and are set by beliefs of actors in the community and the incentives that reinforce certain patterns action. Ownership starts with the body. If you do not own yourself, how can you own anything at all? A person can choose the manner in which he invests his labor. Likewise, a person’s use of resources represents an extension of the will. You can only make plans using resources that you own or that the other owners are willing to share through contract or an implied reciprocal relationship. We will mostly concentrate on the use of resources that depend upon contract, though reciprocal relationships are of special importance to a theory of entrepreneurship and can be analyzed through the lens of economic theory.

Who gets to plan is simply a result of one’s budget constraint, whose growth or lack thereof is a function of one’s ability to perceive the needs of other actors and act in a manner that coheres with the future. Not every plan that is executed will succeed in achieving the end that the plan is believed to promote. I may buy a home with expectation that its price will rise and allow me to resell it for a monetary profit 5%. However, if upon resale, I only received 95% of the value that I paid for the home, I have in fact suffered a loss (negative profit). Prices represent the value of a good and allow an economic agent to perceive whether or not her action is profitable. Prices allow for accounting and, thus, for agents to make more efficient use of their resources.

In the world that we observe, the economy is comprised of relationships that are profitable for each party involved. Employees of each firm in this process offer their service at a price amenable to both themselves and their employer. These inputs are combined within a firm to offer wood to companies that process that wood for a profit. Those companies will offer the refined wood to the pencil manufacturers in Leonard Reed’s story of the pencil. If the relationship between firms ceases to be profitable, the firms will either have to reorient their internal structure, their relationship with one another, or, failing a profitable orientation, cease to have a relationship.

We can imagine firms as forming a network that is the structure of production. Each node in the network is a firm employs a particular bundle of resources that is positively valued. In order to be maintained, the structure of production must contain firms whose revenues exceed their expenditures.In the long run, the structure of production will tend to lose any nodes/firms that are not at least earning the average (market) rate of return. In that case, the capital dedicated to this process can be more profitably invested elsewhere. This reinvestment is facilitated by financial markets where the interest rate tends to match the market rate of return.

A simple rule organizes production without a single overseer. Total revenue must equal or exceed total costs (TR => TC). Firms do not have the privilege of attempting to guarantee that marginal revenues equal or exceed marginal costs (MR => MC) for each process of production except over a discrete period where they reevaluate their actions at the end of that period. A firm must choose a strategy for production and reevaluate at some later date. At the end of each period, a firm can continue employing its previous strategy, revise its plans, or exit the pool of competing firms. Likewise, a laborer will compare the costs incurred for work with the revenue currently earned from her labor. If she can earn a greater wage elsewhere, she has incentive to alter the employment of her labor.

This structure of economic action, both at the individual and system levels, contain knowledge that promotes the ends of consumers - this class includes, ultimately, those actors who act and produce profitably. This structure, based upon a system of property rights, simplifies reality sufficiently enough for agents to form expectations among one another. They provide a medium through which production and exchange can occur. With common expectations regarding interactions sufficiently realized, profit and loss guide agents in the system. Those who have foresight will quickly adjust to changing agent preferences, technologies, and flows of revenue and capital in order to increase the likelihood of earning a profit. Those who don't will likely incur economic losses.

The production of the pencil follows this general process. The firm that processes the timber, like the firm that creates rubber erasers or that produces yellow paint, will continue to produce as long as revenues remain sufficiently high. As long as entrepreneurs find a way to profit from each step of production, they will, in piecemeal fashion, successfully coordinate the resources and labor necessary to produce the final good. In a single, brief exposition, Leonard Reed’s story of the pencil has shown the mysteries that can be uncovered by economic theory.


Key Terms:

Profit – The difference between the value of the object or state acquired and the value of the object or state given up in an exchange. At its foundation, this is a feeling of gain or of loss. Monetary prices allow us to calculate an objective measure of profit.                                          

Efficiency – A criterion of action representing the lowest cost means of achieving a particular outcome

Exchange – The trading of resources between agents where the value of the object gained by each agent is valued more highly than the object that is given up.

Labor – Action offered by an economic agent either for a contracted income. The value of labor tends toward the value added to goods produced by that labor.

Capital – Goods owned by agents that can be used toward production. Markets tend to value capital according to the sum of discounted expected income that it will earn in the course of its life.

Technology - The structure of organization of elements, both physical and social. Technology is contained in capital For example, a physical hammer is capital that embodies technology that we may think of, in abstract, as a hammer. Likewise, a the structure of production itself includes social and physical capital, both of which embody technology.

Structure of Production - The network of activity comprised by firms and their capital. These existence of firms and relationships between one another depend upon exchange that promotes the profit of each party involved.

Adapted from "'I, Pencil', Complexity, and Economic Coordination"

Saturday, December 3, 2016

Objects with Functions in Python

I've learned the hard way that using classes makes programming much easier to work with. I had developed a habit of not creating classes when I make a function. While this can be useful for a simple program, I ran into difficulties when I would attempt to import functions from other py files. Building classes makes this process much easier.

A typical example of a class from an introductory book does not make clear the uses of classes and objects instantiated from them. Consider this Cat class that I have made:

# cat class

class Cat():
    def __init__(self, name, color):
        self.name = name
        self.color = color
    def helloKitty(self):
        print("My name is " + self.name + ". I am a " + self.color + " cat.")
    
    def petCat(self):
        print(self.name + " purred. This cat likes when you pet it.")

cat = Cat(name = "Milo", color = "orange")

cat.helloKitty()
cat.petCat()

Running this will return:

runfile('C:/Users/James/Google Drive/Python Scripts/Lessons/CatObject.py', wdir='C:/Users/James/Google Drive/Python Scripts/Lessons')
My name is Milo. I am an orange cat.
Milo purred. This cat likes when you pet it.

What do we get from this? Well, the basic pieces are present. We have a class, which includes all indented text beneath the text, "class Cat():". We have two objects that we pass when we call the function, defined in "def __init__(self, name, color):" These will be used when we call the functions "helloKitty()" and "petCat()". To call these functions, it is best if we first instantiate a Cat object. I have called this object, "cat". I call the functions owned  by "cat" by adding a "." and the function name. Thus, cat.helloKitty() and cat.petCat() call the two lines you see above.

Classes like Cat are boring. It doesn't help me to internalize the significance of objects and functions. I have made a class, MathOperations, for this purpose. MathOperations will let you sum, multiply, raise a base to an exponent and multiply a base by 10 to the specified exponent:


# Math Functions

class MathOperations():
    def __init__(self):
        self.num = 0
        
    def add(self, a, b):
        self.num = a + b 
        return self.num
    
    def multiply(self, a, b):
        self.num = a * b
        return self.num

    def power(self, a, b):
        self.num = a ** b
        return self.num
    
    def exp(self, a, b):
        self.num = a * 10 ** b
        return self.num

math = MathOperations()

m = 8
n = 4

add = math.add(m, n)
multiply = math.multiply(m, n)
power = math.power(m, n)
exp = math.exp(m, n)

names = ['add', 'multiply', 'power', 'exp']
array = [add, multiply, power, exp]

for i in range(len(array)):
    print(names[i], str(m), str(n), '\n', str(array[i]))

At the bottom of this file, I create a MathOperations() object and use its function with numbers 8 and 4 (in that order). I want to show what values these numbers yield in conjunction with the functions and organize the results. Final results return:

runfile('C:/Users/James/Google Drive/Python Scripts/Lessons/MathFunctionLesson.py', wdir='C:/Users/James/Google Drive/Python Scripts/Lessons')
add 8 4 
 12
multiply 8 4 
 32
power 8 4 
 4096
exp 8 4 
 80000

Alternately, I can achieve the same output by importing MathOperations from a different file:


from MathFunctionLesson import *


math = MathOperations()

m = 8
n = 4

add = math.add(m, n)
multiply = math.multiply(m, n)
power = math.power(m, n)
exp = math.exp(m, n)

names = ['add', 'multiply', 'power', 'exp']
array = [add, multiply, power, exp]

for i in range(len(array)):
    print(names[i], str(m), str(n), '\n', str(array[i]))


This barely scratches the surface of the topic, but it is more interesting and memorable than Cat.

Friday, November 18, 2016

HeatSpace for NetLogo

I have put up a beta version of heatspace. This program generates visualizations for Netlogo's BehaviorSpace. Find the program and manual here:
NetLogo is an agent-based modeling platform whose ease of use and functionality are hard to beat. The goal of this manual is to succinctly show how to generate visualizations that present significant portions of a model's parameter space. Those who are not accustomed to agent-based modeling may expect visualizations to come in the form of line plots. Line plots are an easy way to convey a limited amount of information to a user, but it is difficult to convey more than a few lines without confusing the observer. Instead of representing the value of an output spatially, heatmaps represent value using color.

When we visualize the parameter space, it is not enough to represent this space only using a single run for each combination of parameters. Each combination must be mapped using a substantial number of runs. Usually 20 runs may produce a large enough sample to faithfully represent the parameter space. More is better. If generating data from model of interest is not a high cost endeavor, use more runs.

HeatSpace averages the values generated at each time period during a run. These values can then mapped onto two axes whose values are fixed throughout a run . A single map can be generated for each time period of a run, creating series of frames analogous to a movie. Alternately, the x-axis of a heatmap can represent time so that the change in the value of an output in light of a change in either the x or y parameter value at period t can be represented.


Tuesday, November 15, 2016

JamesLCaton.com

Check out my personal website:
I am a graduate lecturer and candidate for a Ph.D. in economics at George Mason University. I have been recipient of the F. A. Hayek Fellowship from Mercatus, the I.H.S. Humane Studies Fellowship, and their Summer Research Fellowship. I hold an M.A. in Economics from San Jose State University where I was a participant in the Student Faculty Partnership and received the Award for Excellence in Economics. I have co-edited Macroeconomics, a 2 volume set which is a collection of essays and primary sources that represent the core of macroeconomic thought. I have also published articles in the Review of Austrian Economics and Advances in Austrian Economics and published book reviews for EH.net, The Journal of Markets and Morality and History: Review of New Books.

Wednesday, November 2, 2016

Ex Ante, Ex Post: Making Sense of Rational Expectations and the Efficient Market Hypothesis

The move from a predominantly Keynesian paradigm in macroeconomics to the success of monetarist and the new classical macroeconomics that followed represents a shift from a general skepticism of markets within economics to a belief in market efficiency. The most extreme version of this is represented by real business cycle theorists who model the macroeconomy without using an upward sloping short-run aggregate supply curve. (This is actually how I prefer to teach disequilibrium effects associated with changes in aggregate demand.) The emphasis of these models is equilibrium which is, on average, reached in the economic system these models are built on. The results obtained from these models have been successful. In the long-run, the quantity theory holds true. In the long-run, the economy tends to grow at a steady rate, affected mostly by impediments to production and exchange driven by policy. What could be wrong about a field that has generated a tremendous amount of explanatory power?

John Maynard Keynes objected to long-run analysis of the classical economists, meaning most economists who preceded him. This included many of his contemporaries. He claimed that the agents of economic theory were assumed to have higher quality knowledge and decision-making abilities than they actually had. In a sense, Keynes was correct, but he overstated his case. "In the long-run, we're all dead" is a catchy slogan. It is also an abuse of economic ontology. The efficacy of the assumption of rational expectations and of the efficient market hypothesis depend on this distinction between long-run and short-run. Given time for adjustment and a lack of external perturbations, we expect markets will reach equilibrium prices and outputs for different goods. In the long-run, markets select for agents whose knowledge, as reflected by their action, is superior in light of the outcomes these actions generate. In the long-run, agent action is tightly constrained by one's budget constraint. In the short-run, an agent can act with little regard for one's budget constraint. This may be unwise, especially if taken to the extreme case, but eventually, bills must be paid or else that agent loses his power. Second, we must consider the rate of feedback that economic agents receive concerning their investments. Information cascades dominate human decision-making (Bikchandani, Hirshleifer, and Welch, 1998; Earl, Peng, and Potts, 2007). That is, agents learn from one another, copying those who appear to be successful and what appears to be common wisdom. The intelligence of one or a few are shared among many. Think about responses of investors, lay and professional, to perceived opportunities in the last two booms that dominated U.S. financial markets. Common perception went something like:

"The housing market is looking good and remember that the average price of real estate almost never falls!" 
"Have you heard about investments in tech? Better profit from the rise of the internet while we still can!"

Why didn't investors see these "bubbles" coming if markets are truly rational?

Markets are rational, but we sometimes forget to ask what it is that makes them rational. Failure makes them rational. Rational expectations and the efficient market hypothesis reflect the equilibrium arrived at by the market process. If there are above market rates of profit to be gained by pursuing one investment over another, those who invest in those markets will grow their total wealth and, in the process, push the rate of profit for that investment back down toward the market average. Those who miss out on these opportunities will grow at a lower rate relative to those who gained from them. Likewise, those whose investments return a below average rate of profit will be encouraged to pursue other avenues in light of opportunity cost. Those from this category whose profits are actually negative receive a strong signal to scale down their efforts or leave the market. In this process, many agents may guess wrong.

Ex post, after the fact, the market tends to select out those whose efforts fail. This tends to empower agents whose expectations ex ante, before hand, are more correct. Market selection make rational expectations and efficient market hypotheses hold in the long-run. The existence of short-run fluctuations are well observed. In the short-run, changes in stock prices follow a Cauchy distribution (Fama 1965). Whatever their form, we do not experience these distributions themselves. Rather, we experience states that, over time, comprise these distributions. Rational expectations and the efficient market hypothesis don't dispute this. The long-run models derived from them acknowledge that markets are, on average, right, even if they are unstable at times.

How do we describe the short-run? Criteria for efficiency hold constant agent belief, but it is this belief that can experience tremendous flux in the short-run.Without a theory of agent knowledge and the market process driven by this knowledge, a robust theory of the short-run in economics lies out of reach. History matters. Changes in nominal aggregates may not affect real aggregates in equilibrium, but they do affect the structure of society and they matter outside of equilibrium. We must take care in elaborating the implications of macroeconomic models. Short-run deviations can have long-run affects on capital structure. This is true in terms of physical capital in markets as well as social capital. Thus, the Great Depression radically changed economic, political, and academic landscape. In our own field, it allowed for the "Keynesian Diversion" that lasted for several decades! From a given point of departure, it may lead to a realization of an inferior adjacent possible, which economic theory should consider.