Showing posts with label Model-Thinking. Show all posts
Showing posts with label Model-Thinking. Show all posts

Friday, August 16, 2013

Prediction and The Many Model Thinker

This set of lectures cover:
  1. Predictions
  2. Diversity Prediction Theorem 
  3. The Many Model Thinker

1. Predictions

We use categories to make sense of the world i.e. we "lump to live".

Categories for Predictions

We create categories.
Categories reduce variation (as measured by R-Squared).
The lower the variation, the better we get at predicting.
Different people create different categories.

Linear models for Predictions

Linear models assume a linear combination of components make up the whole.
The property of the whole can be predicted by knowing the property of the components.

2. Diversity Prediction Theorem

Relates the wisdom of the crowd to the wisdom of the individuals.
Crowd's accuracy depends on individual accuracy and crowd diversity.

Average individual errors are higher than average crowd error.
Diversity is the variation in prediction.

Diversity is the square of individual predictions from crowd average.

The Diversity Prediction Theorem states:

  Crowd's Error = Average Error - Diversity

  (c-v)^2 = 1/n * Sum(s[i] - v)^2 - 1/n * Sum(s[i] - c)^2

  where:
      v is true value
      s[i] is individual prediction
      c is crowd prediction
 The above is always true.

Read Wisdom of Crowds by Jim Surowiecki.

Wisdom of crowds come from reasonably smart people who are diverse.
Madness of crowds come from like-minded people who are all wrong.

3. The Many Model Thinker

Reason #1: Intelligent Citizen of the World
  • Growth model - investing in capital to grow
  • Solow Growth model - innovation matters
  • Colonel Blotto Game - How adding new dimensions

Reason #2: Clearer Thinker
  • Markov Models - history doesn't matter, some interventions don't help
  • Tipping Points - difference between tipping points 
  • Develop intuition of how things pan out out over time - different types of curves 
  • Things aggregate differently - More is Different

Reason #3: Understand and Use Data
  • Category Models & Linear Models
  • Growth Models

Reason #4: Decide, Strategize, and Design
  • Game Theory Models 
  • Mechanism Design - design institutions and incentive structures
  • Concept of Incentive Compatibility

 Understanding of how people behave
  • Rational behaviour
  • Psychological behaviour
  • Rule-based behaviour

Learning and Replicator Dynamics

Replicator Dynamics

This lecture covers:
  1. What is Replicator Dynamics
  2. Fisher's Theorem
  3. Fisher's Theorem vs Six Sigma

1. Replicator Dynamics

Tells us how a population changes/evolves over time as a function of payoffs and proportions.

    Set of types {1,2,3,...,N}

    Payoff of each type, Py[i]

    Proportion of each type, Pr[i]

Rational agents will choose the highest payoff.
Rule-based agents will copy someone else.

The Model


Define the weight of a strategy as:

     weight = Py[i] * Pr[i]  
This is reasonable because if Pr[i] = 0, then there the strategy cannot replicate.

The dynamics of the process is:

    Pr[t+1][i] = Pr[t][i] * Py[i] / Sum( Pr[t][i] * Py[i])

In other words, the proportion of a strategy in the next time step is the ratio of its weight over the sum of all weights.

Application of Replicator Dynamics

Shake-bow game.
Replicator dynamics also explains how it leads to an equilibrium in the shake-bow game.

SUV-Compact game
Replicator dynamics lead to sub-optimal Nash Equilibrium.

2. Fisher's Theorem

  "The change in average fitness due to selection will be proportional to the variance."

Consider the replicator dynamics in ecology:

    Set of types {1,2,3,...,N}

    Fitness of each type, Py[i]

    Proportion of each type, Pr[i]
The fitness wheel is a good metaphor where:
  • the size of slice represents fitness
  • the number of slices represent proportion

Fisher's Theorem is a combination of:
  1. Model 1: There is no cardinal
  2. Model 2: Rugged Landscape
  3. Model 3: Replicator dynamics
The role of variation plays in adaptation.

Fisher's Theorem explain why you should be the worst musician in the best band.
For the same average, larger variation will result in greater gain or greater adaptation.

