项目作者: tobanw

项目描述 :
Equilibrium marriage market models.
高级语言: Julia
项目地址: git://github.com/tobanw/MarriageMarkets.jl.git
创建时间: 2016-08-14T23:04:04Z
项目社区:https://github.com/tobanw/MarriageMarkets.jl

开源协议:Other

下载


MarriageMarkets

Build Status
Coverage Status

The MarriageMarkets package currently provides two marriage market models as Julia types:

  • StaticMatch: computes the equilibrium of the static frictionless marriage market model from “Who Marries Whom and Why” (Choo & Siow, 2006).
  • SearchMatch: computes the equilibrium of variants on the search and matching model from “Assortative Matching and Search” (Shimer & Smith, 2000) and the empirical extension in “Marriage Gains” (Goussé, 2014).

SearchMatch also allows for inflows of new singles as well as deaths.

Installation

In a Julia REPL, enter pkg mode (by pressing ]) and run:

  1. (v1.0) pkg> add MarriageMarkets

Julia version 1.0 or higher is required (installation instructions here).

Usage

As SearchMatch supports a number of model variants, there are specific constructors for the two main types:

  • SearchClosed: closed-system where agents cycle between singlehood and marriage
  • SearchInflow: steady-state population is determined by exogenous inflows and type-specific death rates

All models support both unidimensional and multidimensional agent types.
To specify a multidimensional type space, use a Vector of Vectors, e.g., [[1,1.5,1.7], [0,1]]

Examples

Here are some simple examples of solving models with unidimensional types.
I use Gadfly to plot the resulting equilibrium objects.

Static model

  1. using MarriageMarkets
  2. using Gadfly
  3. n = 50 # number of types
  4. Θ = collect(range(0.1, stop=1.0, length=n)) # type space vector
  5. m = ones(n) ./ n # uniform population measures
  6. f(x,y) = x*y # marital surplus function (per capita)
  7. static_mgmkt = StaticMatch(Θ, Θ, m, m, f)
  8. plot(z=static_mgmkt.matches, Geom.contour, Guide.title("Distribution of matches"))

matches

The saddle shape indicates positive assortative matching, as expected, due to the supermodular production function f(x,y) = x*y.

Search model

The example below solves a search model with inflows and death.
Then I plot the probabilities of match formation conditional on meeting.

  1. using MarriageMarkets
  2. using Gadfly
  3. λ, δ = 500.0, 0.05 # arrival rates of meetings and divorce shocks
  4. r = 0.05 # discount rate
  5. σ = 1 # variance of Normally distributed match-specific productivity shocks
  6. n = 50 # number of types
  7. Θ = collect(range(0.1, stop=1.0, length=n)) # type space vector
  8. f(x,y) = x*y # marital production function
  9. γ = ones(n) ./ n # uniform inflows
  10. ψ = ones(n) # uniform death rates
  11. search_mgmkt = SearchInflow(λ, δ, r, σ, Θ, Θ, γ, γ, ψ, ψ, f)
  12. plot(z=search_mgmkt.α, Geom.contour, Guide.title("Match probability conditional on meeting"))

alpha

Testing

In a Julia REPL session, enter pkg mode and run test MarriageMarkets.