Skip to content

Commit d1ff69a

Browse files
Remove unnecesary cell and fix an import bug in statsmodels section.
1 parent f318a39 commit d1ff69a

File tree

1 file changed

+13
-15
lines changed

1 file changed

+13
-15
lines changed

climate_timeseries/climate_timeseries.ipynb

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2876,19 +2876,6 @@
28762876
"sm_model.summary()"
28772877
]
28782878
},
2879-
{
2880-
"cell_type": "code",
2881-
"execution_count": null,
2882-
"metadata": {
2883-
"collapsed": false
2884-
},
2885-
"outputs": [],
2886-
"source": [
2887-
"mean_sea_level[\"mean_global\"].plot()\n",
2888-
"sm_model.fittedvalues.plot(label=\"OLS prediction\")\n",
2889-
"plt.legend(loc=\"upper left\")"
2890-
]
2891-
},
28922879
{
28932880
"cell_type": "code",
28942881
"execution_count": null,
@@ -2899,7 +2886,7 @@
28992886
"source": [
29002887
"plt.figure(figsize=LARGE_FIGSIZE)\n",
29012888
"mean_sea_level[\"mean_global\"].plot()\n",
2902-
"pd_model.predict().plot(label=\"OLS prediction\")\n",
2889+
"sm_model.fittedvalues.plot(label=\"OLS prediction\")\n",
29032890
"plt.legend(loc=\"upper left\")"
29042891
]
29052892
},
@@ -3288,6 +3275,17 @@
32883275
"An auto-regresssive model fits existing data and build a (potentially predictive) model of the data fitted. We use the timeseries analysis (`tsa`) submodule of `statsmodels` to make out-of-sample predictions for the upcoming decades:"
32893276
]
32903277
},
3278+
{
3279+
"cell_type": "code",
3280+
"execution_count": null,
3281+
"metadata": {
3282+
"collapsed": true
3283+
},
3284+
"outputs": [],
3285+
"source": [
3286+
"from statsmodels.tsa.api import AR"
3287+
]
3288+
},
32913289
{
32923290
"cell_type": "code",
32933291
"execution_count": null,
@@ -3299,7 +3297,7 @@
32993297
"import statsmodels as sm\n",
33003298
"# Let's remove seasonal variations by resampling annually\n",
33013299
"data = giss_temp_series.resample(\"A\").mean().to_timestamp()\n",
3302-
"ar_model = sm.tsa.ar_model.AR(data, freq='A')\n",
3300+
"ar_model = AR(data, freq='A')\n",
33033301
"ar_res = ar_model.fit(maxlag=60, disp=True)"
33043302
]
33053303
},

0 commit comments

Comments
 (0)