Skip to content

Commit 4585b7a

Browse files
committed
iloc[0], etc
1 parent 3f2dea0 commit 4585b7a

7 files changed

Lines changed: 485 additions & 1129 deletions

11b_Money_Inflation.ipynb

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -111,9 +111,7 @@
111111
},
112112
{
113113
"cell_type": "markdown",
114-
"metadata": {
115-
"jp-MarkdownHeadingCollapsed": true
116-
},
114+
"metadata": {},
117115
"source": [
118116
"## 日本の時系列データ"
119117
]
@@ -1384,8 +1382,7 @@
13841382
{
13851383
"cell_type": "markdown",
13861384
"metadata": {
1387-
"heading_collapsed": true,
1388-
"jp-MarkdownHeadingCollapsed": true
1385+
"heading_collapsed": true
13891386
},
13901387
"source": [
13911388
"### 散布図とトレンド線"
@@ -1460,8 +1457,8 @@
14601457
" df.sort_values('トレンド').plot(x='money_growth', y='トレンド', #5\n",
14611458
" color='r', ax=ax_) #6\n",
14621459
" ax_.set_title(f'{t}\\n' #7\n",
1463-
" f'スロープ係数:{res.params[1]:.3f}\\n' #8\n",
1464-
" f'p値:{res.pvalues[1]:.3f}\\n' #9\n",
1460+
" f'スロープ係数:{res.params.iloc[1]:.3f}\\n' #8\n",
1461+
" f'p値:{res.pvalues.iloc[1]:.3f}\\n' #9\n",
14651462
" f'調整済み決定係数:{res.rsquared_adj:.3f}', #10\n",
14661463
" size=18, loc='left') #11"
14671464
]
@@ -3744,7 +3741,7 @@
37443741
"name": "python",
37453742
"nbconvert_exporter": "python",
37463743
"pygments_lexer": "ipython3",
3747-
"version": "3.11.9"
3744+
"version": "3.13.11"
37483745
}
37493746
},
37503747
"nbformat": 4,

15_RBC.ipynb