3. Variation or Six Sigma

Opposite Proverbs.
Models have assumptions but proverbs don't.

Context for Six Sigma
- Fixed Landscape (Equilibrium world)

Context for Fishers Fundamental Theorem
- Dynamic/Dancing Landscape (Cyclic, Random or Complex world).

Thursday, August 15, 2013

Mechanism Design

Mechanism Design

Overview


Design better institutions - decide here are a set of actions people can take and the payoffs.

Two problems to overcome:
  1. Hidden actions - can't see what people are doing
  2. Hidden information - can't figure out information about people
Applied Mechanism Design
  • Auctions
  • Public Goods
Assume people are rational. And later on extend the model to account for psychological model of people and rules-based model of people.

Hidden Action and Hidden Information

We are designing incentive structures to induce people to take the right kinds of effort.

Hidden Action - you're an employer, how do you know if people put in the right amount of effort.
Also known as moral hazard problem.

The model:
  • Action: effort = 0,1
  • Outcome = {Good, Bad}
  • Prob(Good|effort=1) = 1
  • Prob(Good|effort=0) = p
  • Cost effort =c
Incentive compatible - Makes sense to put in effort.

Comparative Statics - given a model, try and get some understanding of what happens when variables changes in value.

Auctions

Objective of seller is to get as much money as possible.
Types of Auctions: Ascending price, Second price, Sealed bid.

Roger Myerson developed a Nobel Prize-winning Theorem that with rational bidders, a wide class of auction mechanisms including Ascending price, Second price and Sealed bid produce identical outcomes i.e. the highest bidder wins and pays the price of the second highest bidder.

It doesn't matter which auction mechanism is used if all players are rational.

Clarke-Groves-Vickery Pivot Mechanism

Pay the marginal amount you'd have to contribute for the project to be viable.
However, this mechanism is not balanced i.e.the combined contribution may not be sufficient to pay for the public good.







Wednesday, August 14, 2013

Prisoners' Dilemma and Collective Action

 This lecture covers:
  1. Prisoners' Dilemma - exploring the tension between cooperation and defection 
    1. the tension is between individual preferences(defect) and socially preferred outcomes(coop)
    2. they don't line up - Aristotle might have some insight into this - that the role of leadership is to remove tensions such as these.
  2. Cooperation x7 - seven ways to get cooperation in a Prisoners' Dilemma
  3. Collective Action Problems - Prisoners' Dilemma at scale
  4. Common Pool Resource Problems - The No Panacea option.

The Prisoner's Dilemma

What is it
  • Two Players
  • Pareto Efficient - there's no way in which you make make every single person better off.
  • Nash Equilibrium is DD
Where is it applied
  • arms control, price competition, technological adoption, food sharing
People will tend to a bad outcome.

Cooperation x7

  1. Repetition: Direct Reciprocity (Tit for Tat strategy)
  2. Reputation: Indirect Reciprocity
  3. Network Reciprocity
  4. Group Selection
  5. Kin Selection
  6. Laws and prohibitions - e.g. illegal to talk on cell phones
  7. Incentives - e.g. shovel sidewalk or get fined

Super Cooperators by Michael Novak.

Collective Action Problem / Free Rider Problem

Examples of Collective action Problem
  1. Global Carbon Emissions
  2. Fixing the flooding problem in the community (this is more of a Public Good problem)
An extension of the prisoners' dilemma problem where when I cooperate, lots of people benefit but when I defect, I will benefit alone.

The Model

Let Xj be the action of person j.
Xj is some amount of effort between 0 and 1 - how much we're contributing to the public good.

Payoff of j = -Xj + b*Sum(Xi | i from 1 to N)
b in (0,1)

Note that if b > 1, then we'll always contribute because Xj is 1 and regardless of what others do b*Xj is greater than 1.

Overconsumption followed by collapse.

Jared Diamond - Collapse

Common Pool Resource Problem

Examples of this include cows grazing in the commons, cod fishing or turkey hunting.

The Model

x[j] is amount consumed by j
X is total consumed
C is amount available

Amount Available Next Period:
    C[t+1] = (C[t] - X)^2


