Discrete Dynamic Programming

Author

Pablo Winant

Markov Chains

A worker’s employment dynamics is described by the stochastic matrix

\[P = \begin{bmatrix} 1-\alpha & \alpha \\ \beta & 1-\beta \end{bmatrix}\]

with \(\alpha\in(0,1)\) and \(\beta\in (0,1)\). First line corresponds to employment, second line to unemployment.

Which is the stationary equilibrium? (choose any value for \(\alpha\) and \(\beta\))

α = 0.3
β = 0.5
γ = 0.2
P = [
    (1-α) α/2 α/2;
    β/2  (1-β) β/2;
    γ/2 γ/2 (1-γ);
]
3×3 Matrix{Float64}:
 0.7   0.15  0.15
 0.25  0.5   0.25
 0.1   0.1   0.8
μ0 = [1.0, 1.0, 1.0]/3
μ0' * (P^10)
1×3 adjoint(::Vector{Float64}) with eltype Float64:
 0.323483  0.193749  0.482768
function solve_steady_state(P; T=100)
    n = size(P,1)
    μ0 = (ones(n)/n)'
    for t in 1:T
        μ1 = μ0*P
        η = maximum(abs, μ1 - μ0)
        if η<1e-10
            return μ1'
        end
        μ0 = μ1
    end
    error("No convergence")
end
solve_steady_state (generic function with 1 method)
solve_steady_state(P)
3-element Vector{Float64}:
 0.3225806452587981
 0.19354838711776282
 0.48387096762343945
# using linear algrebra

using LinearAlgebra: I
# I is the identity operator

M = P' - I

# modify last line of M

M[end,:] .= 1.0
M

# define right hand side
r = zeros(size(M,1))

r[end] = 1.0

M \ r
3-element Vector{Float64}:
 0.32258064516129037
 0.19354838709677416
 0.48387096774193555
M = P' - I

# modify last line of M

M1 = [
    M ;  # concatenate along first dimension
    ones(size(M,1))'  # ' to turn the vector a 1x3 matrix
]
M1

# # define right hand side
r = [zeros(size(M,1)) ; 1]

M1 \ r
3-element Vector{Float64}:
 0.32258064516129054
 0.19354838709677397
 0.4838709677419355

In the long run, what will the the fraction \(p\) of time spent unemployed? (Denote by \(X_m\) the fraction of dates were one is unemployed)

Illustrate this convergence by generating a simulated series of length 10000 starting at \(X_0=1\). Plot \(X_m-p\) against \(m\). (Take \(\alpha=\beta=0.1\)).

Job-Search Model

We want to solve the following model, adapted from McCall.

  • When unemployed in date, a job-seeker
    • consumes unemployment benefit \(c_t = \underline{c}\)
    • receives in every date \(t\) a job offer \(w_t\)
      • \(w_t\) is i.i.d.,
      • takes values \(w_1, w_2, w_3\) with probabilities \(p_1, p_2, p_3\)
    • if job-seeker accepts, becomes employed at rate \(w_t\) in the next period
    • else he stays unemployed
  • When employed at rate \(w\)
    • worker consumes salary \(c_t = w\)
    • with small probability \(\lambda>0\) looses his job:
      • starts next period unemployed
    • otherwise stays employed at same rate
  • Objective: \(\max E_0 \left\{ \sum \beta^t \log(c_t) \right\}\)

What are the states, the controls, the reward of this problem ? Write down the Bellman equation.

state variables: status - wage/job offer -> 6 states (2*3)

controls: accept/decline job offer, only if unemployed

reward: consumption

Define a parameter structure for the model.


m = (;
    β = 0.9, # yearly for impatient household
    λ = 0.01,
    pvec = ones(3)/3,
    wvec = [1.0, 1.1, 1.2],
    cbar = 0.9,
)
(β = 0.9, λ = 0.01, pvec = [0.3333333333333333, 0.3333333333333333, 0.3333333333333333], wvec = [1.0, 1.1, 1.2], cbar = 0.9)
# initial guesses:
x_0 = [false, false, false]
V_U_0 = [ 0.0, 0.0, 0.0]
V_E_0 = [ 0.0, 0.0, 0.0]
3-element Vector{Float64}:
 0.0
 0.0
 0.0

