Program Flow - DoAll
setup_everything
	setup_workspace
	intialize_params_baseline
	clear_vars
	params_unemployment
	transitions
	construct_grids
		tabulate_grids
	iteration_routines			- defines solveperiods and keepsolvingperiods
function_definitions
solve_model
	construct_grids
Note: here we solve_periods and keep_solving periods, using the functions defined in iteration_routines.
Solve_periods does the following:
	-solves for the last period (uses last_period.m)
	-calls keep_solving_periods for (NumofPeriods-1) number of times
keep_solving_periods does the following:
	-Decrements the LifePosn number
	-Calculates EtVtp1 (assumes it has already been solved for all possible states)
	-Solves thecurrent period
It loops for the NumofPeriods number of times.
last_period
			findbest		- solve for optimal expenditure in all possible states for a given period of life
			make_interpolating	- set up the data (7-tuples for all states) & functions that interpolate between f(grid pts)
make_etvtp1			- construct the expectation of next periods vt
solve_period			- same as last_period but for LifePos
			findbest
			make_interpolating			
clearextradata
	find_crossings
		findbest
	files saved:
		solved_100.m			- for the first 100 periods
		solved_104.m			- for the last 4 periods with finer grids
		solved_filledin_104.m		- after filling in the grid points near the housing choice crossing points
simulation_routines
simulate_baseline
	read_post60_recessions		- read in the raw data on NBER booms and recessions
	inputs/boom400_baseline
	read_post60_recessions
simulate_highdebt
	inputs/boom400_highdebt
	read_post60_recessions
simulate_switch
	inputs/boom400
read_post60_recessions
regressions
	regressions_baseline
		setup_everything
		simulation_routines
		output/post60_baseline123456.sims
		prepare_simulated_data
		regressions_ctgrowth
		regressions_homesbought
		regressions_dtgrowth
	regressions_highdebt
		setup_everything
		simulation_routines
		output/post60_highdebt_final.sims
		prepare_simulated_data
		regressions_ctgrowth
		regressions_homesbought
		regressions_dtgrowth
figures
		setup_everything
		simulation_routines
		output/post60_baseline123456.sims
		figure_routines
		prepare_simulated_data
		figure_recession
		figure_post60
		figure_switch
		solved/solved/filledin_104
		figure_trigger
write_datasets
		setup_everything
		output/post60_baseline1234.sims
		prepare_simulated_data
		

Where Functions are Defined
setup_workspace
	AggStateProb
	MaxPos
	MaxList
	AddOutcome
	SaveModel
	SaveModelSmall
	FindRightEigenVec
	MyReg
	MyRegRange
	FirsElementGreaterThan
	Lagged
	PositionsGreaterLess
	PlotRecessions
	PlotRecovery
params_unemployment
	EmpStateProb
	CumEmpStateNext
transitions
	ExpectedJobLossRiskByAggEmpState
	AggEmpState
AnnuityIncomeByPeriod
	TransitoryIncomeByAggAggState
	AnnuityIncomeByAggAggState
	EmploymentStatusByAggState
	PermanentIncomeGrowthByAggState
iteration_routines
	SolveTill
	KeepSolvingTill
	SolvePeriods
	KeepSolvingPeriods
function_definitions
	EtVtp1Raw
	EtVtp1
	EtVtp1Interp
	VtInterp
	Vt
	ChoiceInterp
	Choicet
	CtOpt
	CtOptInterp
	ZtOpt
	ZtOptInterp
	HtOpt
	HtOptInterp
	StOpt
	StOptInterp
simulation_routines
	ClearPeriodsFromTo
	Simulate
	KeepSimulatingFromTo
	LP
	LPSeriesFromTo
	LPSeriesFrom
	MultiplyNumOfPeopleByInPeriod
	SaveSims
	SaveSimsMed
	SaveSimsSmall
MakeTimeSeriesDataFile
 