Solving Collective Action Problem and Common Pool Resource Problems
  1. Particulars matter, for example:
    1. Grazing in the Commons - the amount of grass is visible to all
    2. OverFishing - the fish population is not visible so some form of monitoring is required
    3. Upstream vs Downstream - focus more on upstream as they greatly influence outcomes

Eleanor Ostrom says particulars matter i.e. No Panacea 

Monday, July 29, 2013

Beyond Model Thinking

 Next steps beyond model thinking
  • Figure out entropy 
  • Checkout - http://www.complexityexplorer.org/

Saturday, July 27, 2013

Networks

Networks

Lectures cover:
  • Logic
    • what rules or organizations use to form connections?
    • how it forms
  • Structure
    • what are the measures to compare networks?
    • measures
  • Function
    • what properties emerges from the structure?
    • what it does

Network Structure

  • A set of nodes and edges
    • edges can be undirected or directed
  • Degree
    • how many edges each node has on average
    • node
      • number of edges attached to a node
    • network
      • average degree of all nodes
      • = 2 x Edges / Nodes
    • neighbours of a node
      • all other nodes connected by an edge to the node
    • Theorem
      • The average degree of neighbours of nodes will be at least as large as the average degree of the network
      • i.e. Most people's friends are more popular than they are!
  • Path Length
    • definition
      • Minimal number of edges that must be traversed to go from node A to node B
    • Average Path Length
      • Average path length between all pairs of nodes in a network
    • how far it is from each node to another node
  • Connectedness
    • whether the entire graph is connected to itself
    • definition
      • A graph is connected if you can get from one node to any other
  • Clustering Coefficient
    • how tightly clustered are the edges
    • definition
      • percentage of triples of nodes that have edges between all three nodes
  • What each measure tells us
    • Degree
      • Density of connections
      • Social Capital
        • A proxy for social capital
      • Speed of Diffusion 
        • How quickly information spreads
    • Path Length
      • # Flights Needed
      • Social Distance
      • Likelihood of information spreading
        • unlikely to spread if path length is long
    • Connectedness
      • Markov Process - an essential precondition
      • Terrorist Group Capabilities
        • Connected groups are more capable
      • Internet/Power Failure
      • Information Isolation
        • Disconnected people may not learn things
    • Clustering Coefficient
      • Redundancy/Robustness
        • If there is a break, the network still works
      • Social Capital
      • Innovation adoption (triangles)
        • How likely an innovation is likely adopted
  • Picture = 1000 words

Network Logic

  • Random attachment
    • Connection procedure
      • N nodes
      • P probability two nodes connected
    • Contextual Tipping Point
      • For large N, the network almost always becomes connected when P > 1/(N-1)
  • Small Worlds
    • People have some percentage of "local" or "clique" friends and some percentage of random friends
    • As people have more random friends, there's less clustering an shorter average path length
  • Preferential Attachment
    • Connection procedure:
      • Node Arrives
      • Probability connects to an existing node is proportional to the node's degree
    • The degree distribution always results in a long tail
      • A lot of nodes only have degree 1
      • A handful of nodes with very high degree
    • Results
      • The exact network we get is path dependent
      • The equilibrium degree distribution is not path dependent
        • Always a long tail degree distribution

Network Function

  • Micro decisions/processes when forming networks aggregates in emergent network properties
  • Six Degrees
    • Stanley Milgram & Duncan Watts
    • Random Clique Network
      • Formation Rules: Each person has
        • C clique friends
        • R random friends
      • K-Neighbour
        • All nodes that are of path length K to a node but not of any shorter path length
      • Strength of weak ties

Path Dependence

Path Dependence

Lectures cover:
  • What is Path Dependence?
  • Construct Urn Models to understand
    • different types of path dependence
    • what causes path dependence
    • difference between path dependent outcomes and path dependent equilibria
  • Examples of Urn Models
    • Polya Process, Balancing Process,
  • Path dependencies is logically different from increasing returns
  • Path dependencies are caused by externalities i.e. interdependencies between choices/decisions
    • externalities with negative effects are more likely to be path dependent
  • Compare path dependence and Markov Processes, Tipping Points and Chaos
  • Key lessons - my own reflection of what this lecture means