Lines changed: 75 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
},
2020
{
2121
"cell_type": "code",
22-
"execution_count": null,
22+
"execution_count": 1,
2323
"metadata": {},
2424
"outputs": [],
2525
"source": [
@@ -270,8 +270,7 @@
270270
{
271271
"cell_type": "markdown",
272272
"metadata": {
273-
"heading_collapsed": true,
274-
"jp-MarkdownHeadingCollapsed": true
273+
"heading_collapsed": true
275274
},
276275
"source": [
277276
"### 実質利子率"
@@ -404,8 +403,7 @@
404403
{
405404
"cell_type": "markdown",
406405
"metadata": {
407-
"heading_collapsed": true,
408-
"jp-MarkdownHeadingCollapsed": true
406+
"heading_collapsed": true
409407
},
410408
"source": [
411409
"### シミュレーション"
@@ -443,11 +441,29 @@
443441
},
444442
{
445443
"cell_type": "code",
446-
"execution_count": null,
447-
"metadata": {
448-
"hidden": true
449-
},
450-
"outputs": [],
444+
"execution_count": 2,
445+
"metadata": {
446+
"hidden": true
447+
},
448+
"outputs": [
449+
{
450+
"data": {
451+
"text/plain": [
452+
"alpha 0.360000\n",
453+
"beta 0.990000\n",
454+
"d 0.025000\n",
455+
"rho 0.551000\n",
456+
"sigma 0.000061\n",
457+
"theta 1.000000\n",
458+
"L 0.330000\n",
459+
"dtype: float64"
460+
]
461+
},
462+
"execution_count": 2,
463+
"metadata": {},
464+
"output_type": "execute_result"
465+
}
466+
],
451467
"source": [
452468
"parameters = pd.Series({'alpha':.36,\n",
453469
" 'beta':0.99,\n",
@@ -497,7 +513,7 @@
497513
},
498514
{
499515
"cell_type": "code",
500-
"execution_count": null,
516+
"execution_count": 3,
501517
"metadata": {
502518
"hidden": true
503519
},
@@ -519,7 +535,7 @@
519535
},
520536
{
521537
"cell_type": "code",
522-
"execution_count": null,
538+
"execution_count": 4,
523539
"metadata": {
524540
"hidden": true
525541
},
@@ -570,7 +586,7 @@
570586
},
571587
{
572588
"cell_type": "code",
573-
"execution_count": null,
589+
"execution_count": 5,
574590
"metadata": {
575591
"hidden": true
576592
},
@@ -621,7 +637,7 @@
621637
},
622638
{
623639
"cell_type": "code",
624-
"execution_count": null,
640+
"execution_count": 6,
625641
"metadata": {
626642
"hidden": true
627643
},
@@ -647,7 +663,7 @@
647663
},
648664
{
649665
"cell_type": "code",
650-
"execution_count": null,
666+
"execution_count": 7,
651667
"metadata": {
652668
"hidden": true
653669
},
@@ -658,11 +674,29 @@
658674
},
659675
{
660676
"cell_type": "code",
661-
"execution_count": null,
662-
"metadata": {
663-
"hidden": true
664-
},
665-
"outputs": [],
677+
"execution_count": 8,
678+
"metadata": {
679+
"hidden": true
680+
},
681+
"outputs": [
682+
{
683+
"data": {
684+
"text/plain": [
685+
"a 1.000000\n",
686+
"k 12.536454\n",
687+
"y 1.222339\n",
688+
"c 0.908928\n",
689+
"i 0.313411\n",
690+
"r 0.010101\n",
691+
"w 2.370598\n",
692+
"dtype: float64"
693+
]
694+
},
695+
"execution_count": 8,
696+
"metadata": {},
697+
"output_type": "execute_result"
698+
}
699+
],
666700
"source": [
667701
"rbc_basic_model.ss"
668702
]
@@ -679,11 +713,26 @@
679713
},
680714
{
681715
"cell_type": "code",
682-
"execution_count": null,
683-
"metadata": {
684-
"hidden": true
685-
},
686-
"outputs": [],
716+
"execution_count": 9,
717+
"metadata": {
718+
"hidden": true
719+
},
720+
"outputs": [
721+
{
722+
"ename": "AttributeError",
723+
"evalue": "'Series' object has no attribute 'ravel'",
724+
"output_type": "error",
725+
"traceback": [
726+
"\u001b[31m---------------------------------------------------------------------------\u001b[39m",
727+
"\u001b[31mAttributeError\u001b[39m Traceback (most recent call last)",
728+
"\u001b[32m/var/folders/_f/g_05tt3j09n5hcrk1mwhyj5r0000gn/T/ipykernel_42398/3130218754.py\u001b[39m in \u001b[36m?\u001b[39m\u001b[34m()\u001b[39m\n\u001b[32m----> \u001b[39m\u001b[32m1\u001b[39m rbc_basic_model.approximate_and_solve(log_linear=\u001b[38;5;28;01mTrue\u001b[39;00m)\n",
729+
"\u001b[32m~/miniforge3/envs/jb1/lib/python3.11/site-packages/linearsolve/__init__.py\u001b[39m in \u001b[36m?\u001b[39m\u001b[34m(self, log_linear, eigenvalue_warnings)\u001b[39m\n\u001b[32m 264\u001b[39m self.log_linear = log_linear\n\u001b[32m 265\u001b[39m \n\u001b[32m 266\u001b[39m \u001b[38;5;66;03m# Approximate\u001b[39;00m\n\u001b[32m 267\u001b[39m \u001b[38;5;28;01mif\u001b[39;00m log_linear == \u001b[38;5;28;01mTrue\u001b[39;00m:\n\u001b[32m--> \u001b[39m\u001b[32m268\u001b[39m self.log_linear_approximation()\n\u001b[32m 269\u001b[39m \u001b[38;5;28;01melse\u001b[39;00m:\n\u001b[32m 270\u001b[39m self.linear_approximation()\n\u001b[32m 271\u001b[39m \n",
730+
"\u001b[32m~/miniforge3/envs/jb1/lib/python3.11/site-packages/linearsolve/__init__.py\u001b[39m in \u001b[36m?\u001b[39m\u001b[34m(self, steady_state)\u001b[39m\n\u001b[32m 698\u001b[39m \n\u001b[32m 699\u001b[39m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;28;01mnot\u001b[39;00m np.iscomplexobj(self.parameters):\n\u001b[32m 700\u001b[39m \n\u001b[32m 701\u001b[39m \u001b[38;5;66;03m# Assign attributes\u001b[39;00m\n\u001b[32m--> \u001b[39m\u001b[32m702\u001b[39m self.a= approx_fprime_cs(np.log(self.ss).ravel(),log_equilibrium_fwd)\n\u001b[32m 703\u001b[39m self.b= -approx_fprime_cs(np.log(self.ss).ravel(),log_equilibrium_cur)\n\u001b[32m 704\u001b[39m \n\u001b[32m 705\u001b[39m \u001b[38;5;28;01melse\u001b[39;00m:\n",
731+
"\u001b[32m~/miniforge3/envs/jb1/lib/python3.11/site-packages/pandas/core/generic.py\u001b[39m in \u001b[36m?\u001b[39m\u001b[34m(self, name)\u001b[39m\n\u001b[32m 6202\u001b[39m \u001b[38;5;28;01mand\u001b[39;00m name \u001b[38;5;28;01mnot\u001b[39;00m \u001b[38;5;28;01min\u001b[39;00m self._accessors\n\u001b[32m 6203\u001b[39m \u001b[38;5;28;01mand\u001b[39;00m self._info_axis._can_hold_identifiers_and_holds_name(name)\n\u001b[32m 6204\u001b[39m ):\n\u001b[32m 6205\u001b[39m \u001b[38;5;28;01mreturn\u001b[39;00m self[name]\n\u001b[32m-> \u001b[39m\u001b[32m6206\u001b[39m \u001b[38;5;28;01mreturn\u001b[39;00m object.__getattribute__(self, name)\n",
732+
"\u001b[31mAttributeError\u001b[39m: 'Series' object has no attribute 'ravel'"
733+
]
734+
}
735+
],
687736
"source": [
688737
"rbc_basic_model.approximate_and_solve(log_linear=True)"
689738
]
@@ -2261,7 +2310,7 @@
22612310
"name": "python",
22622311
"nbconvert_exporter": "python",
22632312
"pygments_lexer": "ipython3",
2264-
"version": "3.11.9"
2313+
"version": "3.13.11"
22652314
}
22662315
},
22672316
"nbformat": 4,

5a_Development_Accounting.ipynb

Lines changed: 238 additions & 937 deletions
Large diffs are not rendered by default.

6_Regression.ipynb

Lines changed: 64 additions & 63 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)