<jupyter_start><jupyter_text>Read in the data<jupyter_code>try:
    ts_univ = pd.read_csv('../../data/AAPL.csv', index_col='Date', usecols=['Date','Adj Close'], parse_dates=True)
    time_format = "%Y-%m-%d"
    freq= 'D' 
    
    print ( "====================================\nData: data of shape " + str(ts_univ.shape) + " has been read in." ) 
except IOError as e:
    print("Could not read in the data: {}".format(e))
ts_univ.plot()
ts_univ = ts_univ[ts_univ.index >= datetime.datetime.strptime("2007-01-01", time_format)]
ts_univ.plot()<jupyter_output><empty_output><jupyter_text>Basic Class: UVariateTimeSeriesClass<jupyter_code>uvts_cls = UVariateTimeSeriesClass(ts_df=ts_univ, time_format=time_format, freq=freq, fill_method='ffill')
plt.plot(uvts_cls.ts_df)
uvts_cls.ts_decompose(params={'model':'additive',
                              'from': '2012-01-01',
                               'to' : '2012-01-15'})
uvts_cls.plot_decompose()<jupyter_output>2019-10-25 16:50:07,750 | numexpr.utils | INFO : NumExpr defaulting to 8 threads.<jupyter_text>Use one Forecaster.  SARIMA Forecaster<jupyter_code>tsf_obj = SARIMAForecaster(ts_df=ts_univ, time_format=time_format, freq=freq, fill_method='ffill',
                           n_test=365, n_val=180,
                           hyper_params = {
                                           'order': [(1,1,1), (0,1,0)],
                                           's_order': [(0,0,0,12), (0,1,0,12)],
                                           'trend': ['linear']
                           })<jupyter_output><empty_output><jupyter_text>Prophet Forecaster<jupyter_code>tsf_obj = ProphetForecaster(ts_df=ts_univ, time_format=time_format, freq=freq, fill_method='ffill',
                            n_test=365, n_val=180,
                            hyper_params = {
                                            'prophet_interval_width': [0.95],
                                            'yearly_seasonality': [True, False],
                                            'weekly_seasonality': [True, False],
                                            'monthly_seasonality': [False],
                                            'quarterly_seasonality': [False],
                                            'daily_seasonality': [True],
                                            'weekend_seasonality': [False],
                                            'changepoint_prior_scale': [0.001],
                                            'consider_holidays': [False],
                                            'country':['US'],
                                            'diagnose':False})<jupyter_output><empty_output><jupyter_text>UVariateTimeSeriesForecaster<jupyter_code>tsf_obj = UVariateTimeSeriesForecaster(forecasters=['prophet', 'auto_arima', 'arima', 'dlm', 'exponential smoothing'],
                                       ts_df=ts_univ, time_format=time_format, freq=freq, n_test=365,
                                       trend='constant linear',
                                       seasonal_periods=7,
                                       seasonal=True,
                                       max_p=2,
                                       max_q=2,
                                       max_Q=2,
                                       max_P=2,
                                       #d=0,
                                       order = (1,0,1),
                                       #s_order = (1, 0, 2, 7),
                                       dlm_trend={'degree': 1, 'discount': 0.7, 'name': 'trend1', 'w': 5},
                                       dlm_seasonality = {'period': 7, 'discount': 0.7, 'name': 'seas1', 'w': 10},
                                       prophet_interval_width=0.95,
                                       yearly_seasonality=True,
                                       weekly_seasonality=True,
                                       monthly_seasonality=False,
                                       quarterly_seasonality=False,
                                       daily_seasonality=True,
                                       weekend_seasonality=False,
                                       changepoint_prior_scale=0.001,
                                       consider_holidays=False,
                                       country='US',
                                       diagnose=False)                                       

#UVariateTimeSeriesForecaster.__mro__ #Method Resolution Order
#einstellung - ffill oder interpolated value
tsf_obj.ts_transform(transform='log10').ts_fit(suppress=True) 
tsf_obj.ts_diagnose()
tsf_obj.plot_residuals()
tsf_obj.ts_test(show_plot=True)
tsf_obj.ts_validate(show_plot=True)
tsf_obj.ts_forecast(n_forecast = 60, suppress=False)<jupyter_output>2019-10-25 17:02:55,585 | prophet | INFO : Fitting using all data....
2019-10-25 17:02:55,587 | prophet | INFO : Trying to fit the Prophet model....
2019-10-25 17:02:55,589 | prophet | INFO : ...via using parameters

forecasters ['prophet', 'auto_arima', 'arima', 'dlm', 'exponential smoothing']
_dict_models {'prophet': <tsa.prophet.ProphetForecaster object at 0x00000206ECD1CD48>, 'arima': <tsa.arima.ARIMAForecaster object at 0x00000206ECDA5B88>, 'auto_arima': <tsa.auto_arima.AutoARIMAForecaster object at 0x00000206ECFFB488>, 'expsm': <tsa.exp_smoothing.ExponentialSmoothingForecaster object at 0x00000206ECDEA708>, 'dlm': <tsa.dlm.DLMForecaster object at 0x00000206ECD46C48>}
best_model {}
_uvtsf_logger <tsa.logger.Logger object at 0x00000206ECDE5988>
_lin_logger <tsa.logger.Logger object at 0x00000206ECDE5CC8>
_aarima_logger <tsa.logger.Logger object at 0x00000206ECDE5E88>
_aarima_seasonal True
_aarima_trend ct
_start_p 1
_start_q 1
_max_p 2
_max_q 2
_d None
_D None
_start_P 1
_start_Q 1[...]
{'fraction_non_alphanumeric': 0.11095796002756719, 'fraction_numerical': 0.046347346657477605, 'mean_word_length': 1.6195848375451263, 'pattern_counts': {'":': 0, '<': 27, '<?xml version=': 0, '>': 28, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 53, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '5', 'dir': 'jupyter-structured-clean-dedup', 'id': '261714', 'license': 'MIT', 'n_tokens_mistral': 1910, 'n_tokens_neox': 1673, 'n_words': 276, 'path': 'use-cases/stock/stock.ipynb', 'repo_name': 'makrinekaralas/time-series-analysis', 'size': '5804'}