README

CODE FOR THE NIGHTCLUB MODEL
(Self control, risk aversion, and the Allais Paradox - Fudenberg and Levine)



1- OVERVIEW:
This set of m-files solves the model in the paper, and generates tables 6 pp24 and 7 pp26.

The files make_table_6_pp24.m and make_table7_pp26.m actually make the tables, but call functions to do most of the problem solving. It should be pretty clear from the files how to change parameters to generate slightly different tables.

The two important functions here are decision.m, which calculates the best out of two lotteries, and reversal.m, which looks for preference parameters that exhibit Allais reversals.

2- DATA STRUCTURES:
We will use all the time data stuctures for the parameters of the model (usually a variable called param), and for pairs of lotteries (usually variables called L, L1, L2). Here are examples of both structures:

param = 

    delta: 1.0000
      tau: 0.5700
        x: 40
      rho: 2.8000
    gamma: 340000
    GAMMA: 6574

L1 = 

    PA: [0.0100 0.8900 0.1000]
    JA: [0 1000000 5000000]
    PB: [0 1 0]
    JB: [0 1000000 5000000]

Param follows the notation in the paper. As for L1, the two lotteries are A and B. A has winning probabilities given by the vector PA, and winning jackpots given by the vector JA. Similarly for B. JA can be different from JB, but both have to have the same number of elements (even though it doesn't have to be 3 elements)

3- FUNCTIONS:

[chosen_lottery C gamma1 mu1] = decision(param,L)

Returns the chosen lottery = 1,2 ; a matrix of optimal consumption C(i,s) of lottery i on state s ; gamma_1, the marginal cost of self control on lotteries i=1,2 ; and mu_1 on states i=1,2.

The way the solution is calculated is the following. Starting with arbitrary consumption, calculate the marginal cost of self control. Then given the marginal cost of self control, calculate consumption. And iterate this procedure for a fixed point.

For this the functions get_gamma1.m and get_C.m are used.

[gamma_star mu_star gamma_reversal GAMMA_reversal mu_1 mu_2] = reversal(x,rho,L1,L2)

This function finds parameters gamma_reversal and GAMMA_reversal for which there is an Allais paradox, given x, rho, and baseline values for tau and delta.

Its pretty straightforward, given that we have decision.m.

loadparam.m just loads all the objects in the structures param and L in the memory so the code looks more readable. It also defines functions like g(.), etc.

That is pretty much it, there are some of the commands that depend on formulas that I have notes for, but i mostly commented that directly on the code.