Real-world examples:
  • QWERTY typewriter keyboard
    • increasing returns / virtuous cycle
      • the more QWERTYs lead to more QWERTYs
  • Technology
    • AC vs DC
    • Gasoline vs Electric Cars
  • Common Law
    • Influence of Precedent
  • Institutional Choices
    • Defined benefits
  • Economic Success
    • Ann Arbor vs Jackson
  • Manifest Destiny of America
  • Railroads 
 

Path Dependence

  • Path Dependent
    • Outcome probabilities depend upon the sequence of path outcomes.
      • Doesn't necessarily determine, merely affects the probabilities
    • What happens now depends on what happened along the path to get here
  • Phat Dependent
    • Outcome probabilities depend upon past outcomes outcomes but not their order
      • Polya process is Phat

Urn Models

  • Basic Urn Model
    • Urn contains balls of various colors
    • The outcome equals the color of the ball selected
  • Bernoulli Model
    • Fixed number of balls in the urn
    • U = {B blue, R red}     ; U stands for Urn is a set of B blue and R red
    • Process: Select ball and return to the urn
    • P(red) = R/(B+R)
    • Outcomes independent
  • Polya Process
    • U = {1 Blue, 1 Red}
    • Process: 
      • Select and return
      • Add a new ball that is the same color as the ball selected
    • Probabilities will change over time
    • Result
      • Any probability of red balls is an equilibrium and equally likely
      • Any history of B blue and R red balls is equally likely
        • Seeing just the set in the outcome doesn't tell you anything about the order (a Phat process) because any order is equally likely
    • Example:
      • Fashion: People buy leopard prints because there are more leopard prints
      • Technology: People buy iPhones because they see iPhones
  • Balancing Process
    • U = {1 Blue, 1 Red}
    • Process:
      • Select and return
      • Add a new ball that is the opposite color as the ball selected
    • Result
      • The balancing process converges to equal percentages of the two colors of balls
    •  Examples
      • Need to keep constituencies happy
        • Selection of site for political conventions - northern or southern state
        • Selection of site by Olympic committee - Asia, Europe, North America or South America
  • Sway Process
    •  U = {1 Blue, 1 Red}
    • Process
      • Select and return 
      • In period t, add a ball of the same color as the selected ball and add 2^(t-s) - 2(t-s-1) of color chosen in each period s < t
    • As you go back in time,the older events take on exponentially more weight over time
    • Early movers have a bigger effect
  • Distinguish between:
    • Path Dependent Outcomes
      • color of ball in a given period depends on the path
    • Path Dependent Equilibrium
      • percentage of red balls in long run depends on the path
  • Outcomes and equilibrium
    • Polya process: 
      • Path-dependent outcomes
      • Path-dependent equilibria
    • Balancing process: 
      • Path dependent outcomes
      • Equilibria independent of path
  • Examples of path-independent equilibria
    • Manifest Destiny - America will stretch from sea to shining sea
    • Railroads - Once railroads were invented, they will build themselves
    • Mobile - Once invented, mobiles is the future

Path Dependence and Chaos

  • Why is the difference between Path Dependence and Phat Dependence important
  • Markov processes
    • finite states
    • fixed transition probabilities
    • can get to any other state
    • not simple cycle
    • markov converges to a unique stochastic equilibrium
  • Chaos
    • Extreme Sensitivity to Initial Conditions (ESTIC)
    • If initial points x and x' differ by even a tiny amount after many iterations of the outcome function, they differ by arbitraty amounts.
  • Tent Map (an example of chaotic)
    • x in (0,1)
    • F(x) = 2x   if X <0.5,
    •         = 2 - 2x if X > 0.5
  • Tent Map is not path dependent
    • Nothing happens along the way/path will change the end
    • is deterministic
  • Path dependence means what happens along the way has an impact on the outcome
Types of outcomes
  • Independent
    • Outcome doesn't depend on starting point or what happens along the way
  • Chaotic
    • Outcome depends on initial conditions
  • Path dependent
    • Outcome probabilities depend upon sequence of past outcomes
  • Phat dependent 
    • Outcome probabilities depend upon past outcomes but not their order
