Skip to content

Commit d5623e1

Browse files
committed
df corrected
1 parent ff79de1 commit d5623e1

File tree

1 file changed

+31
-3
lines changed

1 file changed

+31
-3
lines changed

13b_Stochastic_Solow.ipynb

Lines changed: 31 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -124,13 +124,41 @@
124124
"\n",
125125
"ここでは1と2のみを考慮したデータを使いTFPの変動を考えることにする。これにより資本ストックの稼働率はTFPの一部となってしまうが,RBCモデルの基本的なアイデアは変わらない。\n",
126126
"\n",
127-
"上で読み込んだデータ`df`には次の変数が含まれている(詳細は`GDP:水準・トレンド・変動`を参照)。\n",
128-
"* 期間:1980年Q1〜2021年Q4\n",
127+
"データを読み込もう。"
128+
]
129+
},
130+
{
131+
"cell_type": "code",
132+
"execution_count": null,
133+
"metadata": {},
134+
"outputs": [],
135+
"source": [
136+
"df = py4macro.data('jpn-q')"
137+
]
138+
},
139+
{
140+
"cell_type": "markdown",
141+
"metadata": {},
142+
"source": [
143+
"ここで読み込んだデータ`df`には次の変数が含まれている(詳細は`GDP:水準・トレンド・変動`を参照)。\n",
144+
"* 期間:1980年Q1〜\n",
129145
"* `gdp`:国内総生産(支出側)\n",
130146
"* `capital`:資本ストック\n",
131147
"* `employed`:就業者\n",
132148
"* `hours`:労働者1人あたり月平均就業時間(以下では「平均労働時間」と呼ぶ)\n",
133-
"* `total_hours`:総労働時間(`hours`$\\times$`employed`)"
149+
"* `total_hours`:総労働時間(`hours`$\\times$`employed`)\n",
150+
"\n",
151+
"まず`gdp`のトレンドからの乖離(%)を`gdp_cycle`として作成しておく。"
152+
]
153+
},
154+
{
155+
"cell_type": "code",
156+
"execution_count": null,
157+
"metadata": {},
158+
"outputs": [],
159+
"source": [
160+
"df['gdp_trend_log'] = py4macro.trend( np.log(df['gdp']) )\n",
161+
"df['gdp_cycle'] = 100 * ( np.log( df['gdp'] ) - df['gdp_trend_log'] )"
134162
]
135163
},
136164
{

0 commit comments

Comments
 (0)