https://github.com/tobanw/marriagemarkets.jl
Equilibrium marriage market models.
https://github.com/tobanw/marriagemarkets.jl
economics julia marriage-market-models matching search-and-matching
Last synced: 3 months ago
JSON representation
Equilibrium marriage market models.
- Host: GitHub
- URL: https://github.com/tobanw/marriagemarkets.jl
- Owner: tobanw
- License: other
- Created: 2016-08-14T23:04:04.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2018-11-10T04:23:07.000Z (almost 7 years ago)
- Last Synced: 2025-07-22T10:21:08.749Z (3 months ago)
- Topics: economics, julia, marriage-market-models, matching, search-and-matching
- Language: Julia
- Size: 85.9 KB
- Stars: 7
- Watchers: 2
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# MarriageMarkets
[](https://travis-ci.org/tobanw/MarriageMarkets.jl)
[](https://coveralls.io/github/tobanw/MarriageMarkets.jl?branch=master)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:
```julia
(v1.0) pkg> add MarriageMarkets
```Julia version 1.0 or higher is required (installation instructions [here][version]).
## 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 ratesAll models support both unidimensional and multidimensional agent types.
To specify a multidimensional type space, use a `Vector` of `Vector`s, e.g., `[[1,1.5,1.7], [0,1]]`## Examples
Here are some simple examples of solving models with unidimensional types.
I use [Gadfly][gadfly] to plot the resulting equilibrium objects.### Static model
```julia
using MarriageMarkets
using Gadflyn = 50 # number of types
Θ = collect(range(0.1, stop=1.0, length=n)) # type space vector
m = ones(n) ./ n # uniform population measures
f(x,y) = x*y # marital surplus function (per capita)static_mgmkt = StaticMatch(Θ, Θ, m, m, f)
plot(z=static_mgmkt.matches, Geom.contour, Guide.title("Distribution of 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.```julia
using MarriageMarkets
using Gadflyλ, δ = 500.0, 0.05 # arrival rates of meetings and divorce shocks
r = 0.05 # discount rate
σ = 1 # variance of Normally distributed match-specific productivity shocks
n = 50 # number of types
Θ = collect(range(0.1, stop=1.0, length=n)) # type space vector
f(x,y) = x*y # marital production functionγ = ones(n) ./ n # uniform inflows
ψ = ones(n) # uniform death ratessearch_mgmkt = SearchInflow(λ, δ, r, σ, Θ, Θ, γ, γ, ψ, ψ, f)
plot(z=search_mgmkt.α, Geom.contour, Guide.title("Match probability conditional on meeting"))
```
## Testing
In a Julia REPL session, enter `pkg` mode and run `test MarriageMarkets`.
[unregistered]:https://docs.julialang.org/en/latest/stdlib/Pkg/#Adding-unregistered-packages-1
[version]:http://julialang.org/downloads/platform.html
[gadfly]:http://gadflyjl.org/stable/