History is path dependent. The future is being written today.
  • History/future is not independent i.e. what's happening now is happening regardless of what happened in the past. Independence means no structure.
  • History/future is not chaotic i.e. initial conditions matter but it isn't the only thing that matter. Once we write the Constitution, the rest plays out deterministically
  • History/future is path dependent not phat dependent because early events have a larger importance.

Path Dependence and Increasing Returns

  • Increasing Returns
    • More produces more
    • Positive feedback / Virtuous cycles
    • The more I have of something, the more I want the same thing 
    • The the more other people do something, the more that other people will do it
  • Example:
    • The more people get QWERTY typewriters, the more people will get QWERTY typewriters
  • Is increasing returns equivalent to path dependent equilibrium? No
    • Increasing returns without path dependent equilibrium
      • Example:
        • Gas / Electric
        • Always goes to equilibrium at Gas even though there is increasing returns
    • Path dependent equilibrium without increasing returns
      • Example
      • Symbiots
  • Path Dependencies comes from a different process - Externalities
    • Externalities:
      • interdependence between choices can create path dependence
    • Decisions create externalities
    • Externalities that big projects create path dependence
      • Choosing Project A first results in choosing Project C next
      • Choosing Project B first results in choosing Project D next
    • Yi J's decision to migrate to Australia affects parents & Dai J

Path Dependence or Tipping Point

  • Path Dependent Equilibrium
    • percentage of red balls in the long run depends on the path
  • Tipping points
    • direct tips
  • Comparison
    • Tipping points
      • a single instance in time where the long term equilibrium
      • a singular event that tips the event abruptly
      • diversity index - count of equilibria
        • diversity index (uncertainly) is reduced abruptly
      • entropy - how much information in the system
    • Path Dependent Equilibrium
      • accumulative effect of moving along the path
      • diversity index reduces gradually
        • unlike tipping point where diversity index (uncertainly) is reduced abruptly

Key Lessons

  • Externalities are the reason choices we make in the past will affect choices we make in the future
  • Pay more attention to choices with externalities e.g.
    • Where you choose to live
    • What line of work you choose to do
    • What language you choose to learn
  • Where possible make decisions where externalities are all positive 
    • including future externalities
    • this will reduce path dependencies i.e. keep your options open
  • History matters when it changes transition probabilities
    • Make decisions that increase transition probabilities to states you desire - to goal states
  • Pay attention to externalities when making decision especially negative externalities
    • Keep your options open

Saturday, July 20, 2013

Lyapunov Functions, Externalities and Langton's Lambda

Externalities

An externality in an exchange market is an action by one party that materially affects the happiness of someone who is not directly a party to the action.

Externalities make systems churn - less likely to reach equilibrium. Examples include:
  1. Arms Trading
    • Participants are happy but other countries are unhappy (externality)
  2. Political Coalitions
    • When Party A merges Party B, Party C may be upsed
  3. Mergers
    • When two firms merge, other firms are less profitable, less secure
  4. Alliances
    • When two countries make alliances, other countries are less happy, feeling less secure 
 Systems with externalities affect the Lyapunov Function of other parties which changes their behaviour which in turn may change our behaviour and it generally leads to churn.

Chris Langton's Lambda Parameter

  1. Systems where behaviour isn't  influenced by others tend to go to equilibrium
  2. Systems where behaviour and actions are influenced by others then to be complex

Lyapunov Functions in Exchange Markets

Exchange Markets

  1. People bring stuff - some bring fish, some bring vegetables, some bring money
  2. People exchange stuff (trade)

Assumptions

  1. Each person brings a wagon of stuff
  2. People trade with others but only if each gets an increase in happiness by some amt K 

Lyapunov Function

  • Lyapunov Function
    • Sum of total happiness
  • Maximum
    • There is a maximum happiness - when everyone gets what they want
  • Each move increases value of Lyapunov Function
    • Each trade increases total happiness

Four states of any system

The four states

  • Equilibrium
  • Cycle
  • Random
  • Complex

