Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.15.1] - 2026-01-19 12:00:00

### Added

- A new parameter `c_min` to the `Parameters` class that allows the user to specify minium consumption amounts by consumption good. See PR [#1085](https://github.com/PSLmodels/OG-Core/pull/1085)

## [0.15.0] - 2025-12-03 12:00:00

### Added
Expand Down
21 changes: 21 additions & 0 deletions docs/book/content/intro/parameters.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,14 @@ _Valid Range:_ min = 0.0 and max = 1.0
_Out-of-Range Action:_ error


#### `c_min`
_Description:_ Minimum consumption levels for each good in the composite consumption good.
_Notes:_ Enter this value in model units.
_Value Type:_ float
_Valid Range:_ min = 0.0 and max = 100.0
_Out-of-Range Action:_ error


#### `chi_b`
_Description:_ Household utility weight on bequests.
_Value Type:_ float
Expand Down Expand Up @@ -114,6 +122,7 @@ _Out-of-Range Action:_ error
#### `use_zeta`
_Description:_ Indicator variable for whether or not to use the zeta matrix to distribute bequests.
_Value Type:_ bool
_Valid Choices:_[True, False]


### Model Dimensions
Expand Down Expand Up @@ -395,6 +404,12 @@ _Valid Range:_ min = 0.0 and max = 10.0
_Out-of-Range Action:_ error


#### `baseline_theta`
_Description:_ Flag for use in reform simulations to keep Social Security system replacement rate constant between baseline and reform runs.
_Value Type:_ bool
_Valid Choices:_[True, False]


### Spending

#### `alpha_T`
Expand Down Expand Up @@ -586,21 +601,25 @@ _Out-of-Range Action:_ error
#### `constant_rates`
_Description:_ Flag to use linear tax functions.
_Value Type:_ bool
_Valid Choices:_[True, False]


#### `zero_taxes`
_Description:_ Flag to run model without any individual income taxes.
_Value Type:_ bool
_Valid Choices:_[True, False]


#### `analytical_mtrs`
_Description:_ Flag to use analytically derived marginal tax rates in tax functions.
_Value Type:_ bool
_Valid Choices:_[True, False]


#### `age_specific`
_Description:_ Flag to use analytically derived marginal tax rates in tax functions.
_Value Type:_ bool
_Valid Choices:_[True, False]


#### `tax_func_type`
Expand Down Expand Up @@ -730,6 +749,7 @@ _Out-of-Range Action:_ error
_Description:_ Use constant demographics.
_Notes:_ This boolean allows one to use empirical mortality rates, but keep the population distribution constant across periods. Note that immigration is shut off when this is true.
_Value Type:_ bool
_Valid Choices:_[True, False]


#### `omega`
Expand Down Expand Up @@ -842,6 +862,7 @@ _Out-of-Range Action:_ error
#### `reform_use_baseline_solution`
_Description:_ Whether or not the baseline SS solution is used for starting values when solving the reform.
_Value Type:_ bool
_Valid Choices:_[True, False]


#### `initial_guess_r_SS`
Expand Down
1 change: 0 additions & 1 deletion docs/make_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import os
import sys


CURDIR_PATH = os.path.abspath(os.path.dirname(__file__))
OGCORE_PATH = os.path.join(CURDIR_PATH, "..", "ogcore")
TEMPLATE_PATH = os.path.join(CURDIR_PATH, "templates")
Expand Down
1 change: 0 additions & 1 deletion docs/make_vars.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import os
import sys


CURDIR_PATH = os.path.abspath(os.path.dirname(__file__))
OGCORE_PATH = os.path.join(CURDIR_PATH, "..", "ogcore")
TEMPLATE_PATH = os.path.join(CURDIR_PATH, "templates")
Expand Down
1 change: 0 additions & 1 deletion examples/multi_industry_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
import matplotlib.pyplot as plt
import ogcore


ogcore.TPI.ENFORCE_SOLUTION_CHECKS = False

# Use a custom matplotlib style file for plots
Expand Down
29 changes: 24 additions & 5 deletions ogcore/SS.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def euler_equation_solver(guesses, *args):

Args:
guesses (Numpy array): initial guesses for b and n, length 2S
args (tuple): tuple of arguments (r, w, p_tilde, bq, TR, factor, j, p)
args (tuple): tuple of arguments (r, w, p_tilde, p_i, bq, TR, factor, j, p)
r (scalar): real interest rate
w (scalar): real wage rate
p_tilde (scalar): composite good price
Expand All @@ -54,7 +54,7 @@ def euler_equation_solver(guesses, *args):
errros (Numpy array): errors from FOCs, length 2S

"""
(r, w, p_tilde, bq, rm, tr, ubi, factor, j, p) = args
r, w, p_tilde, p_i, bq, rm, tr, ubi, factor, j, p = args

b_guess = np.array(guesses[: p.S])
n_guess = np.array(guesses[p.S :])
Expand All @@ -67,6 +67,7 @@ def euler_equation_solver(guesses, *args):
r,
w,
p_tilde,
p_i,
b_s,
b_splus1,
n_guess,
Expand All @@ -88,6 +89,7 @@ def euler_equation_solver(guesses, *args):
r,
w,
p_tilde,
p_i,
b_s,
b_splus1,
n_guess,
Expand Down Expand Up @@ -143,13 +145,15 @@ def euler_equation_solver(guesses, *args):
r,
w,
p_tilde,
p_i,
b_s,
b_splus1,
n_guess,
bq,
rm,
taxes,
p.e[-1, :, j],
p.tau_c[-1, :],
p,
)
mask6 = cons < 0
Expand All @@ -164,6 +168,7 @@ def solve_for_j(
r_p,
w,
p_tilde,
p_i,
bq_j,
rm_j,
tr_j,
Expand All @@ -180,6 +185,7 @@ def solve_for_j(
r_p (scalar): return on household investment portfolio
w (scalar): real wage rate
p_tilde (scalar): composite good price
p_i (Numpy array): prices for consumption good i
bq_j (Numpy array): bequest amounts by age, length S
rm_j (Numpy array): remittance amounts by age, length S
tr_j (Numpy array): government transfer amount by age, length S
Expand All @@ -200,6 +206,7 @@ def solve_for_j(
r_p,
w,
p_tilde,
p_i,
bq_j,
rm_j,
tr_j,
Expand Down Expand Up @@ -314,6 +321,7 @@ def inner_loop(outer_loop_vars, p, client):
r_p,
w,
p_tilde,
p_i,
bq[:, j],
rm[:, j],
tr[:, j],
Expand Down Expand Up @@ -346,6 +354,7 @@ def inner_loop(outer_loop_vars, p, client):
r_p,
w,
p_tilde,
p_i,
bq[:, j],
rm[:, j],
tr[:, j],
Expand All @@ -365,6 +374,7 @@ def inner_loop(outer_loop_vars, p, client):
r_p,
w,
p_tilde,
p_i,
bq[:, j],
rm[:, j],
tr[:, j],
Expand Down Expand Up @@ -416,16 +426,20 @@ def inner_loop(outer_loop_vars, p, client):
r_p,
w,
p_tilde,
p_i,
b_s,
b_splus1,
nssmat,
bq,
rm,
net_tax,
np.squeeze(p.e[-1, :, :]),
p.tau_c[-1, :],
p,
)
c_i = household.get_ci(c_s, p_i, p_tilde, p.tau_c[-1, :], p.alpha_c)
c_i = household.get_ci(
c_s, p_i, p_tilde, p.tau_c[-1, :], p.alpha_c, p.c_min
)
L = aggr.get_L(nssmat, p, "SS")
B = aggr.get_B(bssmat, p, "SS", False)

Expand Down Expand Up @@ -551,13 +565,15 @@ def inner_loop(outer_loop_vars, p, client):
new_r_p,
new_w,
new_p_tilde,
new_p_i,
b_s,
bssmat,
nssmat,
new_bq,
new_rm,
taxss,
np.squeeze(p.e[-1, :, :]),
p.tau_c[-1, :],
p,
)
(
Expand Down Expand Up @@ -990,13 +1006,15 @@ def SS_solver(
r_p_ss,
wss,
p_tilde_ss,
p_i_ss,
bssmat_s,
bssmat_splus1,
nssmat,
bqssmat,
rmssmat,
taxss,
np.squeeze(p.e[-1, :, :]),
p.tau_c[-1, :],
p,
)
c_i = household.get_ci(
Expand All @@ -1005,6 +1023,7 @@ def SS_solver(
p_tilde_ss,
p.tau_c[-1, :],
p.alpha_c,
p.c_min,
"SS",
)
sales_tax_ss = tax.cons_tax_liab(c_i, p_i_ss, p, "SS")
Expand All @@ -1013,7 +1032,7 @@ def SS_solver(
)
Css = aggr.get_C(cssmat, p, "SS")
c_i_ss_mat = household.get_ci(
cssmat, p_i_ss, p_tilde_ss, p.tau_c[-1, :], p.alpha_c
cssmat, p_i_ss, p_tilde_ss, p.tau_c[-1, :], p.alpha_c, p.c_min
)
C_vec_ss = np.zeros(p.I)
for i_ind in range(
Expand Down Expand Up @@ -1235,7 +1254,7 @@ def SS_fsolve(guesses, *args):
implied outer loop variables

"""
(bssmat, nssmat, TR_ss, Ig_baseline, factor_ss, p, client) = args
bssmat, nssmat, TR_ss, Ig_baseline, factor_ss, p, client = args

# Rename the inputs
r_p = guesses[0]
Expand Down
Loading
Loading