Skip to content

Commit 58bd8ab

Browse files
authored
Merge pull request #250 from econ-ark/May1update
Revise `calc_expectation` to `expected`
2 parents 6b7ef8e + 735fe8c commit 58bd8ab

2 files changed

Lines changed: 316 additions & 360 deletions

File tree

notebooks/LC-Model-Expected-Vs-Realized-Income-Growth.ipynb

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
"source": [
2828
"import statsmodels.api as sm\n",
2929
"from linearmodels.panel.model import PanelOLS\n",
30-
"from HARK.distributions import calc_expectation\n",
30+
"from HARK.distributions import expected\n",
3131
"from HARK.ConsumptionSaving.ConsIndShockModel import (\n",
3232
" IndShockConsumerType,\n",
3333
" init_lifecycle,\n",
@@ -188,7 +188,7 @@
188188
"outputs": [],
189189
"source": [
190190
"exp = [\n",
191-
" calc_expectation(Agent.IncShkDstn[i], func=lambda x: x[\"PermShk\"] * x[\"TranShk\"])\n",
191+
" expected(dstn=Agent.IncShkDstn[i], func=lambda x: x[\"PermShk\"] * x[\"TranShk\"])\n",
192192
" for i in range(Agent.T_cycle)\n",
193193
"]\n",
194194
"exp_df = pd.DataFrame(\n",
@@ -249,8 +249,8 @@
249249
"Dep. Variable: ExpBin R-squared: 0.1958\n",
250250
"Estimator: PanelOLS R-squared (Between): -0.0938\n",
251251
"No. Observations: 100000 R-squared (Within): 0.1958\n",
252-
"Date: Mon, Feb 02 2026 R-squared (Overall): 0.1888\n",
253-
"Time: 21:29:53 Log-likelihood -1.288e+05\n",
252+
"Date: Thu, Apr 30 2026 R-squared (Overall): 0.1888\n",
253+
"Time: 21:39:45 Log-likelihood -1.288e+05\n",
254254
"Cov. Estimator: Unadjusted \n",
255255
" F-statistic: 2.376e+04\n",
256256
"Entities: 2435 P-value 0.0000\n",
@@ -332,7 +332,7 @@
332332
"outputs": [],
333333
"source": [
334334
"exp = [\n",
335-
" calc_expectation(Agent_nt.IncShkDstn[i], func=lambda x: x[\"PermShk\"] * x[\"TranShk\"])\n",
335+
" expected(dstn=Agent_nt.IncShkDstn[i], func=lambda x: x[\"PermShk\"] * x[\"TranShk\"])\n",
336336
" for i in range(Agent_nt.T_cycle)\n",
337337
"]\n",
338338
"exp_df = pd.DataFrame(\n",
@@ -381,8 +381,8 @@
381381
"Dep. Variable: ExpBin R-squared: 0.0084\n",
382382
"Estimator: PanelOLS R-squared (Between): -0.0257\n",
383383
"No. Observations: 100000 R-squared (Within): 0.0084\n",
384-
"Date: Mon, Feb 02 2026 R-squared (Overall): 0.0088\n",
385-
"Time: 21:29:58 Log-likelihood -1.393e+05\n",
384+
"Date: Thu, Apr 30 2026 R-squared (Overall): 0.0088\n",
385+
"Time: 21:39:49 Log-likelihood -1.393e+05\n",
386386
"Cov. Estimator: Unadjusted \n",
387387
" F-statistic: 826.23\n",
388388
"Entities: 2435 P-value 0.0000\n",

0 commit comments

Comments
 (0)