Skip to content

[arellano] Default occurs at zero debt due to incorrect B0_idx #382

Description

@Kaoru-Mo

Lecture: Default Risk and Income Fluctuations (lectures/arellano.md)

In ArellanoEconomy.__init__:

self.B0_idx = np.searchsorted(self.B_grid, 1e-10)

With the default grid, B_grid[125] is exactly 0.0, but searchsorted returns the first index >= 1e-10, i.e. 126, where B_grid[126] = +0.0036.

This breaks two things:

  1. Default at zero debt. T_d uses v_c[B0_idx, :] as the re-entry
    continuation value, so default carries a small reward. Since h(y) = y
    for y < 0.978, default is costless at low income, and this is enough
    to make v_c(0, y) < v_d(y) there — even though h(y) <= y and
    v >= v_d imply the reverse must always hold.

  2. Positive assets while in default. simulate sets Bp_idx = B0_idx, so foreign assets sit at +0.0036 throughout every exclusion period.

Proposed fix

# The index of the grid point closest to zero
self.B0_idx = np.argmin(np.abs(self.B_grid))
self.B_grid[self.B0_idx] = 0

Selecting by distance is robust to floating-point noise; the second line also covers grids that do not contain zero (e.g. B_grid_size=250), and is a no-op with the default grid.

Note that this changes the bond price schedule and the time-series
figures, so they will need regenerating.

Happy to open a PR.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions