Function Reference
LandUse.CParam
— TypeA Country-wide Parameter struct
LandUse.Param
— TypeParameter Struct
This struct defines the parameter type for the model. It reads default values from the file src/params.json
. Those values can be overridden by supplying a Dict
to the constructor with key => value
pairs:
p = LandUse.Param(par = Dict(:η => 0.1))
creates a Param
instance with agglomeration forces set to 0.1
LandUse.Region
— TypeRegion type
Urban expansion model with flexible commuting cost and differential supply elasticity. This represents a single region. A region contains one potential urban area, and a rural area. A Region
can be part of a wider Country
.
LandUse.Urban
— TypeUrban Model
This model has a fixed price of land ρr in the rural sector. Differently to our baseline model, where ρr is a GE object.
Base.convert
— Methodconvert a country param to one param for each region
LandUse.D
— MethodPopulation Density at location $l$
LandUse.D2
— MethodPopulation Density at location $l$. second version, independent of Lu
LandUse.EqSys!
— MethodComputes the entries of the residual vector $u$
LandUse.Eqsys!
— MethodEqsys!(F::Vector{Float64},m::Region,p::Param)
compute system of equations for the general (with flexible ϵ).
LandUse.Eqsys!
— MethodEqsys!(F::Vector{Float64},m::Urban,p::Param)
compute system of equations for the general (with flexible ϵ).
LandUse.GDP
— MethodGDP
LandUse.H
— Methodhousing supply at location $l$
LandUse.Rmk
— MethodCountry Rural Market Clearing
LandUse.Rmk
— MethodRural Market Clearing
LandUse.Srh
— MethodResidential Land in Rural sector. equation (20)
LandUse.Yr
— MethodProduction of Rural Good
LandUse.Yu
— MethodProduction of Urban Good
LandUse.cfun
— Methodcost of construction at location $l$
LandUse.compute_ξw
— Methodcompute_ξw()
Computes input parameter ξw directly from data. Notice that $1 - \xi_w$ is the elasticity of speed to wage income. We measure from individual commuting data in ENL (Enquete National de Logement) an increase in commuting speed of about 11% from 1984 to 2013. This function returns
$\xi_w = 1 - \frac{11}{\%\Delta \theta_u}$
where $\%\Delta \theta_u$ stands for the percentage increase in urban wage from 1984 to 2013.
LandUse.copydb
— Methodcopy dropbox data to in/ folder
LandUse.cr
— Methodoptimal rural good consumption at location $l$. Equation (7) divided by p
LandUse.cs_plots
— Methodsingle spatial cross sections region
LandUse.cu
— Methodoptimal urban good consumption at location $l$. Equation (8)
LandUse.cu_input
— MethodAmount of Urban Good (numeraire) required to build housing at $l$
LandUse.cur
— Methodurban good consumption in rural sector. Equation (8)
LandUse.d
— Methodcommuting distance
LandUse.dash
— Methoddash(it;par = Dict())
Helper function for quick Region dashboard.
LandUse.dashboard
— Methoddashboard(C::Vector{Country},it::Int)
Dashboard for a Country
in period it
LandUse.dashboard
— Methoddashboard(M::Vector{Region},p::Param,i::Int; objvalue = nothing)
Model dashboard for a single Region
.
LandUse.dashk20
— Methoddashk20(;save = false)
Produce and optionally save model output for 20 city version.
LandUse.dataframe
— MethodObtain a Time Series from an array of Country as a DataFrame
LandUse.dataframe
— MethodObtain a Time Series for a single region as a DataFrame
LandUse.expmodel
— MethodEstimate exponential model on spatial density.
LandUse.expmodel
— MethodCompute exponential decay model of density for each region in a country
LandUse.firstnorm
— Methodnormalize a vector wrt it's first element
LandUse.foc_Lr
— MethodFOC of rural firm wrt labor Lr
LandUse.foc_Sr
— MethodFOC of rural firm wrt land Sr
LandUse.getfringe
— MethodGet Fringe from indifference condition
At the fringe $\phi$ we have the condition
\[w(0) - \tau(\phi) = w_r\]
which can be rearranged to obtain a map from $w(0) - w_r = \tau(\phi)$.
The function takes $w(0) - w_r$ as argument x
. then we give $\tau(\phi)$ to its inverse function to get back $\phi$
LandUse.i0
— Methodi0()
interact with the baseline single city version of the model. This basically calls dashboard(M::Vector{Region},p::Param,i::Int)
after creating p
from a set of user inputs.
LandUse.i0k
— Methodi0k()
interact with the 2 city model.
LandUse.integrate!
— Methodintegrate!(m::Region,p::Param)
perform numerical integration using gauss-laguerre.
LandUse.integrate!
— Methodintegrate!(m::Urban,p::Param)
could be made much faster by filling a matrix col-wise with integration nodes and doing a matmul on it? have to allocate memory though.
LandUse.invτ
— Methodinverse commuting cost. cost x → location. Notice we don't consider that cost is zero beyond ϕ: we want to find ϕ here to start with.
LandUse.iobj
— MethodLandUse.isfeasible_grid_row
— Methodchecks whether a certain row of the grid together with a starting value x0 produces a valid solution in all periods.
LandUse.issue10
— Methodplot $\phi_k$ vs $L_{u,k}$ for all regions $k$ and different eps slopes. relates to https://github.com/floswald/LandUse.jl/issues/10
LandUse.issue11
— Methodmeasure increase in land value at fringe. by default starts in 1960 and measures increase up to 2020.
https://github.com/floswald/LandUse.jl/issues/11
LandUse.issue15
— Methodhttps://github.com/floswald/LandUse.jl/issues/15
LandUse.issue36
— Methodhttps://github.com/floswald/LandUse.jl/issues/36
- same growth in sectors i. high cbar vs low sbar: show implied city density time series to see that only that config works ii. show falling housing spending share as well
- implications of growth in either sector only
- identify commuting cost params by matching time series data
LandUse.issue59
— Methodrun model with flat epsilon
https://github.com/floswald/LandUse.jl/issues/59
LandUse.issue60
— Methodrun model with agglomeration forces
https://github.com/floswald/LandUse.jl/issues/60
LandUse.issue64
— Methodrun model with congestion forces
https://github.com/floswald/LandUse.jl/issues/64
LandUse.issue66
— Methodrun multi city with congestion
https://github.com/floswald/LandUse.jl/issues/66
LandUse.issue67
— Methodfive city cross section
https://github.com/floswald/LandUse.jl/issues/67
LandUse.issue9
— Methodplot $\phi_k$ vs $\L{u,k}$ for all regions $k$. relates to https://github.com/floswald/LandUse.jl/issues/9
LandUse.issue_21
— Functionhttps://github.com/floswald/LandUse.jl/issues/21
LandUse.issue_22
— Methodhttps://github.com/floswald/LandUse.jl/issues/22
LandUse.jc
— Methodsolve a Country
at point x0
keywords:
estimateθ
: whether the sequence of $\theta_u$ should be a choice variablesolve
: solve the model (true
) or return the model object for debugging?fit_allyears
: try to match the population distribution in all available years or just a single year.
LandUse.jm
— Methodsolve model at current Param
p
and starting at point x0
Keyword:
estimateθ
: whether the sequence of $\theta_u$ should be a choice variable or not. defaultfalse
.
LandUse.k20output
— MethodProduces output from 20-city model. In particular comparison with single city case, and extension with d1, d2.
LandUse.k5
— Method5 country case
LandUse.latex_param
— Methodprint default param to latex table
LandUse.maxnorm
— Methodnormalize a vector wrt it's maximal element
LandUse.multik
— MethodRuns K regions as a country and produces 2 plots
LandUse.nearstart
— Methodyou just had a failed start at p
LandUse.objective
— Methodobjective(x; moments = false, plot = false, save = false, fname = "moments")
moment objective function for an optimizer
LandUse.objective1
— Methodobjective1(;save = false)
run objective function at default parameter
LandUse.output_paper
— Methodproduces all output from the model needed to compile the paper.
This uses current baseline parameters defined in params.json
LandUse.p2Flux
— Methodp2Flux(p::Param)
map param to Flux Chain to get starting value
LandUse.p2x
— Methodp2x(p::Param)
map param to x for objective function quick eval this is the inverse of x2dict
.
LandUse.pcy
— Methodaggregate per capita income
LandUse.plot_dens_years
— Methodplot densities for all years
LandUse.plotk20
— Methodplotk20(;save = false)
Produce model output for 20 city version.
LandUse.poparea_data
— Methodload population and area data
LandUse.popdata_mapyears
— Methodfind closest year in population data to model years
LandUse.prepare_data
— Methodprepare_data(p::Param; digits = 9)
Takes raw csv data and prepares to be used in model. writes to csv input files.
Smoothing of Productivity Series
We take the following steps to obtain a smoothed series for $\theta_r$ and $\theta_u$:
- We obtain the estimated series at annual frequency.
- We subset both series to start in 1840 and end in 2015 (rural productivity ends in that year)
- We linearly interpolate the missing interwar years.
- Smoothing is done via the [
smooth
] function from the QuantEcon package: we use the default Hann window and a 15-year window size. We experimented with the window size until high-frequency oscillations disappear. - Our rural productivity series gets very volatile from 2000 onwards, and in fact one would find a decreasing rural productivity series if we applied our smoother to post 2000 data. Therefore from the year 2000 onwards, we grow the smoothed series forward with 1% annual growth. Given that 2000 is very close to the final new steady state of the model, the actual choice of growth rate has only a small impact on our results.
LandUse.q
— Methodhouse price function at $l$. equation (12)
LandUse.qr
— Methodrural house price from land price
LandUse.rel_cityarea
— Methodrel_cityarea(m::Model)
Computes city area relative to total rural land use. This is the model moment related to the data moment artificialized land relative to agricultural land in 2015. We measure this to be 18.3% in the data.
LandUse.relpop
— Methodreturn model relative population in each year to largest city largest city is city 1
LandUse.run
— Methodrun Single region model for all time periods
LandUse.run
— Methodrun Single region model for all time periods
LandUse.runestim
— Methodrunestim(;steps = 1000,fname = "moments")
Run the default differential evolution optimizer from BlackBoxOptim.jl
LandUse.runk
— Methodrun Multi-region model for all time periods starting from the single city starting value.
LandUse.startvals_impl
— Methodcollect valid starting values for the k country case by reusing the first period solution of each preceding step in θu along the sequence
LandUse.startvals_k
— Methodstartvals_k()
Find feasible starting values for multi city case (2 to 5 cities) and write to disk. By default return the saved dict with start param and initial guess vector x0
.
LandUse.startvals_par
— Methodhelper function to prepare country param
LandUse.targets
— Methodreturns a dict of empirical targets for the model
LandUse.ts_plots
— Methodts_plots(M,p::Param;fixy = false)
Time series plots for a single Region
M
.
LandUse.update!
— Methodupdate!(c::Country,p::Vector{Param},x::Vector{Float64})
Update a Country
object with a current vector of choice variables x
supplied by the solver. The ordering in x
is:
- b: ratio of labor to land in region 1
- r: land rent
- pr: relative price rural good
- 4 : (K+3), Sr: amount of land use in rural production (complement of Srh)
- (K+4) : (2K+3), Lu: urban pop in each k
- (2K+4) : end, θu: urban prod in each k
LandUse.update!
— MethodLandUse.update!
— Methodupdate!(m::Urban,p::Param,x::Vector{Float64})
update a single region a parameter vector at choices x
.
LandUse.utility
— MethodUtility function equation (5)
LandUse.w
— Methodwage at location $l$
LandUse.wr
— Methodrural wage from indifference condition at ϕ. Eq (11)
LandUse.wu
— Methodurban wage at location $l$
LandUse.wu0
— Methodurban wage at center
LandUse.x2dict
— Methodx2dict(x)
map vector x to dict for Param
LandUse.xsr
— Methodexcess subsistence rural worker
LandUse.xsu
— Methodexcess subsistence urban worker
LandUse.y
— Methoddisposable income: GDP net of commuting costs
LandUse.ρ
— Methodland price function at $l$. equation (15)
LandUse.τ
— Methodcommuting cost: location x → cost
LandUse.χ
— Methodhousing supply shifter at $l$
LandUse.ϵ
— Methodhousing supply elasticity at $l$