Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Experimental #53

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
c2defb7
Update Statistics2.java
justin-ven Apr 29, 2024
6ed98d6
Merge remote-tracking branch 'upstream/develop' into experimental
justin-ven Apr 30, 2024
127477a
merge in new base data from upstream
justin-ven Apr 30, 2024
9fbde7f
minor update to refine starting point for calibration
justin-ven Apr 30, 2024
a16d157
Merge branch 'experimental' of https://github.com/justin-ven/SimPaths…
justin-ven Apr 30, 2024
a76307b
minor adjustment to config for calibration
justin-ven Apr 30, 2024
35ce529
initialise missing wage potential where missing
justin-ven Apr 30, 2024
af3408e
minor debugging
justin-ven May 1, 2024
e9d7254
fix debug code
justin-ven May 1, 2024
c9c93d3
debug of input data and account keeping
justin-ven May 2, 2024
434121b
revert config file for multirun simulation
justin-ven May 2, 2024
9923bd1
allow for distinction between liquid, pension, and housing wealth
justin-ven May 11, 2024
4d6debf
expand set of reported wealth data
justin-ven May 12, 2024
92707ae
working changes
justin-ven May 15, 2024
0872d52
adjustments to facilitate calculation of labour supply elasticities
justin-ven May 20, 2024
b33466c
parameter update
justin-ven May 21, 2024
2deb257
Merge branch 'experimental' into temp
justin-ven May 21, 2024
bd2f642
amendments to model during calibration
justin-ven May 29, 2024
14ebd0c
correct problem with indexing of wealth data for input population
justin-ven May 29, 2024
e233475
Merge remote-tracking branch 'upstream/develop' into experimental
justin-ven May 29, 2024
3e83086
no changes
justin-ven May 29, 2024
ac0e46b
Merge remote-tracking branch 'origin/temp' into experimental
justin-ven May 29, 2024
c7fbe53
check and confirm all input regression files
justin-ven May 29, 2024
9bd28eb
revert to standard multirun prior to develop push
justin-ven May 30, 2024
5f93a4a
update training data
justin-ven May 30, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -198,3 +198,7 @@ input/input.mv.db.old
input/input.mv.db.original
dependency-reduced-pom.xml
.idea/vcs.xml
input/EUROMODoutput/augmented1/
input/EUROMODoutput/original/
*.stswp
~$*.*
1 change: 1 addition & 0 deletions .idea/dataSources.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

90 changes: 90 additions & 0 deletions analysis/intertemporal elasticities.do
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
/**************************************************************************************
*
* PROGRAM TO EVALUATE INTERTEMPORAL ELASTICITIES OF SUBSTITUTION
*
* Program analyses output from multirun config file: "config - intertemporal elasticity"
*
* meta-analysis by Havranek, Horvath, Irsova, and Rusnak (2013) includes 34 studies that
* report 242 estimates for the intertemporal elasticity of substitution calculated on UK data,
* with a mean of 0.487 and a standard deviation of 1.09
*
* Last version: Justin van de Ven, 21 May 2024
* First version: Justin van de Ven, 21 May 2024
*
**************************************************************************************/

clear all

global moddir = "C:\MyFiles\99 DEV ENV\JAS-MINE\SimPaths\output\intertemp3\csv"
global outdir = "C:\MyFiles\99 DEV ENV\temp\"


/**************************************************************************************
* start
**************************************************************************************/
cd "$outdir"
import delimited using "$moddir/BenefitUnit.csv"
save temp0, replace


/**************************************************************************************
* evaluate run statistics
**************************************************************************************/
forvalues ii = 1/3 {

use temp0, clear
keep if (run==`ii')
if (`ii'==1) {
sum id_benefitunit
local id0 = r(min)
}
else {
sum id_benefitunit
local id1 = r(min)
replace id_benefitunit = id_benefitunit - `id1' + `id0'
}
xtset id_benefitunit time
gen eqs = disposableincomemonthly * 12 / equivaliseddisposableincomeyearl
gen tcons = discretionaryconsumptionperyear + (childcarecostperweek + socialcarecostperweek) * 364.25/7
gen econs = tcons/eqs
gen lrecons`ii' = ln(econs / l.econs)
keep if (!missing(lrecons))
keep id_benefitunit lrecons idoriginalbu idoriginalhh
rename idoriginalbu idorigbu`ii'
rename idoriginalhh idorighh`ii'
save temp`ii', replace
}


