<s> from __future__ import print_function <EOL> import pandas as pd <EOL> import matplotlib . pyplot as plt <EOL> import statsmodels . api as sm <EOL> dta = sm . datasets . macrodata . load_pandas ( ) . data <EOL> index = pd . Index ( sm . tsa . datetools . dates_from_range ( '<STR_LIT>' , '<STR_LIT>' ) ) <EOL> print ( index ) <EOL> dta . index = index <EOL> del dta [ '<STR_LIT>' ] <EOL> del dta [ '<STR_LIT>' ] <EOL> print ( sm . datasets . macrodata . NOTE ) <EOL> print ( dta . head ( <NUM_LIT:10> ) ) <EOL> fig = plt . figure ( figsize = ( <NUM_LIT:12> , <NUM_LIT:8> ) ) <EOL> ax = fig . add_subplot ( <NUM_LIT> ) <EOL> dta . realgdp . plot ( ax = ax ) ; <EOL> legend = ax . legend ( loc = '<STR_LIT>' ) ; <EOL> legend . prop . set_size ( <NUM_LIT:20> ) ; <EOL> gdp_cycle , gdp_trend = sm . tsa . filters . hpfilter ( dta . realgdp ) <EOL> gdp_decomp = dta [ [ '<STR_LIT>' ] ] <EOL> gdp_decomp [ "<STR_LIT>" ] = gdp_cycle <EOL> gdp_decomp [ "<STR_LIT>" ] = gdp_trend <EOL> fig = plt . figure ( figsize = ( <NUM_LIT:12> , <NUM_LIT:8> ) ) <EOL> ax = fig . add_subplot ( <NUM_LIT> ) <EOL> gdp_decomp [ [ "<STR_LIT>" , "<STR_LIT>" ] ] [ "<STR_LIT>" : ] . plot ( ax = ax , fontsize = <NUM_LIT:16> ) ; <EOL> legend = ax . get_legend ( ) <EOL> legend . prop . set_size ( <NUM_LIT:20> ) ; <EOL> bk_cycles = sm . tsa . filters . bkfilter ( dta [ [ "<STR_LIT>" , "<STR_LIT>" ] ] ) <EOL> fig = plt . figure ( figsize = ( <NUM_LIT> , <NUM_LIT:10> ) ) <EOL> ax = fig . add_subplot ( <NUM_LIT> ) <EOL> bk_cycles . plot ( ax = ax , style = [ '<STR_LIT>' , '<STR_LIT>' ] ) ; <EOL> print ( sm . tsa . stattools . adfuller ( dta [ '<STR_LIT>' ] ) [ : <NUM_LIT:3> ] ) <EOL> print ( sm . tsa . stattools . adfuller ( dta [ '<STR_LIT>' ] ) [ : <NUM_LIT:3> ] ) <EOL> cf_cycles , cf_trend = sm . tsa . filters . cffilter ( dta [ [ "<STR_LIT>" , "<STR_LIT>" ] ] ) <EOL> print ( cf_cycles . head ( <NUM_LIT:10> ) ) <EOL> fig = plt . figure ( figsize = ( <NUM_LIT> , <NUM_LIT:10> ) ) <EOL> ax = fig . add_subplot ( <NUM_LIT> ) <EOL> cf_cycles . plot ( ax = ax , style = [ '<STR_LIT>' , '<STR_LIT>' ] ) ; </s>
