Skip to content

BK: add spending shock #20

@floswald

Description

@floswald

Setup

  • a spending shock is a an iid shock that destroys x dollars of liquid asset.
  • very important to generate bankruptcies (cue medical spending in the US)
  • can be embedded in expectations only: tomorrow's value at asset a' is pi * V(a') + (1-pi) * V(a'-x)
  • basically we have a second amount of potential cash on hand tomorrow (right now varies with indices ia and iy, so need to add ix for different spending shock.
  • and add another loop here, for example
for iid in 1:p.nD  # future dchoice
    # only feasible choices at this state
    # if renter, cannot sell etc
    if iid == 1
        m1 = m.m1[it+1][iid][jy,:]  # state specific mvec
        c1 = interp(m.c[iid,jy,it+1].env, m1) # C(d',y',m')
        floory!(c1,p.cfloor)   # floor negative consumption
        ctmp[iid,jy,:] = gety(c1)
        # vtmp[iid,jy,:] = vfun(iid,it+1,ctmp[iid,jy,:],m1,m.v[iid,jy,it+1],p)
        vmat[iid,:] += pr * vfun(x->u(x,filer,p),it+1,ctmp[iid,jy,:],m1,m.v[iid,jy,it+1],p)
    else
        # you are a filer: no savings and analytic value function
        ctmp[iid,jy,:] .= income(it+1,p,repeat([m.yvec[jy]],p.na))
        vmat[iid,:] += pr * (u(ctmp[iid,jy,:],true,p) .+ p.beta * bound(m.vbk[jy,it+1]))
        vmat[iid,m.iazero:end] .= -Inf   # filing only with negative assets!
        ctmp[iid,jy,m.iazero:end] .= -Inf   # filing only with negative assets!
    end
end

Assumptions

  1. no spending shock while in bk state

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions