Master_Thesis_Paulogcd_2025.Bellman_FOC_1 — Method

The Bellman_FOC_1 function is not to be used alone, but with the backwards function.

function Bellman_FOC_1(;s_range::AbstractRange,
            sprime_range::AbstractRange,
            consumption_range::AbstractRange,
            labor_range::AbstractRange,
            value_function_nextperiod::Any,
            β = 0.96::Float64, 
            z = 1::Float64,
            ρ = 1.5::Float64,
            φ = 2::Float64,
            proba_survival = 0.9::Float64,
            r = ((1-0.9)/0.9)::Float64,
            w = 0.0::Float64,
            h = 2.00::Float64,
            return_full_grid = true::Bool, 
            return_budget_balance = true::Bool)::NamedTuple
source
Master_Thesis_Paulogcd_2025.Bellman_FOC_1_interpolated — Method

The Bellman_FOC_1_interpolated function is not to be used alone, but with the backwards function.

function Bellman_FOC_1_interpolated(;s_range::AbstractRange,
            sprime_range::AbstractRange,
            consumption_range::AbstractRange,
            labor_range::AbstractRange,
            value_function_nextperiod::Any,
            β = 0.96::Float64, 
            z = 1::Float64,
            ρ = 1.5::Float64,
            φ = 2::Float64,
            proba_survival = 0.9::Float64,
            r = ((1-0.9)/0.9)::Float64,
            w = 0.0::Float64,
            h = 2.00::Float64,
            return_full_grid = true::Bool, 
            return_budget_balance = true::Bool)::NamedTuple
source
Master_Thesis_Paulogcd_2025.Bellman_FOC_2 — Method

The Bellman_FOC_2 function is not to be used alone, but with the backwards function.

function Bellman_FOC_2(;s_range::AbstractRange,
            sprime_range::AbstractRange,
            consumption_range::AbstractRange,
            labor_range::AbstractRange,
            value_function_nextperiod::Any,
            β = 0.96::Float64, 
            z = 1::Float64,
            ρ = 1.5::Float64,
            φ = 2::Float64,
            proba_survival = 0.9::Float64,
            r = ((1-0.9)/0.9)::Float64,
            w = 0.0::Float64,
            h = 2.00::Float64,
            return_full_grid = true::Bool, 
            return_budget_balance = true::Bool)::NamedTuple
source
Master_Thesis_Paulogcd_2025.Bellman_FOC_2_interpolated — Method

The Bellman_FOC_2 function is not to be used alone, but with the backwards function.

function Bellman_FOC_2_interpolated(;s_range::AbstractRange,
            sprime_range::AbstractRange,
            consumption_range::AbstractRange,
            labor_range::AbstractRange,
            value_function_nextperiod::Any,
            β = 0.96::Float64, 
            z = 1::Float64,
            ρ = 1.5::Float64,
            φ = 2::Float64,
            proba_survival = 0.9::Float64,
            r = ((1-0.9)/0.9)::Float64,
            w = 0.0::Float64,
            h = 2.00::Float64,
            return_full_grid = true::Bool, 
            return_budget_balance = true::Bool)::NamedTuple
source
Master_Thesis_Paulogcd_2025.Bellman_numerical — Method

The Bellman_numerical function is not to be used alone, but with the backwards function.

	function Bellman_numerical(;s_range::AbstractRange,
				sprime_range::AbstractRange,
				consumption_range::AbstractRange,
				labor_range::AbstractRange,
				value_function_nextperiod::Any,
				β = 0.96::Float64, 
				z = 1::Float64,
				ρ = 1.5::Float64,
				φ = 2::Float64,
				proba_survival = 0.9::Float64,
				r = ((1-0.9)/0.9)::Float64,
				w = 0.0::Float64,
				h = 2.00::Float64,
				return_full_grid = true::Bool, 
				return_budget_balance = true::Bool)::NamedTuple
source
Master_Thesis_Paulogcd_2025.Bellman_numerical_interpolated — Method

The Bellman_numerical function is not to be used alone, but with the backwards function.

	function Bellman_numerical_interpolated(;s_range::AbstractRange,
				sprime_range::AbstractRange,
				consumption_range::AbstractRange,
				labor_range::AbstractRange,
				value_function_nextperiod::Any,
				β = 0.96::Float64, 
				z = 1::Float64,
				ρ = 1.5::Float64,
				φ = 2::Float64,
				proba_survival = 0.9::Float64,
				r = ((1-0.9)/0.9)::Float64,
				w = 0.0::Float64,
				h = 2.00::Float64,
				return_full_grid = true::Bool, 
				return_budget_balance = true::Bool)::NamedTuple
source
Master_Thesis_Paulogcd_2025.HP — Method

The HP function is not to be used alone. It returns the estimated Health Proxy value for a combination of age and temperature values.

source
Master_Thesis_Paulogcd_2025.average_health_plot — Method

The average_health_plot function generates a plot of the average health over time for the three different temperature scenarios. It takes N and T as arguments, with N the size of the population, and T the number of periods.

