From 9009f12241c94f403d53aa0971f6140d3fa2f020 Mon Sep 17 00:00:00 2001 From: Kaoru-Mo Date: Wed, 9 Sep 2026 17:58:01 +0900 Subject: [PATCH] FIX: point B0_idx to the zero grid point --- lectures/arellano.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lectures/arellano.md b/lectures/arellano.md index 203e6cf2..bf975916 100644 --- a/lectures/arellano.md +++ b/lectures/arellano.md @@ -365,8 +365,9 @@ class ArellanoEconomy: mc = qe.markov.tauchen(y_grid_size, ρ, η, 0, 3) self.y_grid, self.P = np.exp(mc.state_values), mc.P - # The index at which B_grid is (close to) zero - self.B0_idx = np.searchsorted(self.B_grid, 1e-10) + # 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 # Output recieved while in default, with same shape as y_grid self.def_y = np.minimum(def_y_param * np.mean(self.y_grid), self.y_grid)