Define a function value_update(V_U::Vector{Float64}, V_E::Vector{Float64}, x::Vector{Bool}, p::Parameters)::Tuple{Vector, Vector}, which takes in value functions tomorrow and a policy vector and return updated values for today.

"""
Compute a value update
- V_U_0: future value (unemployed)
- V_E_0: future value (employed)
- x: policy rule
- p: model parameters
"""
function value_update(V_U_0, V_E_0, x, p)

    n = length(p.pvec)

    (;β, λ, pvec, wvec, cbar) = p
    
    V_U = zeros(n)
    V_E = zeros(n)

    # loop through all states today to update the values

    # employed

    for i=1:n
        c = wvec[i]
        V_E[i] = log(c) + β*(
            (1-λ)*V_E_0[i] # continuation value if remain employed
            + λ*sum( pvec[j] *V_U_0[j] for j=1:n)

        )
    end

    # unemployed
    for i=1:n
        c = cbar
        
        # compute continuation value
        # coditional of decision
        if x[i] # accept
            # obtain a job paid wvec[i]
            CV = V_E_0[i]
        else # reject
            CV = sum( pvec[j] *V_U_0[j] for j=1:n)
        end
        V_U[i] = log(c) + β*CV
    end
    
    return V_U, V_E

end
value_update
value_update(V_U_0, V_E_0, x_0, m)
([-0.10536051565782628, -0.10536051565782628, -0.10536051565782628], [0.0, 0.09531017980432493, 0.1823215567939546])

Define a function policy_eval(x::Vector{Bool}, p::Parameter)::Tuple{Vector, Vector} which takes in a policy vector and returns the value(s) of following this policies forever. You can add relevant arguments to the function.

using LinearAlgebra: norm
norm( [2.20,4.3]- [4.0, 4.0])
1.8248287590894656
cat([2,5], [4,3]; dims=1)
4-element Vector{Int64}:
 2
 5
 4
 3
distance(a::Tuple{Vector,Vector}, b::Tuple{Vector, Vector}) =
    norm(cat(a...; dims=1) - cat(b...; dims=1))
distance (generic function with 1 method)
function policy_eval(x, m; T=1000, τ_η=1e-10)
    V_U_0 = [ 0.0, 0.0, 0.0]
    V_E_0 = [ 0.0, 0.0, 0.0]
    for t=1:T
        V_U, V_E = value_update(V_U_0, V_E_0, x, m)
        η = distance( (V_U_0, V_E_0) , (V_U, V_E) )
        if η<τ_η
            return (V_U, V_E)
        end
        (V_U_0, V_E_0) = (V_U, V_E)
    end
    error("No convergence")
end
policy_eval (generic function with 1 method)
policy_eval([false, false, false], m)
([-1.0536051561832283, -1.0536051561832283, -1.0536051561832283], [-0.08699492083604177, 0.7874103984283376, 1.5856799120569116])
policy_eval([false, false, true], m)
([0.8455185487470496, 0.8455185487470496, 1.4785597839710176], [0.08723661113807828, 0.9616419304231203, 1.759911444070559])

Define a function bellman_step(V_E::Vector, V_U::Vector, p::Parameters)::Tuple{Vector, Vector, Vector} which returns updated values, together with improved policy rules.

# create a vector of bools: specify type as first argument
zeros(Bool, 3)
3-element Vector{Bool}:
 0
 0
 0
"""
Compute a bellman step
- V_U_0: future value (unemployed)
- V_E_0: future value (employed)
- p: model parameters
"""
function bellman_step(V_U_0, V_E_0, p)

    n = length(p.pvec)

    (;β, λ, pvec, wvec, cbar) = p
    
    V_U = zeros(n)
    V_E = zeros(n)
    x = zeros(Bool, n) # policy rule to be returned

    # loop through all states today to update the values

    # employed (same as before)
    for i=1:n
        c = wvec[i]
        V_E[i] = log(c) + β*(
            (1-λ)*V_E_0[i] # continuation value if remain employed
            + λ*sum( pvec[j] *V_U_0[j] for j=1:n)

        )
    end

    # unemployed
    for i=1:n
        c = cbar
        
        # compute both continuation values
        CV_accept = V_E_0[i]
        CV_reject = sum( pvec[j] *V_U_0[j] for j=1:n)

        if CV_accept>CV_reject
            x[i]=true
            CV = CV_accept
        else
            x[i]=false
            CV = CV_reject
        end

        V_U[i] = log(c) + β*CV
    end
    
    return V_U, V_E, x