source
Master_Thesis_Paulogcd_2025.backwards_FOC_1 — Method
function backwards_FOC_1(;s_range::AbstractRange,
        sprime_range::AbstractRange,
        consumption_range::AbstractRange,
        labor_range::AbstractRange,
        nperiods::Integer,
        z = ones(nperiods)::Array,
        β = 0.9::Float64,
        r = final_r::Array,
        ρ = 1.50::Float64, 
        φ = 2.00::Float64,
        proba_survival = 0.90::Float64,
        w = 0.00::Float64,
        h = "good"::AbstractString, 
        return_full_grid = false::Bool, 
        return_budget_balance = true::Bool)::NamedTuple
source
Master_Thesis_Paulogcd_2025.backwards_FOC_1_interpolated — Method
function backwards_FOC_1_interpolated(;s_range::AbstractRange,
        sprime_range::AbstractRange,
        consumption_range::AbstractRange,
        labor_range::AbstractRange,
        nperiods::Integer,
        z = ones(nperiods)::Array,
        β = 0.9::Float64,
        r = final_r::Array,
        ρ = 1.50::Float64, 
        φ = 2.00::Float64,
        proba_survival = 0.90::Float64,
        w = 0.00::Float64,
        h = "good"::AbstractString, 
        return_full_grid = false::Bool, 
        return_budget_balance = true::Bool)::NamedTuple
source
Master_Thesis_Paulogcd_2025.backwards_FOC_2 — Method

function backwardsFOC2(;srange::AbstractRange, sprimerange::AbstractRange, consumptionrange::AbstractRange, laborrange::AbstractRange, nperiods::Integer, z = ones(nperiods)::Array, β = 0.9::Float64, r = finalr::Array, ρ = 1.50::Float64, φ = 2.00::Float64, probasurvival = 0.90::Float64, w = 0.00::Float64, h = "good"::AbstractString, returnfullgrid = false::Bool, returnbudgetbalance = true::Bool)::NamedTuple

source
Master_Thesis_Paulogcd_2025.backwards_FOC_2_interpolated — Method

function backwardsFOC2(;srange::AbstractRange, sprimerange::AbstractRange, consumptionrange::AbstractRange, laborrange::AbstractRange, nperiods::Integer, z = ones(nperiods)::Array, β = 0.9::Float64, r = finalr::Array, ρ = 1.50::Float64, φ = 2.00::Float64, probasurvival = 0.90::Float64, w = 0.00::Float64, h = "good"::AbstractString, returnfullgrid = false::Bool, returnbudgetbalance = true::Bool)::NamedTuple

source
Master_Thesis_Paulogcd_2025.backwards_numerical — Method
function backwards(;s_range::AbstractRange,
		sprime_range::AbstractRange,
		consumption_range::AbstractRange,
		labor_range::AbstractRange,
		nperiods::Integer,
		z = ones(nperiods)::Array,
		β = 0.9::Float64,
		r = final_r::Array,
		ρ = 1.50::Float64, 
		φ = 2.00::Float64,
		proba_survival = 0.90::Float64,
		w = 0.00::Float64,
		h = "good"::AbstractString, 
		return_full_grid = false::Bool, 
		return_budget_balance = true::Bool)::NamedTuple
source
Master_Thesis_Paulogcd_2025.backwards_numerical_interpolated — Method
function backwards(;s_range::AbstractRange,
		sprime_range::AbstractRange,
		consumption_range::AbstractRange,
		labor_range::AbstractRange,
		nperiods::Integer,
		z = ones(nperiods)::Array,
		β = 0.9::Float64,
		r = final_r::Array,
		ρ = 1.50::Float64, 
		φ = 2.00::Float64,
		proba_survival = 0.90::Float64,
		w = 0.00::Float64,
		h = "good"::AbstractString, 
		return_full_grid = false::Bool, 
		return_budget_balance = true::Bool)::NamedTuple
source
Master_Thesis_Paulogcd_2025.budget_surplus — Method

The budget_surplus function computes the budget states for certain levels of consumption, labor supply, productivity, and savings.

Its syntax is:

budget_surplus(;c::Float64,
	l::Float64,
	sprime::Float64,
	s::Float64,
	z::Float64,
	r::Float64)::Float64
source
Master_Thesis_Paulogcd_2025.extra_health_survival — Method

The extra_health_survival function generates an extra plot, of the logistic regression explaining living status with age and health. It is not directly used in my master thesis, but is useful for two reasons. First, I confirm that results are similar to articles studying this same relationship. Second, it allows to see the link between health state and survival without the effect of temperature.

source
Master_Thesis_Paulogcd_2025.health — Method

The health function is not to be used alone. It returns the estimated health transition probabilities for a combination of age, temperature, and previous health state values.

source
Master_Thesis_Paulogcd_2025.produce_graph — Method

This function is not to be used alone. The produce_graph function generates a plot of demographic evolution with three different populations with three different temperature paths.

source
Master_Thesis_Paulogcd_2025.utility — Method

The utility function is defined such that its syntax is:

utility(;c,l,z,w,h,ρ=1.5,φ=2)

It returns:

(abs(c)^(1-ρ))/(1-ρ) - ξ(w,h) *((abs(l)^(1+φ)/(1+φ)))
source
Master_Thesis_Paulogcd_2025.ξ — Method

The ξ function returns the disutility of work in the utility function.

Its syntax is:

ξ(w,h)

For now, it returns 1.

# (1+abs(w))*(1+1(h=="bad"))
source