Equilibrium State

  • Lyapunov Function: If a Lyapunov Function can be constructed for a system, the system will go to equilibrium 
  • Markov Process: If it's a Markov Process, it will reach stochastic equilibrium

Thursday, July 18, 2013

Lyapunov Functions - Scary Russian Function Not!

What's a Lyapunov function

The existence of a Lyapunov function for a model or system means that the system will hit equilibrium.

The elements of such a system include:
  1. A maximum
  2. A Lyapunov function
  3. A property such that if something moves, it will always increase by k

How do cities self-organize such that queues are reasonable?

Answer: A Lyapunov function exists that explains how the city moves to equilibrium.

Applications of Lyapunov function

List of applications
  1. Self-organizing cities
  2. Exchange Economies
  3. Arms trading

Sunday, July 7, 2013

Markov Convergence Theorem

Assumptions for Convergence

A1: Finite states
A2: Fixed transition probabilities
A3: Can eventually get from any one state to any other
A4: Not a simple cycle (not automatic state changes)

Given A1-A4, a Markov process converges to an equilibrium distribution which is unique.

Implications

  • The initial state doesn't matter
  • History doesn't matter
  • Interventions doesn't matter
    • Is this the systemic structural property that prevents diets from succeeding?

Things to Remember

  • It could take a long time to reach the equilibrium
  • The point of intervention is by changing A2, by changing the transition probabilities
  • Changing state: temporary; Changing transition probabilities: permanent

How to use Models

How to use models

1. Start with a simple model (e.g. alert/bored model for Markov processes)
2. Understand the mechanics of the simple model
3. Understand how the simple model scales with more dimensions (e.g. 3 states instead of 2)
4. Apply the model to real problems with more dimensions (e.g. democratization problem)
5. Use real data and get a deeper understanding of how the model works
6. See if counter-intuitive results emerge

Reference:

  • Lecture 10.3 Markov Model of Democratization

Seeing Through the Lens of Markov Processes

"That's a Markov process"
What would it be like if we see the world through the lens of Markov processes?

What's a Markov process?

Two mild conditions:
  1. Finite set of states
  2. Stable transition probabilities
  3. Members can move from one state to another
Under those two conditions, the Markov Convergence Theorem says that there will be statistical equilibrium such that the number of members in each state remains the same even though there is churn.

How to determine the Markov Equilibrium?

Build the Markov Transition Matrix and solve for the equilibrium.

A Notion of "Better"

A notion of better

Faster, cheaper, better.How do we determine when a method/procedure/solution is "better"?
It is relatively easy to measure faster, cheaper but it's harder to measure better.

This is not simple idle thinking but it does lead to some life changing behaviours.

Less is better

Two concrete examples of better: Everything and Launchy (use version 1.25)
Everything is a tool that locates files and folders by name. It is an essential tool for me, yet a close friend of mine does not use it.
Launchy is another tool I use - as a calculator and a launcher. I probably use it 100 times a day, yet my close friend does not use it - even after I've demonstrated what it does.

I conclude that everyone has a different notion of better.

By using launchy, I've replaced the need to use the mouse to click the Start > Program > Folder > Shortcut with some quick key presses. A task that took 5 seconds now takes 0.5 seconds - an order of magnitude improvement. That's better.
But to get to that, it required some initial investment - setting up the launchy, understanding how it works and what it does and how to get the most out of it. But it is worth it.

Condensed is better

Proverbs and wise sayings are condensed wisdom of the ages. A few carefully selected words are better than a length essay.
There is value is condensing an entire topic into a few words. It may be that we need to first read the entire topic but the condensed words will quickly remind us of what is important.

Two quotes are relevant here:
He is the most useful teacher who condenses the most knowledge into short sentences, that are easily remembered and applied ~Samuel Johnson
The writer helps us the most who gives us the most knowledge, and takes from us the least time ~Sidney Smith

Visual is better

In a lecture on Nash Equilibrium, a textual description of the procedure to find the Nash Equilibrium was presented. Later in the discussion forum, two students described visual versions of the procedure which many of us found simpler and more intuitive.

Another takeaway from this will be simple is better and comprehensible is better.

The big idea

Minimal, condensed visuals are better.