/**************************************************************************************
* compile statistics over runs
**************************************************************************************/
use temp1, clear
merge 1:1 id_benefitunit using temp2, keep(3) nogen
merge 1:1 id_benefitunit using temp3, keep(3) nogen
gen chk = (idorigbu1~=idorigbu2) | (idorigbu2~=idorigbu3) | (idorighh1~=idorighh2) | (idorighh2~=idorighh3)
tab chk
drop if (chk==1)
drop chk idorigbu* idorighh*
save temp4, replace


/**************************************************************************************
* evaluate individual specific elasticities
**************************************************************************************/
use temp4, clear
local r1 = 0.046 // starting average rate of return to saving (slight difference with cost of debt)
local dr = 0.0075 // delta interest rate (from SimPathsMultiRun object)
local lr1 = ln(1.0 + `r1')
local lr2 = ln(1.0 + `r1' + `dr')
local lr3 = ln(1.0 + `r1' - `dr')
gen elas2 = (lrecons2 - lrecons1) / (`lr2' - `lr1')
gen elas3 = (lrecons3 - lrecons1) / (`lr3' - `lr1')

sum elas2
local elas2 = r(mean)
sum elas3
local elas3 = r(mean)

local elasAv = (`elas2' + `elas3') / 2.0
disp `elasAv'
82 changes: 82 additions & 0 deletions analysis/labour supply elasticities.do
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
/**************************************************************************************
*
* PROGRAM TO EVALUATE LABOUR SUPPLY ELASTICITIES
*
* Program analyses output from multirun config file: "config - labour supply elasticity"
*
* Review by Keane (2011) and meta analysis by Bargain and Peichl (2016) report typical
* estimates for the Marshallian labour supply elasticity between -0.12 and 0.28
*
* Last version: Justin van de Ven, 23 May 2024
* First version: Justin van de Ven, 23 May 2024
*
**************************************************************************************/

clear all

global moddir = "C:\MyFiles\99 DEV ENV\JAS-MINE\SimPaths\output\labsupply\csv"
global outdir = "C:\MyFiles\99 DEV ENV\temp\"


/**************************************************************************************
* start
**************************************************************************************/
cd "$outdir"
import delimited using "$moddir/BenefitUnit.csv"
save temp0, replace


/**************************************************************************************
* evaluate run statistics
**************************************************************************************/
forvalues ii = 1/3 {

use temp0, clear
keep if (run==`ii')
if (`ii'==1) {
sum id_benefitunit
local id0 = r(min)
}
else {
sum id_benefitunit
local id1 = r(min)
replace id_benefitunit = id_benefitunit - `id1' + `id0'
}
xtset id_benefitunit time
gen eqs = disposableincomemonthly * 12 / equivaliseddisposableincomeyearl
gen tcons = discretionaryconsumptionperyear + (childcarecostperweek + socialcarecostperweek) * 364.25/7
gen econs = tcons/eqs
gen lrecons`ii' = ln(econs / l.econs)
keep if (!missing(lrecons))
keep id_benefitunit lrecons
save temp`ii', replace
}


/**************************************************************************************
* compile statistics over runs
**************************************************************************************/
use temp1, clear
merge 1:1 id_benefitunit using temp2, keep(3) nogen
merge 1:1 id_benefitunit using temp3, keep(3) nogen
save temp4, replace


/**************************************************************************************
* evaluate individual specific elasticities
**************************************************************************************/
local r1 = 0.046 // starting average rate of return to saving (slight difference with cost of debt)
local dr = 0.005 // delta interest rate
local lr1 = ln(1.0 + `r1')
local lr2 = ln(1.0 + `r1' + `dr')
local lr2 = ln(1.0 + `r1' - `dr')
gen elas2 = (lrecons2 - lrecons1) / (`lr2' - `lr1')
gen elas3 = (lrecons3 - lrecons1) / (`lr3' - `lr1')

sum elas2
local elas2 = r(mean)
sum elas3
local elas3 = r(mean)

local elasAv = (`elas2' + `elas3') / 2.0
disp `elasAv'
62 changes: 62 additions & 0 deletions config/config - calibration.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# This file can be used to override defaults for multirun arguments.
# These will be overridden by command-line arguments

maxNumberOfRuns: 1
executeWithGui: false
randomSeed: 606
startYear: 2019
endYear: 2020
popSize: 170000

# For arguments to pass to the SimPathsModel itself:
# Current model defaults can be overridden by uncommenting/changing
model_args:
# maxAge: 130
# fixTimeTrend: true
# timeTrendStopsIn: 2017
# fixRandomSeed: true
# sIndexTimeWindow: 5
# sIndexAlpha: 2
# sIndexDelta: 0
# savingRate: 0
# initialisePotentialEarningsFromDatabase: true
# useWeights: false
# useSBAMMatching:
# projectMortality: true
# alignFertility: true
# labourMarketCovid19On: false
# projectFormalChildcare: true
# donorPoolAveraging: true
alignEmployment: false
projectSocialCare: false
enableIntertemporalOptimisations: true
responsesToLowWageOffer: true
saveImperfectTaxDBMatches: false
useSavedBehaviour: false
# readGrid: "laptop serial"
# saveBehaviour: true
# employmentOptionsOfPrincipalWorker: 3
# employmentOptionsOfSecondaryWorker: 3
# responsesToEducation: true
# responsesToRetirement: false
# responsesToHealth: true
# responsesToDisability: false
# minAgeForPoorHealth: 50
# responsesToRegion: false

innovation_args:
# randomSeedInnov: false
# intertemporalElasticityInnov: false
# labourSupplyElasticityInnov: true

collector_args:
# calculateGiniCoefficients: false
# exportToDatabase: false
# exportToCSV: true
# persistStatistics: true
# persistStatistics2: true
# persistPersons: false
# persistBenefitUnits: false
# persistHouseholds: false
# dataDumpStartTime: 0L
# dataDumpTimePeriod: 1.0
19 changes: 13 additions & 6 deletions config/config - intertemporal elasticity.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

maxNumberOfRuns: 3
executeWithGui: false
randomSeed: 12345
randomSeed: 606
startYear: 2019
endYear: 2020
popSize: 170000
Expand All @@ -23,15 +23,11 @@ model_args:
# useWeights: false
# useSBAMMatching:
# projectMortality: true
# alignFertility: true
# labourMarketCovid19On: false
# projectFormalChildcare: true
# donorPoolAveraging: true
# projectSocialCare: false
# enableIntertemporalOptimisations: false
# useSavedBehaviour: false
# readGrid: "laptop serial"
# saveBehaviour: true
# employmentOptionsOfPrincipalWorker: 3
# employmentOptionsOfSecondaryWorker: 3
# responsesToEducation: true
Expand All @@ -40,6 +36,17 @@ model_args:
# responsesToDisability: false
# minAgeForPoorHealth: 50
# responsesToRegion: false
alignPopulation: false
alignCohabitation: false
alignFertility: false
alignEducation: false
alignInSchool: false
alignEmployment: false
projectSocialCare: false
enableIntertemporalOptimisations: true
responsesToLowWageOffer: true
flagDefaultToTimeSeriesAverages: true
saveBehaviour: false

innovation_args:
randomSeedInnov: false
Expand All @@ -55,4 +62,4 @@ collector_args:
# persistBenefitUnits: false
# persistHouseholds: false
# dataDumpStartTime: 0L
# dataDumpTimePeriod: 1.0
# dataDumpTimePeriod: 1.0
65 changes: 65 additions & 0 deletions config/config - labour supply elasticity.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
# This file can be used to override defaults for multirun arguments.
# These will be overridden by command-line arguments

maxNumberOfRuns: 3
executeWithGui: false
randomSeed: 606
startYear: 2019
endYear: 2020
popSize: 170000

# For arguments to pass to the SimPathsModel itself:
# Current model defaults can be overridden by uncommenting/changing
model_args:
# maxAge: 130
# fixTimeTrend: true
# timeTrendStopsIn: 2017
# fixRandomSeed: true
# sIndexTimeWindow: 5
# sIndexAlpha: 2
# sIndexDelta: 0
# savingRate: 0
# initialisePotentialEarningsFromDatabase: true
# useWeights: false
# useSBAMMatching:
# projectMortality: true
# labourMarketCovid19On: false
# projectFormalChildcare: true
# donorPoolAveraging: true
# useSavedBehaviour: false
# readGrid: "laptop serial"
# employmentOptionsOfPrincipalWorker: 3
# employmentOptionsOfSecondaryWorker: 3
# responsesToEducation: true
# responsesToRetirement: false
# responsesToHealth: true
# responsesToDisability: false
# minAgeForPoorHealth: 50
# responsesToRegion: false
alignPopulation: false
alignCohabitation: false
alignFertility: false
alignEducation: false
alignInSchool: false
alignEmployment: false
projectSocialCare: false
enableIntertemporalOptimisations: true
responsesToLowWageOffer: true
flagDefaultToTimeSeriesAverages: true
saveBehaviour: false

innovation_args:
randomSeedInnov: false
labourSupplyElasticityInnov: true

collector_args:
# calculateGiniCoefficients: false
# exportToDatabase: false
# exportToCSV: true
# persistStatistics: true
# persistStatistics2: true
# persistPersons: false
# persistBenefitUnits: false
# persistHouseholds: false
# dataDumpStartTime: 0L
# dataDumpTimePeriod: 1.0
Loading
Loading