end
bellman_step

Implement Value Function

function vfi( m; T=1000, τ_η=1e-10, verbose=false)

    V_U_0 = [ 0.0, 0.0, 0.0]
    V_E_0 = [ 0.0, 0.0, 0.0]
    for t=1:T
        V_U, V_E, x = bellman_step(V_U_0, V_E_0, m)
        η = distance( (V_U_0, V_E_0) , (V_U, V_E) )
        verbose ? (@show (t, η, x)) : nothing
        if η<τ_η
            return (V_U, V_E, x)
        end
        (V_U_0, V_E_0) = (V_U, V_E)
    end
    error("No convergence")
end
vfi (generic function with 1 method)
V_U, V_E, x = vfi(m, verbose=true)
x
(t, η, x) = (1, 0.27500490036570824, Bool[0, 0, 0])
(t, η, x) = (2, 0.2596499873325778, Bool[1, 1, 1])
(t, η, x) = (3, 0.2312411495077767, Bool[1, 1, 1])
(t, η, x) = (4, 0.21257247173623686, Bool[0, 1, 1])
(t, η, x) = (5, 0.2000045661732631, Bool[0, 1, 1])
(t, η, x) = (6, 0.18329955974592593, Bool[0, 1, 1])
(t, η, x) = (7, 0.165933767697026, Bool[0, 1, 1])
(t, η, x) = (8, 0.14956676929843465, Bool[0, 1, 1])
(t, η, x) = (9, 0.13462414354843408, Bool[0, 1, 1])
(t, η, x) = (10, 0.1211209773659084, Bool[0, 1, 1])
(t, η, x) = (11, 0.10895867656107608, Bool[0, 1, 1])
(t, η, x) = (12, 0.09801550035529336, Bool[0, 1, 1])
(t, η, x) = (13, 0.08817234792641654, Bool[0, 1, 1])
(t, η, x) = (14, 0.07931935406305367, Bool[0, 1, 1])
(t, η, x) = (15, 0.07135695293736424, Bool[0, 1, 1])
(t, η, x) = (16, 0.06419541510042484, Bool[0, 1, 1])
(t, η, x) = (17, 0.05775401843078229, Bool[0, 1, 1])
(t, η, x) = (18, 0.051960183253585736, Bool[0, 1, 1])
(t, η, x) = (19, 0.04826914042389988, Bool[0, 0, 1])
(t, η, x) = (20, 0.04496622501336198, Bool[0, 0, 1])
(t, η, x) = (21, 0.041434046418955164, Bool[0, 0, 1])
(t, η, x) = (22, 0.0378889168114726, Bool[0, 0, 1])
(t, η, x) = (23, 0.03447008395247749, Bool[0, 0, 1])
(t, η, x) = (24, 0.03125343021459979, Bool[0, 0, 1])
(t, η, x) = (25, 0.028273602399506857, Bool[0, 0, 1])
(t, η, x) = (26, 0.025540319760696446, Bool[0, 0, 1])
(t, η, x) = (27, 0.02304906763581932, Bool[0, 0, 1])
(t, η, x) = (28, 0.020787728910128707, Bool[0, 0, 1])
(t, η, x) = (29, 0.01874055541118436, Bool[0, 0, 1])
(t, η, x) = (30, 0.016890478480761202, Bool[0, 0, 1])
(t, η, x) = (31, 0.015220410644696999, Bool[0, 0, 1])
(t, η, x) = (32, 0.013713945811784284, Bool[0, 0, 1])
(t, η, x) = (33, 0.012355706571069635, Bool[0, 0, 1])
(t, η, x) = (34, 0.011131487960031286, Bool[0, 0, 1])
(t, η, x) = (35, 0.010028286500216987, Bool[0, 0, 1])
(t, η, x) = (36, 0.009034266802785355, Bool[0, 0, 1])
(t, η, x) = (37, 0.008138696254911426, Bool[0, 0, 1])
(t, η, x) = (38, 0.007331865369641202, Bool[0, 0, 1])
(t, η, x) = (39, 0.006605003753522955, Bool[0, 0, 1])
(t, η, x) = (40, 0.005950197170399437, Bool[0, 0, 1])
(t, η, x) = (41, 0.005360308571309418, Bool[0, 0, 1])
(t, η, x) = (42, 0.004828904454689299, Bool[0, 0, 1])
(t, η, x) = (43, 0.004350187064327305, Bool[0, 0, 1])
(t, η, x) = (44, 0.003918932456175788, Bool[0, 0, 1])
(t, η, x) = (45, 0.0035304342106927075, Bool[0, 0, 1])
(t, η, x) = (46, 0.0031804524412862916, Bool[0, 0, 1])
(t, η, x) = (47, 0.0028651676967738015, Bool[0, 0, 1])
(t, η, x) = (48, 0.0025811393442239094, Bool[0, 0, 1])
(t, η, x) = (49, 0.002325268029388296, Bool[0, 0, 1])
(t, η, x) = (50, 0.0020947618341572993, Bool[0, 0, 1])
(t, η, x) = (51, 0.0018871057778737572, Bool[0, 0, 1])
(t, η, x) = (52, 0.0017000343383469295, Bool[0, 0, 1])
(t, η, x) = (53, 0.0015315066970803329, Bool[0, 0, 1])
(t, η, x) = (54, 0.0013796844405454184, Bool[0, 0, 1])
(t, η, x) = (55, 0.0012429114748186575, Bool[0, 0, 1])
(t, η, x) = (56, 0.0011196959343482628, Bool[0, 0, 1])
(t, η, x) = (57, 0.0010086938870465293, Bool[0, 0, 1])
(t, η, x) = (58, 0.0009086946573640248, Bool[0, 0, 1])
(t, η, x) = (59, 0.000818607606625428, Bool[0, 0, 1])
(t, η, x) = (60, 0.0007374502258340209, Bool[0, 0, 1])
(t, η, x) = (61, 0.0006643374105312203, Bool[0, 0, 1])
(t, η, x) = (62, 0.000598471800246321, Bool[0, 0, 1])
(t, η, x) = (63, 0.0005391350767603796, Bool[0, 0, 1])
(t, η, x) = (64, 0.0004856801259216647, Bool[0, 0, 1])
(t, η, x) = (65, 0.00043752397722797757, Bool[0, 0, 1])
(t, η, x) = (66, 0.0003941414439251635, Bool[0, 0, 1])
(t, η, x) = (67, 0.0003550593940518105, Bool[0, 0, 1])
(t, η, x) = (68, 0.0003198515897752234, Bool[0, 0, 1])
(t, η, x) = (69, 0.0002881340386043938, Bool[0, 0, 1])
(t, η, x) = (70, 0.00025956080565980486, Bool[0, 0, 1])
(t, η, x) = (71, 0.00023382024124045354, Bool[0, 0, 1])
(t, η, x) = (72, 0.00021063158247207426, Bool[0, 0, 1])
(t, η, x) = (73, 0.00018974189191858223, Bool[0, 0, 1])
(t, η, x) = (74, 0.0001709232997182198, Bool[0, 0, 1])
(t, η, x) = (75, 0.0001539705191402821, Bool[0, 0, 1])
(t, η, x) = (76, 0.00013869860843500502, Bool[0, 0, 1])
(t, η, x) = (77, 0.00012494095454573505, Bool[0, 0, 1])
(t, η, x) = (78, 0.00011254745668758122, Bool[0, 0, 1])
(t, η, x) = (79, 0.0001013828899639728, Bool[0, 0, 1])
(t, η, x) = (80, 9.13254311726e-5, Bool[0, 0, 1])
(t, η, x) = (81, 8.22653307208549e-5, Bool[0, 0, 1])
(t, η, x) = (82, 7.410371616168958e-5, Bool[0, 0, 1])
(t, η, x) = (83, 6.675151430248645e-5, Bool[0, 0, 1])
(t, η, x) = (84, 6.012848013408657e-5, Bool[0, 0, 1])
(t, η, x) = (85, 5.416232199035883e-5, Bool[0, 0, 1])
(t, η, x) = (86, 4.8787913399748624e-5, Bool[0, 0, 1])
(t, η, x) = (87, 4.394658303814623e-5, Bool[0, 0, 1])
(t, η, x) = (88, 3.9585475039960664e-5, Bool[0, 0, 1])
(t, η, x) = (89, 3.565697269705209e-5, Bool[0, 0, 1])
(t, η, x) = (90, 3.2118179262872084e-5, Bool[0, 0, 1])
(t, η, x) = (91, 2.8930450203151457e-5, Bool[0, 0, 1])
(t, η, x) = (92, 2.6058971792917005e-5, Bool[0, 0, 1])
(t, η, x) = (93, 2.3472381471534264e-5, Bool[0, 0, 1])
(t, η, x) = (94, 2.1142425814319404e-5, Bool[0, 0, 1])
(t, η, x) = (95, 1.904365239525776e-5, Bool[0, 0, 1])
(t, η, x) = (96, 1.7153132184125028e-5, Bool[0, 0, 1])
(t, η, x) = (97, 1.545020944701371e-5, Bool[0, 0, 1])
(t, η, x) = (98, 1.3916276433477497e-5, Bool[0, 0, 1])
(t, η, x) = (99, 1.2534570386595864e-5, Bool[0, 0, 1])
(t, η, x) = (100, 1.1289990670132183e-5, Bool[0, 0, 1])
(t, η, x) = (101, 1.0168934015831232e-5, Bool[0, 0, 1])
(t, η, x) = (102, 9.159146097248624e-6, Bool[0, 0, 1])
(t, η, x) = (103, 8.249587812198501e-6, Bool[0, 0, 1])
(t, η, x) = (104, 7.430314815500085e-6, Bool[0, 0, 1])
(t, η, x) = (105, 6.692368993506005e-6, Bool[0, 0, 1])
(t, η, x) = (106, 6.027680688652002e-6, Bool[0, 0, 1])
(t, η, x) = (107, 5.428980618418669e-6, Bool[0, 0, 1])
(t, η, x) = (108, 4.8897205213972874e-6, Bool[0, 0, 1])
(t, η, x) = (109, 4.404001670780418e-6, Bool[0, 0, 1])
(t, η, x) = (110, 3.9665104695367205e-6, Bool[0, 0, 1])
(t, η, x) = (111, 3.572460432143546e-6, Bool[0, 0, 1])
(t, η, x) = (112, 3.217539916684733e-6, Bool[0, 0, 1])
(t, η, x) = (113, 2.8978650368439544e-6, Bool[0, 0, 1])
(t, η, x) = (114, 2.609937240949977e-6, Bool[0, 0, 1])
(t, η, x) = (115, 2.3506051003061082e-6, Bool[0, 0, 1])
(t, η, x) = (116, 2.117029880264387e-6, Bool[0, 0, 1])
(t, η, x) = (117, 1.906654526958403e-6, Bool[0, 0, 1])
(t, η, x) = (118, 1.7171757307654854e-6, Bool[0, 0, 1])
(t, η, x) = (119, 1.5465187553765922e-6, Bool[0, 0, 1])
(t, η, x) = (120, 1.3928147653363408e-6, Bool[0, 0, 1])
(t, η, x) = (121, 1.2543804015591071e-6, Bool[0, 0, 1])
(t, η, x) = (122, 1.129699380975551e-6, Bool[0, 0, 1])
(t, η, x) = (123, 1.0174059211536433e-6, Bool[0, 0, 1])
(t, η, x) = (124, 9.162698085136329e-7, Bool[0, 0, 1])
(t, η, x) = (125, 8.251829484561827e-7, Bool[0, 0, 1])
(t, η, x) = (126, 7.431472479079502e-7, Bool[0, 0, 1])
(t, η, x) = (127, 6.692637003215497e-7, Bool[0, 0, 1])
(t, η, x) = (128, 6.027225524499326e-7, Bool[0, 0, 1])
(t, η, x) = (129, 5.427944491761961e-7, Bool[0, 0, 1])
(t, η, x) = (130, 4.888224528668238e-7, Bool[0, 0, 1])
(t, η, x) = (131, 4.4021485640980003e-7, Bool[0, 0, 1])
(t, η, x) = (132, 3.964387100518362e-7, Bool[0, 0, 1])
(t, η, x) = (133, 3.5701398825459577e-7, Bool[0, 0, 1])
(t, η, x) = (134, 3.2150833779172236e-7, Bool[0, 0, 1])
(t, η, x) = (135, 2.8953234366220364e-7, Bool[0, 0, 1])
(t, η, x) = (136, 2.607352680549006e-7, Bool[0, 0, 1])
(t, η, x) = (137, 2.3480121094953553e-7, Bool[0, 0, 1])
(t, η, x) = (138, 2.1144564927556766e-7, Bool[0, 0, 1])
(t, η, x) = (139, 1.9041232429052765e-7, Bool[0, 0, 1])
(t, η, x) = (140, 1.7147043321950043e-7, Bool[0, 0, 1])
(t, η, x) = (141, 1.5441210232179287e-7, Bool[0, 0, 1])
(t, η, x) = (142, 1.3905011080212606e-7, Bool[0, 0, 1])
(t, η, x) = (143, 1.2521583799960282e-7, Bool[0, 0, 1])
(t, η, x) = (144, 1.1275741847869965e-7, Bool[0, 0, 1])
(t, η, x) = (145, 1.0153807582238871e-7, Bool[0, 0, 1])
(t, η, x) = (146, 9.143462528825427e-8, Bool[0, 0, 1])
(t, η, x) = (147, 8.233612449705905e-8, Bool[0, 0, 1])
(t, η, x) = (148, 7.414265438042643e-8, Bool[0, 0, 1])
(t, η, x) = (149, 6.676422816332097e-8, Bool[0, 0, 1])
(t, η, x) = (150, 6.011980172185705e-8, Bool[0, 0, 1])
(t, η, x) = (151, 5.413638589285243e-8, Bool[0, 0, 1])
(t, η, x) = (152, 4.874824778162693e-8, Bool[0, 0, 1])
(t, η, x) = (153, 4.389618695607678e-8, Bool[0, 0, 1])
(t, η, x) = (154, 3.9526889261623564e-8, Bool[0, 0, 1])
(t, η, x) = (155, 3.559234018637097e-8, Bool[0, 0, 1])
(t, η, x) = (156, 3.204929826080248e-8, Bool[0, 0, 1])
(t, η, x) = (157, 2.8858821912159087e-8, Bool[0, 0, 1])
(t, η, x) = (158, 2.5985840699093416e-8, Bool[0, 0, 1])
(t, η, x) = (159, 2.3398771532419787e-8, Bool[0, 0, 1])
(t, η, x) = (160, 2.106917223142925e-8, Bool[0, 0, 1])
(t, η, x) = (161, 1.8971428137335383e-8, Bool[0, 0, 1])
(t, η, x) = (162, 1.708247267934415e-8, Bool[0, 0, 1])
(t, η, x) = (163, 1.538153209183197e-8, Bool[0, 0, 1])
(t, η, x) = (164, 1.3849900142918699e-8, Bool[0, 0, 1])
(t, η, x) = (165, 1.2470730113832986e-8, Bool[0, 0, 1])
(t, η, x) = (166, 1.1228850877088958e-8, Bool[0, 0, 1])
(t, η, x) = (167, 1.0110600757932048e-8, Bool[0, 0, 1])
(t, η, x) = (168, 9.103676906658752e-9, Bool[0, 0, 1])
(t, η, x) = (169, 8.197000337120283e-9, Bool[0, 0, 1])
(t, η, x) = (170, 7.380594304750665e-9, Bool[0, 0, 1])
(t, η, x) = (171, 6.645473889018099e-9, Bool[0, 0, 1])
(t, η, x) = (172, 5.983549281132547e-9, Bool[0, 0, 1])
(t, η, x) = (173, 5.3875345175503925e-9, Bool[0, 0, 1])
(t, η, x) = (174, 4.850869329287505e-9, Bool[0, 0, 1])
(t, η, x) = (175, 4.367645701826609e-9, Bool[0, 0, 1])
(t, η, x) = (176, 3.932543592799627e-9, Bool[0, 0, 1])
(t, η, x) = (177, 3.540772747501835e-9, Bool[0, 0, 1])
(t, η, x) = (178, 3.1880190827526205e-9, Bool[0, 0, 1])
(t, η, x) = (179, 2.8703977634389727e-9, Bool[0, 0, 1])
(t, η, x) = (180, 2.5844118222183532e-9, Bool[0, 0, 1])
(t, η, x) = (181, 2.326910261586542e-9, Bool[0, 0, 1])
(t, η, x) = (182, 2.0950580260351774e-9, Bool[0, 0, 1])
(t, η, x) = (183, 1.8863005018289838e-9, Bool[0, 0, 1])
(t, η, x) = (184, 1.6983377065437415e-9, Bool[0, 0, 1])
(t, η, x) = (185, 1.529099098254415e-9, Bool[0, 0, 1])
(t, η, x) = (186, 1.3767206017526691e-9, Bool[0, 0, 1])
(t, η, x) = (187, 1.2395226239616804e-9, Bool[0, 0, 1])
(t, η, x) = (188, 1.115992963673558e-9, Bool[0, 0, 1])
(t, η, x) = (189, 1.0047706672175153e-9, Bool[0, 0, 1])
(t, η, x) = (190, 9.046300370900299e-10, Bool[0, 0, 1])
(t, η, x) = (191, 8.144672319803691e-10, Bool[0, 0, 1])
(t, η, x) = (192, 7.332883355037139e-10, Bool[0, 0, 1])
(t, η, x) = (193, 6.601979589292042e-10, Bool[0, 0, 1])
(t, η, x) = (194, 5.943914115590636e-10, Bool[0, 0, 1])
(t, η, x) = (195, 5.351423939358653e-10, Bool[0, 0, 1])
(t, η, x) = (196, 4.817975587530524e-10, Bool[0, 0, 1])
(t, η, x) = (197, 4.337686857408167e-10, Bool[0, 0, 1])
(t, η, x) = (198, 3.9052677274405823e-10, Bool[0, 0, 1])
(t, η, x) = (199, 3.5159428617136554e-10, Bool[0, 0, 1])
(t, η, x) = (200, 3.165424119374665e-10, Bool[0, 0, 1])
(t, η, x) = (201, 2.849837187990107e-10, Bool[0, 0, 1])
(t, η, x) = (202, 2.5657081540623593e-10, Bool[0, 0, 1])
(t, η, x) = (203, 2.309895029839535e-10, Bool[0, 0, 1])
(t, η, x) = (204, 2.0795842619125236e-10, Bool[0, 0, 1])
(t, η, x) = (205, 1.8722305902582607e-10, Bool[0, 0, 1])
(t, η, x) = (206, 1.685550810444115e-10, Bool[0, 0, 1])
(t, η, x) = (207, 1.517475334165748e-10, Bool[0, 0, 1])
(t, η, x) = (208, 1.3661583315929617e-10, Bool[0, 0, 1])
(t, η, x) = (209, 1.2299263762056932e-10, Bool[0, 0, 1])
(t, η, x) = (210, 1.1072737889678127e-10, Bool[0, 0, 1])
(t, η, x) = (211, 9.96850137071523e-11, Bool[0, 0, 1])
3-element Vector{Bool}:
 0
 0
 1
V_U, V_E, x = vfi(merge(m, (;cbar=0.5)))
x
3-element Vector{Bool}:
 0
 1
 1

Implement Policy Iteration and compare rates of convergence.

Discuss the Effects of the Parameters