-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
Setup
- a spending shock is a an iid shock that destroys
xdollars 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'ispi * V(a') + (1-pi) * V(a'-x) - basically we have a second amount of potential cash on hand tomorrow (right now varies with indices
iaandiy, so need to addixfor 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
endAssumptions
- no spending shock while in bk state
Metadata
Metadata
Assignees
Labels
No labels