├── .github └── workflows │ └── lint.yml ├── .gitignore ├── 01-Analysis&transforms.ipynb ├── 02-Forecasting_models.ipynb ├── 03-Results_analysis&discussion.ipynb ├── README.md ├── datasets ├── .gitignore ├── air_pollution.csv ├── download_datasets.py ├── international_airline_passengers.csv ├── test.csv └── training.csv ├── docs ├── setup.md └── stationary_vs_not.png ├── environment.yml ├── requirements.txt ├── results ├── beijing.jpg ├── metrics.png ├── pollution.png ├── predictions.pickle ├── results_summary.csv ├── results_summary.html └── scores.pickle ├── time-series-forecasting-tutorial.ipynb └── utils ├── __pycache__ └── metrics.cpython-36.pyc ├── metrics.py └── plots.py /.github/workflows/lint.yml: -------------------------------------------------------------------------------- 1 | name: Lint 2 | 3 | on: push 4 | 5 | jobs: 6 | run-linters: 7 | name: Run linters 8 | runs-on: ubuntu-latest 9 | 10 | steps: 11 | - name: Check out Git repository 12 | uses: actions/checkout@v2 13 | 14 | - name: Set up Python 15 | uses: actions/setup-python@v1 16 | with: 17 | python-version: 3.6 18 | 19 | - name: Install Python dependencies 20 | run: pip install black flake8 21 | 22 | - name: Run linters 23 | uses: samuelmeuli/lint-action@v1 24 | with: 25 | github_token: ${{ secrets.github_token }} 26 | # Enable linters 27 | black: true 28 | flake8: true 29 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | jaimeignore/ 2 | .ipynb_checkpoints 3 | */.ipynb_checkpoints/* 4 | .DS_Store 5 | # Byte-compiled / optimized / DLL files 6 | __pycache__/ 7 | *.py[cod] 8 | *$py.class 9 | 10 | # C extensions 11 | *.so 12 | 13 | # Distribution / packaging 14 | .Python 15 | build/ 16 | develop-eggs/ 17 | dist/ 18 | downloads/ 19 | eggs/ 20 | .eggs/ 21 | lib/ 22 | lib64/ 23 | parts/ 24 | sdist/ 25 | var/ 26 | wheels/ 27 | pip-wheel-metadata/ 28 | share/python-wheels/ 29 | *.egg-info/ 30 | .installed.cfg 31 | *.egg 32 | MANIFEST 33 | 34 | # PyInstaller 35 | # Usually these files are written by a python script from a template 36 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 37 | *.manifest 38 | *.spec 39 | 40 | # Installer logs 41 | pip-log.txt 42 | pip-delete-this-directory.txt 43 | 44 | # Unit test / coverage reports 45 | htmlcov/ 46 | .tox/ 47 | .nox/ 48 | .coverage 49 | .coverage.* 50 | .cache 51 | nosetests.xml 52 | coverage.xml 53 | *.cover 54 | *.py,cover 55 | .hypothesis/ 56 | .pytest_cache/ 57 | 58 | # Translations 59 | *.mo 60 | *.pot 61 | 62 | # Django stuff: 63 | *.log 64 | local_settings.py 65 | db.sqlite3 66 | db.sqlite3-journal 67 | 68 | # Flask stuff: 69 | instance/ 70 | .webassets-cache 71 | 72 | # Scrapy stuff: 73 | .scrapy 74 | 75 | # Sphinx documentation 76 | docs/_build/ 77 | 78 | # PyBuilder 79 | target/ 80 | 81 | # Jupyter Notebook 82 | .ipynb_checkpoints 83 | 84 | # IPython 85 | profile_default/ 86 | ipython_config.py 87 | 88 | # pyenv 89 | # For a library or package, you might want to ignore these files since the code is 90 | # intended to run in multiple environments; otherwise, check them in: 91 | # .python-version 92 | 93 | # pipenv 94 | # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. 95 | # However, in case of collaboration, if having platform-specific dependencies or dependencies 96 | # having no cross-platform support, pipenv may install dependencies that don't work, or not 97 | # install all needed dependencies. 98 | #Pipfile.lock 99 | 100 | # PEP 582; used by e.g. github.com/David-OConnor/pyflow 101 | __pypackages__/ 102 | 103 | # Celery stuff 104 | celerybeat-schedule 105 | celerybeat.pid 106 | 107 | # SageMath parsed files 108 | *.sage.py 109 | 110 | # Environments 111 | .env 112 | .venv 113 | env/ 114 | venv/ 115 | ENV/ 116 | env.bak/ 117 | venv.bak/ 118 | 119 | # Spyder project settings 120 | .spyderproject 121 | .spyproject 122 | 123 | # Rope project settings 124 | .ropeproject 125 | 126 | # mkdocs documentation 127 | /site 128 | 129 | # mypy 130 | .mypy_cache/ 131 | .dmypy.json 132 | dmypy.json 133 | 134 | # Pyre type checker 135 | .pyre/ 136 | 137 | # pytype static type analyzer 138 | .pytype/ 139 | .ipynb_checkpoints/requirements-checkpoint.txt 140 | .ipynb_checkpoints/time-series-forecasting-tutorial-checkpoint.ipynb 141 | *.pyc 142 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # :hourglass_flowing_sand: time-series-forecasting-wiki 2 | This repository contains a series of analysis, transforms and forecasting models frequently used when dealing with time series. The aim of this repository is to showcase how to model time series from the scratch, for this we are using a real usecase dataset ([Beijing air polution dataset](https://archive.ics.uci.edu/ml/datasets/Beijing+PM2.5+Data) to avoid perfect use cases far from reality that are often present in this types of tutorials. If you want to rerun the notebooks make sure you install al neccesary dependencies, [Guide](docs/setup.md) 3 | 4 | 5 | 6 | 7 | You can find the more detailed toc on the main [notebook](time-series-forecasting-tutorial.ipynb) 8 | 9 | 10 | 11 | # :open_file_folder: Dataset 12 | 13 | The dataset used is the [Beijing air quality](https://archive.ics.uci.edu/ml/datasets/Beijing+PM2.5+Data) public dataset. This dataset contains polution data from 2014 to 2019 sampled every 10 minutes along with extra weather features such as preassure, temperature etc. We decided to resample the dataset with daily frequency for both easier data handling and proximity to a real use case scenario (no one would build a model to predict polution 10 minutes ahead, 1 day ahead looks more realistic). In this case the series is already stationary with some small seasonalities which change every year #MORE ONTHIS 14 | 15 | In order to obtain a exact copy of the dataset used in this tutorial please run the [script](https://github.com/jiwidi/time-series-forecasting-wiki/blob/master/datasets/download_datasets.py) under `datasets/download_datasets.py` which will automatically download the dataset and preprocess it for you. 16 | 17 | # 📚 Analysis and transforms 18 | 19 | * Time series decomposition 20 | * Level 21 | * Trend 22 | * Seasonality 23 | * Noise 24 | 25 | * Stationarity 26 | * AC and PAC plots 27 | * Rolling mean and std 28 | * Dickey-Fuller test 29 | 30 | * Making our time series stationary 31 | * Difference transform 32 | * Log scale 33 | * Smoothing 34 | * Moving average 35 | 36 | # :triangular_ruler: Models tested 37 | 38 | * Autoregression ([AR](https://www.statsmodels.org/stable/generated/statsmodels.tsa.ar_model.AR.html)) 39 | * Moving Average (MA) 40 | * Autoregressive Moving Average (ARMA) 41 | * Autoregressive integraded moving average (ARIMA) 42 | * Seasonal autoregressive integrated moving average (SARIMA) 43 | * Bayesian regression [Link](https://scikit-learn.org/stable/auto_examples/linear_model/plot_bayesian_ridge.html) 44 | * Lasso [Link](https://scikit-learn.org/stable/modules/generated/sklearn.linear_model.Lasso.html) 45 | * SVM [Link](https://scikit-learn.org/stable/modules/classes.html?highlight=svm#module-sklearn.svm) 46 | * Randomforest [Link](https://scikit-learn.org/stable/modules/generated/sklearn.ensemble.RandomForestRegressor.html?highlight=randomforest#sklearn.ensemble.RandomForestRegressor) 47 | * Nearest neighbors [Link](https://scikit-learn.org/stable/modules/neighbors.html) 48 | * XGBoost [Link](https://xgboost.readthedocs.io/en/latest/) 49 | * Lightgbm [Link](https://github.com/microsoft/LightGBM) 50 | * Prophet [Link](https://facebook.github.io/prophet/docs/quick_start.html) 51 | * Long short-term memory with tensorflow (LSTM)[Link](https://www.tensorflow.org/) 52 | 53 | * DeepAR 54 | 55 | 56 | # :mag: Forecasting results 57 | We will devide our results wether the extra features columns such as temperature or preassure were used by the model as this is a huge step in metrics and represents two different scenarios. Metrics used were: 58 | 59 | ## Evaluation Metrics 60 | * Mean Absolute Error (MAE) 61 | * Mean Absolute Percentage Error (MAPE) 62 | * Root Mean Squared Error (RMSE) 63 | * Coefficient of determination (R2) 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 | 221 | 222 | 223 | 224 | 225 | 226 | 227 | 228 | 229 | 230 | 231 | 232 | 233 | 234 | 235 | 236 | 237 | 238 | 239 | 240 | 241 | 242 | 243 | 244 | 245 | 246 | 247 | 248 | 249 | 250 | 251 | 252 | 253 | 254 | 255 | 256 | 257 | 258 | 259 | 260 | 261 | 262 | 263 | 264 | 265 | 266 | 267 | 268 |
Modelmaermsemaper2
EnsembleXG+TF27.6440.230.420.76
EnsembleLIGHT+TF27.3439.270.420.77
EnsembleXG+LIGHT+TF27.6339.690.440.76
EnsembleXG+LIGHT29.9542.70.520.73
Randomforest tunned40.7953.20.90.57
SVM RBF GRID SEARCH38.5750.340.780.62
DeepAR71.37103.970.96-0.63
Tensorflow simple LSTM30.1343.080.420.72
Prophet multivariate38.2550.450.740.62
Kneighbors57.0580.391.080.03
SVM RBF40.8156.030.790.53
Lightgbm30.2142.760.520.72
XGBoost32.1345.590.560.69
Randomforest45.8459.451.030.47
Lasso39.2454.580.710.55
BayesianRidge39.2454.630.710.55
Prophet univariate61.3383.641.26-0.05
AutoSARIMAX (1, 0, 1),(0, 0, 0, 6)51.2971.490.910.23
SARIMAX51.2571.330.910.23
AutoARIMA (0, 0, 3)47.0164.711.00.37
ARIMA48.2566.391.060.34
ARMA47.164.861.010.37
MA49.0466.21.050.34
AR47.2465.321.020.36
HWES52.9674.671.110.16
SES52.9674.671.110.16
Yesterdays value52.6774.521.040.16
Naive mean59.3881.441.32-0.0
269 | 270 | 271 | 272 | # :shipit: Additional resources and literature 273 | 274 | ## Models not tested but that are gaining popularity 275 | There are several models we have not tried in this tutorials as they come from the academic world and their implementation is not 100% reliable, but is worth mentioning them: 276 | 277 | * Neural basis expansion analysis for interpretable time series forecasting (N-BEATS) | [link](https://arxiv.org/abs/1905.10437) [Code](https://github.com/philipperemy/n-beats) 278 | * ESRRN [link](https://eng.uber.com/m4-forecasting-competition/) [Code](https://github.com/damitkwr/ESRNN-GPU) 279 | 280 | 281 | # 282 | | | | 283 | | - | - | 284 | | Adhikari, R., & Agrawal, R. K. (2013). An introductory study on time series modeling and forecasting | [[1]](https://arxiv.org/ftp/arxiv/papers/1302/1302.6613.pdf)| 285 | | Introduction to Time Series Forecasting With Python | [[2]](https://machinelearningmastery.com/introduction-to-time-series-forecasting-with-python/)| 286 | | Deep Learning for Time Series Forecasting | [[3]](https://machinelearningmastery.com/deep-learning-for-time-series-forecasting/ ) 287 | | The Complete Guide to Time Series Analysis and Forecasting| [[4]](https://towardsdatascience.com/the-complete-guide-to-time-series-analysis-and-forecasting-70d476bfe775)| 288 | | How to Decompose Time Series Data into Trend and Seasonality| [[5]](https://machinelearningmastery.com/decompose-time-series-data-trend-seasonality/) 289 | 290 | 291 | # Contributing 292 | Want to see another model tested? Do you have anything to add or fix? I'll be happy to talk about it! Open an issue/PR :) 293 | 294 | -------------------------------------------------------------------------------- /datasets/.gitignore: -------------------------------------------------------------------------------- 1 | secretjaime/ 2 | -------------------------------------------------------------------------------- /datasets/download_datasets.py: -------------------------------------------------------------------------------- 1 | from tqdm import tqdm 2 | from pandas import read_csv 3 | from datetime import datetime 4 | 5 | import numpy as np 6 | import logging 7 | import requests 8 | import io 9 | import os 10 | 11 | # Set up logger 12 | logging.basicConfig(level=logging.INFO) 13 | logger = logging.getLogger(__name__) 14 | logger.setLevel(logging.INFO) 15 | 16 | 17 | def download_from_url(url, dst): 18 | """ 19 | @param: url to download file 20 | @param: dst place to put the file 21 | """ 22 | req = requests.get(url, stream=True, verify=False) 23 | file_size = int(req.headers["Content-length"]) 24 | if os.path.exists(dst): 25 | first_byte = os.path.getsize(dst) 26 | else: 27 | first_byte = 0 28 | pbar = tqdm( 29 | total=file_size, 30 | initial=first_byte, 31 | unit="B", 32 | unit_scale=True, 33 | desc=url.split("/")[-1], 34 | ) 35 | 36 | with (open(dst, "wb")) as f: 37 | for chunk in req.iter_content(chunk_size=1024): 38 | if chunk: 39 | f.write(chunk) 40 | pbar.update(1024) 41 | 42 | pbar.close() 43 | return file_size 44 | 45 | 46 | def parse(x): 47 | return datetime.strptime(x, "%Y %m %d %H") 48 | 49 | 50 | if __name__ == "__main__": 51 | # Air pollution dataset, 52 | # https://machinelearningmastery.com/multivariate-time-series-forecasting-lstms-keras/ 53 | urls = { 54 | "air_pollution": "https://raw.githubusercontent.com/jbrownlee/Datasets/master/pollution.csv" 55 | } 56 | 57 | # Air pollution 58 | # ================= 59 | logger.info(f"Processing air pollution dataset") 60 | x = requests.get(url=urls["air_pollution"], verify=False).content 61 | dataset = read_csv( 62 | io.StringIO(x.decode("utf8")), 63 | parse_dates=[["year", "month", "day", "hour"]], 64 | index_col=0, 65 | date_parser=parse, 66 | ) 67 | dataset.drop("No", axis=1, inplace=True) 68 | dataset.columns = [ 69 | "pollution_today", 70 | "dew", 71 | "temp", 72 | "press", 73 | "wnd_dir", 74 | "wnd_spd", 75 | "snow", 76 | "rain", 77 | ] 78 | dataset.index.name = "date" 79 | # Drop first 24 hours because they have incomplete data 80 | dataset = dataset[24:] 81 | # Fix na values with interpolation, our analysis just detected 36 days out 82 | # of 1200 with nans but we are not that confident about doing this 83 | dataset["pollution_today"].fillna(0, inplace=True) 84 | dataset.pollution_today = dataset.pollution_today.replace( 85 | 0, np.nan).interpolate() 86 | # Dataset had hourly measurements, we will translate this into the avg 87 | # pollution for the day and 25%/75% percentlies. Losing categorical 88 | # feature wind dir 89 | dataset = dataset.resample("D").mean() 90 | dataset = dataset[dataset.pollution_today != 0] 91 | # #Snow and rain columns where binary columns initially but now when resampling to daily data they have values greater than 1, lets fix it 92 | # dataset['snow'] = (dataset.snow > 0).astype(int) 93 | # dataset['rain'] = (dataset.rain > 0).astype(int) 94 | # Make it to supervised learning, every raw of datapoints at time t has 95 | # target t+1 96 | dataset["pollution_yesterday"] = ( 97 | dataset["pollution_today"].tolist()[-1:] 98 | + dataset["pollution_today"].tolist()[:-1] 99 | ) 100 | # save to file 101 | path = os.path.dirname(os.path.realpath(__file__)) 102 | logger.info(f"Saving air pollution dataset to{path}") 103 | dataset.to_csv(f"{path}/air_pollution.csv") 104 | 105 | logger.info(f"Air pollution dataset processed") 106 | logger.info(f"Processing done") 107 | -------------------------------------------------------------------------------- /datasets/international_airline_passengers.csv: -------------------------------------------------------------------------------- 1 | time,passengers 2 | "1949-01",112 3 | "1949-02",118 4 | "1949-03",132 5 | "1949-04",129 6 | "1949-05",121 7 | "1949-06",135 8 | "1949-07",148 9 | "1949-08",148 10 | "1949-09",136 11 | "1949-10",119 12 | "1949-11",104 13 | "1949-12",118 14 | "1950-01",115 15 | "1950-02",126 16 | "1950-03",141 17 | "1950-04",135 18 | "1950-05",125 19 | "1950-06",149 20 | "1950-07",170 21 | "1950-08",170 22 | "1950-09",158 23 | "1950-10",133 24 | "1950-11",114 25 | "1950-12",140 26 | "1951-01",145 27 | "1951-02",150 28 | "1951-03",178 29 | "1951-04",163 30 | "1951-05",172 31 | "1951-06",178 32 | "1951-07",199 33 | "1951-08",199 34 | "1951-09",184 35 | "1951-10",162 36 | "1951-11",146 37 | "1951-12",166 38 | "1952-01",171 39 | "1952-02",180 40 | "1952-03",193 41 | "1952-04",181 42 | "1952-05",183 43 | "1952-06",218 44 | "1952-07",230 45 | "1952-08",242 46 | "1952-09",209 47 | "1952-10",191 48 | "1952-11",172 49 | "1952-12",194 50 | "1953-01",196 51 | "1953-02",196 52 | "1953-03",236 53 | "1953-04",235 54 | "1953-05",229 55 | "1953-06",243 56 | "1953-07",264 57 | "1953-08",272 58 | "1953-09",237 59 | "1953-10",211 60 | "1953-11",180 61 | "1953-12",201 62 | "1954-01",204 63 | "1954-02",188 64 | "1954-03",235 65 | "1954-04",227 66 | "1954-05",234 67 | "1954-06",264 68 | "1954-07",302 69 | "1954-08",293 70 | "1954-09",259 71 | "1954-10",229 72 | "1954-11",203 73 | "1954-12",229 74 | "1955-01",242 75 | "1955-02",233 76 | "1955-03",267 77 | "1955-04",269 78 | "1955-05",270 79 | "1955-06",315 80 | "1955-07",364 81 | "1955-08",347 82 | "1955-09",312 83 | "1955-10",274 84 | "1955-11",237 85 | "1955-12",278 86 | "1956-01",284 87 | "1956-02",277 88 | "1956-03",317 89 | "1956-04",313 90 | "1956-05",318 91 | "1956-06",374 92 | "1956-07",413 93 | "1956-08",405 94 | "1956-09",355 95 | "1956-10",306 96 | "1956-11",271 97 | "1956-12",306 98 | "1957-01",315 99 | "1957-02",301 100 | "1957-03",356 101 | "1957-04",348 102 | "1957-05",355 103 | "1957-06",422 104 | "1957-07",465 105 | "1957-08",467 106 | "1957-09",404 107 | "1957-10",347 108 | "1957-11",305 109 | "1957-12",336 110 | "1958-01",340 111 | "1958-02",318 112 | "1958-03",362 113 | "1958-04",348 114 | "1958-05",363 115 | "1958-06",435 116 | "1958-07",491 117 | "1958-08",505 118 | "1958-09",404 119 | "1958-10",359 120 | "1958-11",310 121 | "1958-12",337 122 | "1959-01",360 123 | "1959-02",342 124 | "1959-03",406 125 | "1959-04",396 126 | "1959-05",420 127 | "1959-06",472 128 | "1959-07",548 129 | "1959-08",559 130 | "1959-09",463 131 | "1959-10",407 132 | "1959-11",362 133 | "1959-12",405 134 | "1960-01",417 135 | "1960-02",391 136 | "1960-03",419 137 | "1960-04",461 138 | "1960-05",472 139 | "1960-06",535 140 | "1960-07",622 141 | "1960-08",606 142 | "1960-09",508 143 | "1960-10",461 144 | "1960-11",390 145 | "1960-12",432 -------------------------------------------------------------------------------- /datasets/test.csv: -------------------------------------------------------------------------------- 1 | date,pollution_today,dew,temp,press,wnd_spd,snow,rain,pollution_yesterday 2 | 2014-01-02,162.625,-9.208333333333334,0.375,1018.3333333333334,3.5695833333333336,0.0,0.0,53.41666666666666 3 | 2014-01-03,61.91666666666666,-13.375,2.75,1022.125,5.996666666666666,0.0,0.0,162.625 4 | 2014-01-04,150.41666666666666,-7.25,-2.0,1022.875,2.924166666666667,0.0,0.0,61.91666666666666 5 | 2014-01-05,104.08333333333331,-11.083333333333334,-0.9166666666666666,1024.2916666666667,15.237083333333326,0.0,0.0,150.41666666666666 6 | 2014-01-06,150.875,-5.291666666666667,-0.9166666666666666,1026.0,10.355416666666663,0.375,0.0,104.08333333333331 7 | 2014-01-07,121.33333333333331,-12.25,-0.0833333333333333,1026.875,9.571249999999996,0.0,0.0,150.875 8 | 2014-01-08,19.25,-23.0,-3.375,1033.625,25.7375,0.0,0.0,121.33333333333331 9 | 2014-01-09,32.416666666666664,-25.791666666666668,-4.416666666666667,1031.7916666666667,21.795,0.0,0.0,19.25 10 | 2014-01-10,79.83333333333333,-23.25,-4.75,1030.75,3.9850000000000008,0.0,0.0,32.416666666666664 11 | 2014-01-11,156.70833333333334,-20.791666666666668,-3.7916666666666665,1030.3333333333333,3.5000000000000004,0.0,0.0,79.83333333333333 12 | 2014-01-12,24.375,-23.875,-1.875,1035.7083333333333,12.626249999999995,0.0,0.0,156.70833333333334 13 | 2014-01-13,119.83333333333331,-19.5,-5.5,1031.8333333333333,1.9341666666666668,0.0,0.0,24.375 14 | 2014-01-14,124.75,-18.291666666666668,-3.8333333333333335,1033.875,4.506666666666667,0.0,0.0,119.83333333333331 15 | 2014-01-15,191.79166666666663,-17.083333333333332,-2.833333333333333,1031.0833333333333,4.412083333333334,0.0,0.0,124.75 16 | 2014-01-16,457.5,-8.458333333333334,-0.9166666666666666,1027.9166666666667,4.172499999999999,0.0,0.0,191.79166666666663 17 | 2014-01-17,167.54166666666666,-13.666666666666666,0.5,1031.3333333333333,18.007916666666667,0.1666666666666666,0.0,457.5 18 | 2014-01-18,71.25,-17.458333333333332,0.4583333333333333,1032.6666666666667,18.32458333333333,0.0,0.0,167.54166666666666 19 | 2014-01-19,131.16666666666666,-10.541666666666666,0.0416666666666666,1024.8333333333333,11.322083333333332,0.0,0.0,71.25 20 | 2014-01-20,10.458333333333334,-22.08333333333333,0.0416666666666666,1029.5833333333333,175.35208333333333,0.0,0.0,131.16666666666666 21 | 2014-01-21,42.375,-21.75,-1.2083333333333333,1032.0416666666667,109.3654166666667,0.0,0.0,10.458333333333334 22 | 2014-01-22,154.04166666666666,-18.416666666666668,-3.083333333333333,1023.5833333333334,3.2954166666666675,0.0,0.0,42.375 23 | 2014-01-23,289.375,-14.041666666666666,-3.083333333333333,1016.7916666666666,1.58125,0.0,0.0,154.04166666666666 24 | 2014-01-24,162.66666666666666,-16.958333333333332,2.5,1017.2916666666666,10.63625,0.0,0.0,289.375 25 | 2014-01-25,34.208333333333336,-19.125,1.7916666666666667,1027.0,9.405416666666664,0.0,0.0,162.66666666666666 26 | 2014-01-26,55.66666666666666,-10.583333333333334,-1.0416666666666667,1029.125,15.93125,0.0,0.0,34.208333333333336 27 | 2014-01-27,100.79166666666669,-14.291666666666666,0.5,1019.125,15.55833333333333,0.0,0.0,55.66666666666666 28 | 2014-01-28,43.91666666666666,-16.125,-0.0416666666666666,1027.75,19.48125,0.0,0.0,100.79166666666669 29 | 2014-01-29,142.875,-8.833333333333334,-2.5,1014.9166666666666,4.318750000000001,0.0,0.0,43.91666666666666 30 | 2014-01-30,75.16666666666667,-17.666666666666668,1.9583333333333333,1017.7916666666666,12.57208333333333,0.0,0.0,142.875 31 | 2014-01-31,164.29166666666666,-6.625,0.2916666666666667,1019.3333333333334,10.762916666666664,0.0,0.0,75.16666666666667 32 | 2014-02-01,156.83333333333334,-3.625,2.6666666666666665,1016.0,9.558333333333335,0.0,0.0,164.29166666666666 33 | 2014-02-02,74.375,-15.958333333333334,4.416666666666667,1015.0416666666666,38.05458333333333,0.0,0.0,156.83333333333334 34 | 2014-02-03,7.416666666666667,-33.333333333333336,-1.2083333333333333,1026.875,54.11666666666667,0.0,0.0,74.375 35 | 2014-02-04,25.75,-31.70833333333333,-3.0,1029.625,33.062916666666666,0.0,0.0,7.416666666666667 36 | 2014-02-05,102.375,-18.166666666666668,-3.9166666666666665,1028.7083333333333,5.3775,0.0,0.0,25.75 37 | 2014-02-06,145.25,-13.041666666666666,-2.375,1029.9166666666667,2.3075,0.0,0.0,102.375 38 | 2014-02-07,102.25,-7.25,-3.375,1027.3333333333333,37.861250000000005,7.125,0.0,145.25 39 | 2014-02-08,60.04166666666666,-11.916666666666666,-2.958333333333333,1027.8333333333333,23.455,4.375,0.0,102.25 40 | 2014-02-09,13.375,-21.375,-5.875,1036.4583333333333,63.96416666666666,0.0,0.0,60.04166666666666 41 | 2014-02-10,23.916666666666668,-19.791666666666668,-6.333333333333333,1035.0416666666667,14.585416666666662,0.0,0.0,13.375 42 | 2014-02-11,124.83333333333331,-15.541666666666666,-6.041666666666667,1028.2916666666667,4.506666666666667,0.0,0.0,23.916666666666668 43 | 2014-02-12,143.58333333333334,-16.458333333333332,-2.6666666666666665,1032.2916666666667,10.04125,0.0,0.0,124.83333333333331 44 | 2014-02-13,211.16666666666663,-10.583333333333334,-2.208333333333333,1034.8333333333333,43.97916666666666,0.125,0.0,143.58333333333334 45 | 2014-02-14,286.5,-9.0,-3.125,1026.4583333333333,2.081666666666667,0.0,0.0,211.16666666666663 46 | 2014-02-15,372.0,-7.958333333333333,-1.7916666666666667,1024.4166666666667,3.558750000000001,0.0,0.0,286.5 47 | 2014-02-16,273.875,-9.625,0.75,1029.0833333333333,14.493333333333332,0.0,0.0,372.0 48 | 2014-02-17,80.79166666666667,-13.458333333333334,0.875,1034.75,14.137916666666664,0.0,0.0,273.875 49 | 2014-02-18,67.45833333333333,-11.875,-1.3333333333333333,1032.1666666666667,19.447916666666664,0.0416666666666666,0.0,80.79166666666667 50 | 2014-02-19,78.41666666666667,-13.083333333333334,-0.5416666666666666,1028.6666666666667,6.946666666666666,0.0,0.0,67.45833333333333 51 | 2014-02-20,258.0625,-6.041666666666667,-1.6666666666666667,1030.2916666666667,16.502916666666664,0.125,0.0,78.41666666666667 52 | 2014-02-21,331.0833333333333,-6.291666666666667,-0.875,1028.2916666666667,1.9937500000000004,0.0,0.0,258.0625 53 | 2014-02-22,339.5833333333333,-4.708333333333333,2.6666666666666665,1029.7916666666667,6.870833333333333,0.0,0.0,331.0833333333333 54 | 2014-02-23,292.3958333333333,-5.583333333333333,1.7916666666666667,1030.7916666666667,5.431250000000001,0.0,0.0,339.5833333333333 55 | 2014-02-24,351.625,-4.958333333333333,3.458333333333333,1027.4166666666667,2.772083333333333,0.0,0.0,292.3958333333333 56 | 2014-02-25,442.6666666666667,-4.291666666666667,2.458333333333333,1026.0416666666667,2.6975,0.0,0.0,351.625 57 | 2014-02-26,407.6666666666667,-1.1666666666666667,4.666666666666667,1022.8333333333334,4.1325,0.0,0.2916666666666667,442.6666666666667 58 | 2014-02-27,19.916666666666668,-16.416666666666668,4.458333333333333,1028.625,27.980416666666656,0.0,0.0,407.6666666666667 59 | 2014-02-28,97.41666666666669,-7.5,1.4166666666666667,1026.5833333333333,3.8545833333333337,0.0,0.0,19.916666666666668 60 | 2014-03-01,84.91666666666667,-15.375,5.083333333333333,1023.2916666666666,14.95375,0.0,0.0,97.41666666666669 61 | 2014-03-02,154.58333333333334,-8.166666666666666,3.875,1022.4583333333334,7.9891666666666685,0.0,0.0,84.91666666666667 62 | 2014-03-03,245.20833333333331,-5.916666666666667,1.0,1021.9583333333334,5.923333333333332,0.0,0.0,154.58333333333334 63 | 2014-03-04,59.79166666666666,-19.25,4.125,1026.0833333333333,46.21375,0.0,0.0,245.20833333333331 64 | 2014-03-05,24.95833333333333,-21.416666666666668,2.333333333333333,1028.2083333333333,32.35208333333333,0.0,0.0,59.79166666666666 65 | 2014-03-06,18.08333333333333,-26.625,2.75,1029.7916666666667,12.610833333333332,0.0,0.0,24.95833333333333 66 | 2014-03-07,59.66666666666666,-18.666666666666668,2.5,1029.375,7.564166666666666,0.0,0.0,18.08333333333333 67 | 2014-03-08,174.79166666666666,-7.541666666666667,3.75,1023.4166666666666,6.616249999999998,0.0,0.0,59.66666666666666 68 | 2014-03-09,123.04166666666669,-9.791666666666666,3.2916666666666665,1025.9583333333333,10.32125,0.0,0.0,174.79166666666666 69 | 2014-03-10,101.45833333333331,-7.333333333333333,2.75,1023.9166666666666,10.042499999999997,0.0,0.0,123.04166666666669 70 | 2014-03-11,204.70833333333331,-6.416666666666667,6.833333333333333,1017.6666666666666,6.946666666666668,0.0,0.0,101.45833333333331 71 | 2014-03-12,18.08333333333333,-19.125,7.083333333333333,1025.3333333333333,8.45375,0.0,0.0,204.70833333333331 72 | 2014-03-13,22.75,-21.125,6.583333333333333,1021.6666666666666,8.719166666666666,0.0,0.0,18.08333333333333 73 | 2014-03-14,22.875,-21.291666666666668,11.083333333333334,1018.0,37.14041666666667,0.0,0.0,22.75 74 | 2014-03-15,109.04166666666669,-10.5,11.0,1010.75,10.692083333333334,0.0,0.0,22.875 75 | 2014-03-16,124.625,-9.041666666666666,11.625,1014.9166666666666,13.05125,0.0,0.0,109.04166666666669 76 | 2014-03-17,91.08333333333331,-7.666666666666667,12.791666666666666,1012.0416666666666,40.80791666666666,0.0,0.0,124.625 77 | 2014-03-18,39.958333333333336,-9.708333333333334,11.708333333333334,1021.9166666666666,35.964166666666664,0.0,0.0,91.08333333333331 78 | 2014-03-19,59.66666666666666,-7.833333333333333,8.791666666666666,1022.5416666666666,18.43916666666667,0.0,0.0,39.958333333333336 79 | 2014-03-20,10.333333333333334,-16.0,11.75,1026.25,33.840416666666655,0.0,0.0,59.66666666666666 80 | 2014-03-21,25.64583333333333,-15.0,14.75,1020.0416666666666,13.146666666666668,0.0,0.0,10.333333333333334 81 | 2014-03-22,65.0,-13.875,14.583333333333334,1017.5,10.33625,0.0,0.0,25.64583333333333 82 | 2014-03-23,152.45833333333334,-4.875,12.5,1023.2916666666666,14.03875,0.0,0.0,65.0 83 | 2014-03-24,243.91666666666663,0.2083333333333333,12.875,1013.875,5.6937500000000005,0.0,0.0,152.45833333333334 84 | 2014-03-25,228.375,1.2083333333333333,14.708333333333334,1010.0833333333334,6.123749999999999,0.0,0.0,243.91666666666663 85 | 2014-03-26,306.4166666666667,6.083333333333333,15.5,1010.0833333333334,4.9262500000000005,0.0,0.0,228.375 86 | 2014-03-27,270.75,4.541666666666667,13.416666666666666,1011.2916666666666,6.05,0.0,0.0,306.4166666666667 87 | 2014-03-28,148.25,6.083333333333333,15.916666666666666,1007.7916666666666,6.924166666666665,0.0,0.4166666666666667,270.75 88 | 2014-03-29,45.5,0.9583333333333334,16.333333333333332,1012.6666666666666,5.290000000000001,0.0,0.0,148.25 89 | 2014-03-30,34.166666666666664,-4.875,18.041666666666668,1015.0,7.730416666666668,0.0,0.0,45.5 90 | 2014-03-31,151.33333333333334,2.9166666666666665,17.166666666666668,1015.1666666666666,17.282916666666665,0.0,0.0416666666666666,34.166666666666664 91 | 2014-04-01,132.95833333333334,2.0416666666666665,15.958333333333334,1012.125,6.1429166666666655,0.0,0.0,151.33333333333334 92 | 2014-04-02,106.75,1.0833333333333333,16.291666666666668,1014.5,14.414583333333333,0.0,0.0,132.95833333333334 93 | 2014-04-03,24.375,-17.416666666666668,14.041666666666666,1023.2083333333334,18.2875,0.0,0.0,106.75 94 | 2014-04-04,32.541666666666664,-10.125,13.875,1014.875,10.80125,0.0,0.0,24.375 95 | 2014-04-05,25.541666666666668,-11.041666666666666,13.291666666666666,1021.9166666666666,8.287916666666666,0.0,0.0,32.541666666666664 96 | 2014-04-06,57.91666666666666,-8.458333333333334,15.625,1017.375,18.47083333333333,0.0,0.0,25.541666666666668 97 | 2014-04-07,95.29166666666669,-1.25,16.458333333333332,1013.0833333333334,4.279583333333333,0.0,0.0,57.91666666666666 98 | 2014-04-08,169.29166666666666,2.625,17.416666666666668,1013.1666666666666,11.825833333333335,0.0,0.0,95.29166666666669 99 | 2014-04-09,145.375,0.2083333333333333,21.20833333333333,1010.75,20.860416666666666,0.0,0.0,169.29166666666666 100 | 2014-04-10,89.85416666666667,-2.333333333333333,15.625,1021.5833333333334,11.844583333333334,0.0,0.0416666666666666,145.375 101 | 2014-04-11,60.29166666666666,-3.333333333333333,14.458333333333334,1018.9583333333334,7.902500000000001,0.0,0.2083333333333333,89.85416666666667 102 | 2014-04-12,117.875,-2.375,14.75,1015.9166666666666,6.629166666666669,0.0,0.0,60.29166666666666 103 | 2014-04-13,157.66666666666666,3.333333333333333,16.25,1016.875,14.894166666666663,0.0,0.0,117.875 104 | 2014-04-14,245.29166666666663,8.208333333333334,18.45833333333333,1015.9166666666666,10.875,0.0,0.0,157.66666666666666 105 | 2014-04-15,67.375,2.958333333333333,18.125,1018.5,24.76958333333333,0.0,0.0,245.29166666666663 106 | 2014-04-16,65.08333333333333,-3.375,16.625,1014.0,2.5854166666666667,0.0,0.0,67.375 107 | 2014-04-17,117.70833333333331,6.458333333333333,14.375,1012.5833333333334,5.59,0.0,1.1666666666666667,65.08333333333333 108 | 2014-04-18,145.58333333333334,9.583333333333334,16.0,1019.125,16.055,0.0,0.0,117.70833333333331 109 | 2014-04-19,63.5,3.5,12.625,1020.75,18.662916666666668,0.0,0.5416666666666666,145.58333333333334 110 | 2014-04-20,69.04166666666667,2.5416666666666665,14.791666666666666,1016.3333333333334,10.15,0.0,0.0,63.5 111 | 2014-04-21,50.91666666666666,0.2916666666666667,17.625,1015.6666666666666,7.786249999999999,0.0,0.0,69.04166666666667 112 | 2014-04-22,77.41666666666667,2.625,19.08333333333333,1013.1666666666666,16.617083333333337,0.0,0.0,50.91666666666666 113 | 2014-04-23,120.83333333333331,10.958333333333334,20.041666666666668,1010.2083333333334,71.37916666666668,0.0,0.125,77.41666666666667 114 | 2014-04-24,111.29166666666669,11.458333333333334,19.791666666666668,1014.0,18.01333333333333,0.0,0.0,120.83333333333331 115 | 2014-04-25,125.70833333333331,9.0,19.45833333333333,1016.4583333333334,9.945,0.0,0.1666666666666666,111.29166666666669 116 | 2014-04-26,39.16666666666666,7.041666666666667,15.916666666666666,1020.0,9.965416666666668,0.0,1.0416666666666667,125.70833333333331 117 | 2014-04-27,66.83333333333333,5.458333333333333,17.708333333333332,1020.1666666666666,10.690833333333332,0.0,0.0,39.16666666666666 118 | 2014-04-28,67.75,4.958333333333333,18.625,1018.7916666666666,5.995833333333331,0.0,0.0,66.83333333333333 119 | 2014-04-29,104.79166666666669,5.625,19.70833333333333,1013.0833333333334,10.970416666666663,0.0,0.0,67.75 120 | 2014-04-30,112.25,9.583333333333334,21.125,1008.7916666666666,17.393749999999997,0.0,0.0,104.79166666666669 121 | 2014-05-01,123.54166666666669,10.666666666666666,20.625,1007.8333333333334,39.225,0.0,0.0833333333333333,112.25 122 | 2014-05-02,38.0,-2.1666666666666665,17.083333333333332,1015.4583333333334,133.65041666666664,0.0,0.0,123.54166666666669 123 | 2014-05-03,80.66666666666667,-0.0833333333333333,16.083333333333332,1012.5833333333334,27.25125,0.0,0.0,38.0 124 | 2014-05-04,46.79166666666666,-9.625,14.25,1017.375,187.5616666666667,0.0,0.0,80.66666666666667 125 | 2014-05-05,46.958333333333336,-5.875,13.875,1017.125,8.494166666666665,0.0,0.0,46.79166666666666 126 | 2014-05-06,98.79166666666669,3.6666666666666665,15.75,1008.4583333333334,3.6687500000000006,0.0,0.0416666666666666,46.958333333333336 127 | 2014-05-07,91.08333333333331,1.5833333333333333,18.916666666666668,1006.125,18.195833333333336,0.0,0.0,98.79166666666669 128 | 2014-05-08,87.75,7.375,17.416666666666668,1014.0,15.97375,0.0,0.0,91.08333333333331 129 | 2014-05-09,68.83333333333333,5.541666666666667,17.666666666666668,1014.6666666666666,29.690416666666668,0.0,0.0,87.75 130 | 2014-05-10,54.91666666666666,5.75,17.208333333333332,1015.9166666666666,8.290000000000001,0.0,0.125,68.83333333333333 131 | 2014-05-11,30.75,9.625,12.041666666666666,1006.7083333333334,14.997083333333338,0.0,8.041666666666666,54.91666666666666 132 | 2014-05-12,47.25,8.958333333333334,20.875,1000.2916666666666,20.899166666666662,0.0,0.0,30.75 133 | 2014-05-13,59.083333333333336,5.708333333333333,22.5,999.9166666666666,26.486666666666665,0.0,0.0,47.25 134 | 2014-05-14,22.95833333333333,-1.375,19.375,1005.0416666666666,107.52458333333333,0.0,0.0,59.083333333333336 135 | 2014-05-15,78.66666666666667,3.75,20.375,1000.1666666666666,13.704999999999998,0.0,0.0,22.95833333333333 136 | 2014-05-16,80.29166666666667,4.291666666666667,23.25,1006.5833333333334,7.579166666666666,0.0,0.0,78.66666666666667 137 | 2014-05-17,69.375,6.041666666666667,22.08333333333333,1012.2916666666666,17.278333333333332,0.0,0.0416666666666666,80.29166666666667 138 | 2014-05-18,100.16666666666669,9.625,23.5,1008.3333333333334,21.397499999999997,0.0,0.0416666666666666,69.375 139 | 2014-05-19,109.79166666666669,15.5,22.45833333333333,1004.5416666666666,10.31875,0.0,0.4166666666666667,100.16666666666669 140 | 2014-05-20,83.0,10.791666666666666,24.875,1003.9583333333334,11.622916666666663,0.0,0.0,109.79166666666669 141 | 2014-05-21,100.33333333333331,13.625,24.08333333333333,1005.2916666666666,10.095,0.0,0.0,83.0 142 | 2014-05-22,139.5,13.708333333333334,27.0,1006.0833333333334,25.42458333333333,0.0,0.0,100.33333333333331 143 | 2014-05-23,79.625,13.083333333333334,27.95833333333333,1009.625,32.12958333333333,0.0,0.0,139.5 144 | 2014-05-24,90.0,17.458333333333332,20.83333333333333,1007.875,13.677916666666668,0.0,0.9583333333333334,79.625 145 | 2014-05-25,74.75,7.958333333333333,22.875,1006.375,31.5775,0.0,0.0,90.0 146 | 2014-05-26,19.95833333333333,3.875,26.375,999.25,12.624166666666666,0.0,0.0,74.75 147 | 2014-05-27,30.5,4.791666666666667,26.625,995.875,47.193333333333335,0.0,0.0,19.95833333333333 148 | 2014-05-28,30.08333333333333,7.166666666666667,28.166666666666668,1000.2916666666666,20.91583333333333,0.0,0.0,30.5 149 | 2014-05-29,45.375,10.458333333333334,30.20833333333333,997.75,6.290833333333332,0.0,0.0,30.08333333333333 150 | 2014-05-30,91.25,13.0,28.666666666666668,1005.5416666666666,21.062916666666663,0.0,0.0,45.375 151 | 2014-05-31,115.29166666666669,15.25,27.0,1007.1666666666666,10.390833333333331,0.0,0.125,91.25 152 | 2014-06-01,51.875,16.583333333333332,23.95833333333333,1008.3333333333334,11.047916666666666,0.0,0.25,115.29166666666669 153 | 2014-06-02,33.333333333333336,12.625,22.45833333333333,1011.2916666666666,3.48375,0.0,0.0,51.875 154 | 2014-06-03,41.875,12.833333333333334,25.541666666666668,1007.625,16.70625,0.0,0.0,33.333333333333336 155 | 2014-06-04,62.958333333333336,14.583333333333334,25.70833333333333,1006.0,10.03625,0.0,0.0,41.875 156 | 2014-06-05,67.27083333333333,15.208333333333334,27.916666666666668,1004.1666666666666,5.2700000000000005,0.0,0.0,62.958333333333336 157 | 2014-06-06,56.60416666666666,16.583333333333332,21.33333333333333,1004.5,10.560833333333331,0.0,1.1666666666666667,67.27083333333333 158 | 2014-06-07,12.854166666666666,11.0,22.58333333333333,1003.875,16.747083333333332,0.0,0.0,56.60416666666666 159 | 2014-06-08,36.9375,13.75,21.0,1002.0833333333334,3.165416666666667,0.0,0.0416666666666666,12.854166666666666 160 | 2014-06-09,32.458333333333336,12.625,22.125,1004.4583333333334,4.413333333333333,0.0,0.0416666666666666,36.9375 161 | 2014-06-10,75.91666666666667,15.708333333333334,21.166666666666668,1008.625,4.058750000000001,0.0,0.0833333333333333,32.458333333333336 162 | 2014-06-11,46.833333333333336,13.833333333333334,24.33333333333333,1009.625,5.029583333333333,0.0,0.0,75.91666666666667 163 | 2014-06-12,30.33333333333333,14.125,27.75,1006.0,4.210416666666667,0.0,0.0,46.833333333333336 164 | 2014-06-13,60.833333333333336,17.208333333333332,24.875,1007.2916666666666,3.4441666666666677,0.0,0.2083333333333333,30.33333333333333 165 | 2014-06-14,43.708333333333336,17.5,25.33333333333333,1006.2916666666666,7.264583333333333,0.0,0.0,60.833333333333336 166 | 2014-06-15,115.16666666666669,18.33333333333333,26.541666666666668,1004.2083333333334,7.060416666666665,0.0,0.2083333333333333,43.708333333333336 167 | 2014-06-16,137.0,19.83333333333333,25.08333333333333,1002.0416666666666,4.7283333333333335,0.0,0.0416666666666666,115.16666666666669 168 | 2014-06-17,80.08333333333333,18.375,21.83333333333333,1002.3333333333334,6.892499999999999,0.0,0.5,137.0 169 | 2014-06-18,66.47916666666667,17.25,24.5,1002.5833333333334,7.802916666666667,0.0,0.0,80.08333333333333 170 | 2014-06-19,126.54166666666669,18.666666666666668,23.75,1004.4166666666666,17.126666666666665,0.0,0.0416666666666666,66.47916666666667 171 | 2014-06-20,46.04166666666666,17.541666666666668,22.95833333333333,1007.0,7.173750000000001,0.0,1.5,126.54166666666669 172 | 2014-06-21,56.958333333333336,16.958333333333332,22.666666666666668,1008.4583333333334,8.494583333333335,0.0,0.4166666666666667,46.04166666666666 173 | 2014-06-22,32.958333333333336,16.958333333333332,22.58333333333333,1008.7083333333334,4.114166666666667,0.0,0.0,56.958333333333336 174 | 2014-06-23,22.75,15.083333333333334,25.166666666666668,1007.6666666666666,12.274166666666664,0.0,0.0,32.958333333333336 175 | 2014-06-24,53.708333333333336,16.916666666666668,26.25,1004.2083333333334,13.534166666666666,0.0,0.0,22.75 176 | 2014-06-25,92.70833333333331,18.70833333333333,24.75,1003.0833333333334,28.336250000000003,0.0,0.0,53.708333333333336 177 | 2014-06-26,120.875,20.416666666666668,26.916666666666668,1002.8333333333334,12.517916666666666,0.0,0.0,92.70833333333331 178 | 2014-06-27,18.625,13.125,28.45833333333333,1006.0833333333334,8.737499999999999,0.0,0.0,120.875 179 | 2014-06-28,20.166666666666668,13.166666666666666,29.33333333333333,1005.25,17.990416666666672,0.0,0.0,18.625 180 | 2014-06-29,48.083333333333336,15.958333333333334,28.666666666666668,1005.7083333333334,11.360416666666666,0.0,0.0,20.166666666666668 181 | 2014-06-30,70.08333333333333,16.791666666666668,29.45833333333333,1005.5,12.698333333333332,0.0,0.0,48.083333333333336 182 | 2014-07-01,102.91666666666669,18.916666666666668,27.83333333333333,1004.3333333333334,27.20958333333333,0.0,0.25,70.08333333333333 183 | 2014-07-02,66.04166666666667,20.666666666666668,23.08333333333333,1003.0833333333334,2.6420833333333333,0.0,0.7916666666666666,102.91666666666669 184 | 2014-07-03,209.79166666666663,21.95833333333333,25.791666666666668,1001.0,6.409583333333333,0.0,0.0,66.04166666666667 185 | 2014-07-04,204.5,22.58333333333333,27.58333333333333,1004.3333333333334,8.002916666666666,0.0,0.0,209.79166666666663 186 | 2014-07-05,120.70833333333331,21.83333333333333,26.916666666666668,1006.5833333333334,8.176666666666668,0.0,0.0,204.5 187 | 2014-07-06,193.08333333333331,22.95833333333333,27.20833333333333,1004.9166666666666,50.13208333333333,0.0,0.0,120.70833333333331 188 | 2014-07-07,147.5,22.08333333333333,27.58333333333333,1002.75,33.76416666666667,0.0,0.0,193.08333333333331 189 | 2014-07-08,87.25,18.75,28.166666666666668,1001.9166666666666,2.7916666666666665,0.0,0.0,147.5 190 | 2014-07-09,25.5,15.458333333333334,27.25,1003.9166666666666,6.651250000000001,0.0,0.0,87.25 191 | 2014-07-10,30.791666666666668,15.041666666666666,29.95833333333333,999.6666666666666,14.735833333333334,0.0,0.0,25.5 192 | 2014-07-11,30.916666666666668,15.416666666666666,29.20833333333333,999.5833333333334,5.43625,0.0,0.0,30.791666666666668 193 | 2014-07-12,13.791666666666666,12.0,29.291666666666668,1002.2083333333334,15.882916666666668,0.0,0.0,30.916666666666668 194 | 2014-07-13,21.58333333333333,14.25,28.041666666666668,1002.0833333333334,4.786666666666666,0.0,0.125,13.791666666666666 195 | 2014-07-14,30.75,15.833333333333334,28.791666666666668,1002.0416666666666,7.1137500000000005,0.0,0.0,21.58333333333333 196 | 2014-07-15,49.458333333333336,17.208333333333332,28.20833333333333,1003.4583333333334,23.09875,0.0,0.125,30.75 197 | 2014-07-16,111.5,21.0,25.83333333333333,1003.5416666666666,5.847499999999999,0.0,0.375,49.458333333333336 198 | 2014-07-17,140.29166666666666,21.25,25.70833333333333,1005.6666666666666,4.263750000000001,0.0,0.0,111.5 199 | 2014-07-18,121.29166666666669,22.5,29.08333333333333,1006.7083333333334,5.828749999999999,0.0,0.0,140.29166666666666 200 | 2014-07-19,63.16666666666666,23.25,31.70833333333333,1007.875,12.194166666666668,0.0,0.0,121.29166666666669 201 | 2014-07-20,59.91666666666666,23.166666666666668,31.70833333333333,1004.75,29.00208333333333,0.0,0.125,63.16666666666666 202 | 2014-07-21,26.95833333333333,19.58333333333333,30.83333333333333,1001.7916666666666,28.12458333333333,0.0,0.0416666666666666,59.91666666666666 203 | 2014-07-22,14.375,16.25,28.041666666666668,1006.0833333333334,10.3,0.0,0.0416666666666666,26.95833333333333 204 | 2014-07-23,23.5,16.333333333333332,28.0,1003.75,7.747916666666665,0.0,0.0,14.375 205 | 2014-07-24,66.20833333333333,20.0,25.916666666666668,1005.2083333333334,3.0729166666666665,0.0,0.2916666666666667,23.5 206 | 2014-07-25,75.83333333333333,17.333333333333332,27.33333333333333,1005.6666666666666,12.926666666666668,0.0,0.0,66.20833333333333 207 | 2014-07-26,93.5,17.833333333333332,29.041666666666668,1007.8333333333334,14.990000000000002,0.0,0.0,75.83333333333333 208 | 2014-07-27,96.20833333333331,17.583333333333332,29.45833333333333,1007.9166666666666,27.94083333333333,0.0,0.0,93.5 209 | 2014-07-28,102.41666666666669,19.625,29.916666666666668,1003.875,41.33375,0.0,0.0,96.20833333333331 210 | 2014-07-29,107.75,20.541666666666668,29.666666666666668,1002.9166666666666,106.81291666666664,0.0,0.1666666666666666,102.41666666666669 211 | 2014-07-30,132.79166666666666,21.75,25.08333333333333,1005.25,22.80208333333333,0.0,1.2083333333333333,107.75 212 | 2014-07-31,179.875,22.33333333333333,27.125,1006.8333333333334,17.40416666666667,0.0,0.0,132.79166666666666 213 | 2014-08-01,132.66666666666666,22.58333333333333,27.916666666666668,1006.1666666666666,10.69625,0.0,0.0,179.875 214 | 2014-08-02,94.125,23.875,29.20833333333333,1003.125,4.224583333333334,0.0,0.0,132.66666666666666 215 | 2014-08-03,105.58333333333331,23.916666666666668,29.166666666666668,1000.875,2.735416666666667,0.0,0.0,94.125 216 | 2014-08-04,34.833333333333336,20.33333333333333,24.0,1004.0833333333334,7.730416666666666,0.0,0.7916666666666666,105.58333333333331 217 | 2014-08-05,21.70833333333333,18.08333333333333,25.166666666666668,1006.4583333333334,8.94375,0.0,0.0,34.833333333333336 218 | 2014-08-06,32.875,16.666666666666668,27.791666666666668,1007.0833333333334,9.482083333333334,0.0,0.0,21.70833333333333 219 | 2014-08-07,64.79166666666667,16.75,26.791666666666668,1008.875,10.334583333333333,0.0,0.0,32.875 220 | 2014-08-08,58.04166666666666,16.791666666666668,26.541666666666668,1008.4166666666666,16.822083333333335,0.0,0.0,64.79166666666667 221 | 2014-08-09,80.20833333333333,17.875,25.916666666666668,1005.875,17.84833333333333,0.0,0.125,58.04166666666666 222 | 2014-08-10,33.5,18.041666666666668,26.20833333333333,1002.875,5.085416666666666,0.0,0.0,80.20833333333333 223 | 2014-08-11,23.916666666666668,14.666666666666666,28.041666666666668,1004.0833333333334,8.047916666666666,0.0,0.0,33.5 224 | 2014-08-12,27.20833333333333,13.541666666666666,27.041666666666668,1005.5833333333334,3.782083333333334,0.0,0.0,23.916666666666668 225 | 2014-08-13,26.75,17.958333333333332,20.375,1008.1666666666666,2.811666666666667,0.0,2.875,27.20833333333333 226 | 2014-08-14,28.291666666666668,16.75,23.541666666666668,1007.5,8.828749999999998,0.0,0.0,26.75 227 | 2014-08-15,42.458333333333336,17.083333333333332,24.375,1006.375,3.0345833333333334,0.0,0.0,28.291666666666668 228 | 2014-08-16,60.5,18.166666666666668,26.375,1007.5,4.152083333333334,0.0,0.0,42.458333333333336 229 | 2014-08-17,51.375,17.833333333333332,25.916666666666668,1009.75,8.943749999999998,0.0,0.0,60.5 230 | 2014-08-18,58.333333333333336,17.875,25.5,1011.5833333333334,12.330416666666665,0.0,0.0,51.375 231 | 2014-08-19,77.25,18.25,26.70833333333333,1011.0,14.988333333333337,0.0,0.0,58.333333333333336 232 | 2014-08-20,89.46666666666665,18.75,27.375,1008.5,28.3325,0.0,0.0,77.25 233 | 2014-08-21,120.65833333333336,19.83333333333333,27.08333333333333,1006.9166666666666,10.170416666666668,0.0,0.0833333333333333,89.46666666666665 234 | 2014-08-22,54.333333333333336,19.08333333333333,24.666666666666668,1007.375,2.5316666666666667,0.0,0.0,120.65833333333336 235 | 2014-08-23,121.45833333333331,20.5,27.0,1005.0416666666666,4.57875,0.0,0.0416666666666666,54.333333333333336 236 | 2014-08-24,19.83333333333333,16.208333333333332,26.25,1006.8333333333334,6.8166666666666655,0.0,0.125,121.45833333333331 237 | 2014-08-25,15.75,12.5,26.041666666666668,1010.7916666666666,6.464166666666667,0.0,0.0,19.83333333333333 238 | 2014-08-26,22.041666666666668,10.166666666666666,26.666666666666668,1012.7083333333334,6.911666666666665,0.0,0.0,15.75 239 | 2014-08-27,55.208333333333336,13.833333333333334,26.041666666666668,1012.9583333333334,5.569166666666668,0.0,0.0,22.041666666666668 240 | 2014-08-28,84.16666666666667,17.375,24.125,1014.0833333333334,3.5004166666666667,0.0,0.9166666666666666,55.208333333333336 241 | 2014-08-29,85.0,18.666666666666668,22.625,1015.3333333333334,1.9725,0.0,0.125,84.16666666666667 242 | 2014-08-30,149.5,20.5,22.875,1014.625,2.084166666666667,0.0,0.125,85.0 243 | 2014-08-31,89.33333333333333,20.20833333333333,22.5,1012.9583333333334,3.035,0.0,0.3333333333333333,149.5 244 | 2014-09-01,115.16666666666669,20.33333333333333,22.08333333333333,1012.6666666666666,3.67,0.0,0.75,89.33333333333333 245 | 2014-09-02,26.625,18.75,20.33333333333333,1010.5416666666666,2.421666666666667,0.0,2.1666666666666665,115.16666666666669 246 | 2014-09-03,12.625,13.916666666666666,23.08333333333333,1009.2083333333334,8.568333333333335,0.0,0.0,26.625 247 | 2014-09-04,41.875,15.458333333333334,24.33333333333333,1004.9166666666666,7.672916666666665,0.0,0.0,12.625 248 | 2014-09-05,92.41666666666669,18.125,23.83333333333333,1009.2083333333334,14.847916666666665,0.0,0.0,41.875 249 | 2014-09-06,134.0,19.83333333333333,24.541666666666668,1010.8333333333334,9.91125,0.0,0.0,92.41666666666669 250 | 2014-09-07,143.83333333333334,19.58333333333333,24.95833333333333,1007.5833333333334,16.65458333333334,0.0,0.1666666666666666,134.0 251 | 2014-09-08,12.0,9.125,23.08333333333333,1009.9166666666666,7.114999999999999,0.0,0.0,143.83333333333334 252 | 2014-09-09,39.333333333333336,13.125,21.916666666666668,1009.875,6.799166666666667,0.0,0.0,12.0 253 | 2014-09-10,67.45833333333333,15.083333333333334,22.83333333333333,1013.5833333333334,9.982083333333334,0.0,0.0,39.333333333333336 254 | 2014-09-11,93.45833333333331,16.833333333333332,21.95833333333333,1013.8333333333334,3.3125,0.0,0.2083333333333333,67.45833333333333 255 | 2014-09-12,70.95833333333333,17.5,21.416666666666668,1014.625,4.692916666666666,0.0,0.25,93.45833333333331 256 | 2014-09-13,63.583333333333336,15.666666666666666,22.20833333333333,1014.2916666666666,12.776666666666666,0.0,0.0416666666666666,70.95833333333333 257 | 2014-09-14,45.91666666666666,11.333333333333334,19.916666666666668,1016.9583333333334,5.361666666666667,0.0,0.0,63.583333333333336 258 | 2014-09-15,18.58333333333333,5.5,20.45833333333333,1018.1666666666666,9.04875,0.0,0.0,45.91666666666666 259 | 2014-09-16,45.5625,10.416666666666666,17.416666666666668,1018.25,3.2591666666666668,0.0,0.0,18.58333333333333 260 | 2014-09-17,36.66666666666666,11.458333333333334,18.125,1020.2083333333334,4.861666666666667,0.0,0.0,45.5625 261 | 2014-09-18,68.75,10.166666666666666,19.541666666666668,1019.25,9.483333333333333,0.0,0.0,36.66666666666666 262 | 2014-09-19,94.875,13.791666666666666,18.541666666666668,1012.3333333333334,6.053749999999998,0.0,0.125,68.75 263 | 2014-09-20,135.16666666666666,16.458333333333332,21.08333333333333,1010.0416666666666,2.177916666666666,0.0,0.0,94.875 264 | 2014-09-21,96.125,15.083333333333334,21.20833333333333,1016.7916666666666,10.547916666666667,0.0,0.0,135.16666666666666 265 | 2014-09-22,106.875,17.041666666666668,20.166666666666668,1018.3333333333334,5.515,0.0,0.3333333333333333,96.125 266 | 2014-09-23,65.0625,17.083333333333332,18.041666666666668,1017.2916666666666,5.7175,0.0,11.5,106.875 267 | 2014-09-24,30.95833333333333,15.583333333333334,20.0,1016.125,4.916666666666667,0.0,0.8333333333333334,65.0625 268 | 2014-09-25,123.375,16.375,18.416666666666668,1016.2916666666666,3.11125,0.0,0.0,30.95833333333333 269 | 2014-09-26,137.83333333333334,16.416666666666668,18.916666666666668,1011.2916666666666,8.495833333333332,0.0,0.0416666666666666,123.375 270 | 2014-09-27,37.333333333333336,11.166666666666666,18.45833333333333,1015.875,3.427083333333334,0.0,0.0,137.83333333333334 271 | 2014-09-28,66.95833333333333,13.958333333333334,18.0,1016.125,6.33125,0.0,0.0,37.333333333333336 272 | 2014-09-29,54.375,8.666666666666666,17.791666666666668,1018.9583333333334,8.119583333333333,0.0,0.0,66.95833333333333 273 | 2014-09-30,26.125,2.2916666666666665,12.458333333333334,1026.0416666666667,10.826249999999996,0.0,0.0,54.375 274 | 2014-10-01,82.54166666666667,8.625,11.708333333333334,1016.4166666666666,4.674166666666666,0.0,2.75,26.125 275 | 2014-10-02,65.79166666666667,11.333333333333334,14.875,1013.0416666666666,6.523333333333334,0.0,0.0,82.54166666666667 276 | 2014-10-03,127.95833333333331,12.541666666666666,14.958333333333334,1017.375,2.306666666666666,0.0,0.1666666666666666,65.79166666666667 277 | 2014-10-04,86.66666666666667,13.416666666666666,14.625,1019.0416666666666,9.855,0.0,1.875,127.95833333333331 278 | 2014-10-05,35.5,7.041666666666667,15.125,1024.2916666666667,9.981666666666666,0.0,0.0,86.66666666666667 279 | 2014-10-06,33.833333333333336,4.166666666666667,13.333333333333334,1024.2916666666667,6.554999999999999,0.0,0.0,35.5 280 | 2014-10-07,143.83333333333334,8.666666666666666,13.5,1019.75,2.250833333333334,0.0,0.0,33.833333333333336 281 | 2014-10-08,305.2083333333333,12.041666666666666,14.833333333333334,1019.0416666666666,2.064166666666667,0.0,0.0416666666666666,143.83333333333334 282 | 2014-10-09,376.2916666666667,13.458333333333334,15.958333333333334,1019.4583333333334,1.4125000000000003,0.0,0.0,305.2083333333333 283 | 2014-10-10,325.375,14.0,16.708333333333332,1021.7916666666666,2.960833333333333,0.0,0.0,376.2916666666667 284 | 2014-10-11,197.58333333333331,12.541666666666666,16.958333333333332,1021.875,10.708750000000002,0.0,0.0,325.375 285 | 2014-10-12,6.833333333333333,0.625,14.791666666666666,1030.375,21.589583333333334,0.0,0.4166666666666667,197.58333333333331 286 | 2014-10-13,14.416666666666666,-3.458333333333333,9.791666666666666,1027.125,17.396666666666672,0.0,0.0,6.833333333333333 287 | 2014-10-14,48.5,1.0416666666666667,12.208333333333334,1019.1666666666666,7.800833333333334,0.0,0.0,14.416666666666666 288 | 2014-10-15,53.25,-1.4583333333333333,13.791666666666666,1015.375,31.526666666666667,0.0,0.0,48.5 289 | 2014-10-16,40.75,-1.3333333333333333,12.25,1020.8333333333334,17.53875,0.0,0.0,53.25 290 | 2014-10-17,112.33333333333331,4.541666666666667,13.25,1016.0,3.145416666666667,0.0,0.0,40.75 291 | 2014-10-18,203.45833333333331,8.291666666666666,14.833333333333334,1016.375,2.884583333333334,0.0,0.0,112.33333333333331 292 | 2014-10-19,284.1666666666667,12.041666666666666,16.291666666666668,1014.3333333333334,5.400416666666668,0.0,0.0,203.45833333333331 293 | 2014-10-20,215.08333333333331,12.416666666666666,14.833333333333334,1018.2083333333334,6.945833333333333,0.0,0.0,284.1666666666667 294 | 2014-10-21,45.25,0.625,11.916666666666666,1024.4583333333333,16.352083333333333,0.0,0.0,215.08333333333331 295 | 2014-10-22,92.125,4.833333333333333,10.083333333333334,1022.375,3.9995833333333337,0.0,0.0,45.25 296 | 2014-10-23,143.04166666666666,7.875,12.5,1015.125,1.7845833333333336,0.0,0.0,92.125 297 | 2014-10-24,261.4166666666667,9.833333333333334,12.166666666666666,1011.3333333333334,4.714583333333335,0.0,0.0,143.04166666666666 298 | 2014-10-25,366.375,11.416666666666666,13.416666666666666,1011.4166666666666,4.155,0.0,0.0,261.4166666666667 299 | 2014-10-26,87.54166666666667,-4.833333333333333,13.833333333333334,1023.875,26.763333333333325,0.0,0.0,366.375 300 | 2014-10-27,31.33333333333333,-7.708333333333333,9.916666666666666,1031.5833333333333,15.006666666666666,0.0,0.0,87.54166666666667 301 | 2014-10-28,67.54166666666667,2.125,9.125,1027.125,2.7895833333333333,0.0,0.0,31.33333333333333 302 | 2014-10-29,130.5,5.333333333333333,10.708333333333334,1024.0,2.9933333333333336,0.0,0.0,67.54166666666667 303 | 2014-10-30,190.29166666666663,7.208333333333333,12.208333333333334,1022.5833333333334,1.6550000000000002,0.0,0.125,130.5 304 | 2014-10-31,186.83333333333331,9.5,13.083333333333334,1020.4583333333334,2.717083333333333,0.0,0.1666666666666666,190.29166666666663 305 | 2014-11-01,50.29166666666666,-0.625,11.666666666666666,1019.2916666666666,27.54583333333333,0.0,0.0,186.83333333333331 306 | 2014-11-02,7.666666666666667,-10.0,10.833333333333334,1022.875,160.82333333333335,0.0,0.0,50.29166666666666 307 | 2014-11-03,25.375,-4.125,9.583333333458334,1020.125,4.448333333333334,0.0,0.0,7.666666666666667 308 | 2014-11-04,124.29166666666669,0.5,6.958333333333333,1015.625,3.0333333333333337,0.0,0.0,25.375 309 | 2014-11-05,79.875,-3.7083333333333335,11.125,1017.6666666666666,13.149583333333334,0.0,0.0,124.29166666666669 310 | 2014-11-06,13.666666666666666,-8.708333333333334,7.125,1029.5833333333333,20.6,0.0,0.0,79.875 311 | 2014-11-07,52.875,-4.083333333333333,4.666666666666667,1031.7083333333333,2.265,0.0,0.0,13.666666666666666 312 | 2014-11-08,78.33333333333333,-1.9583333333333333,4.833333333333333,1027.7916666666667,5.010416666666668,0.0,0.0,52.875 313 | 2014-11-09,65.0,-3.875,6.083333333333333,1025.375,7.524999999999998,0.0,0.0,78.33333333333333 314 | 2014-11-10,79.66666666666667,-3.7083333333333335,7.041666666666667,1021.5,5.366250000000001,0.0,0.0,65.0 315 | 2014-11-11,49.333333333333336,-5.875,8.583333333333334,1018.5833333333334,54.96916666666667,0.0,0.0,79.66666666666667 316 | 2014-11-12,6.416666666666667,-17.75,5.458333333333333,1025.3333333333333,211.0475,0.0,0.0,49.333333333333336 317 | 2014-11-13,26.0,-12.166666666666666,5.666666666666667,1024.9583333333333,11.584583333333336,0.0,0.0,6.416666666666667 318 | 2014-11-14,42.208333333333336,-10.208333333333334,4.708333333333333,1026.375,7.006666666666667,0.0,0.0,26.0 319 | 2014-11-15,168.16666666666666,-5.375,4.083333333333333,1027.6666666666667,2.9966666666666666,0.0,0.0,42.208333333333336 320 | 2014-11-16,122.375,-4.875,6.166666666666667,1026.0416666666667,28.66291666666667,0.0,0.0,168.16666666666666 321 | 2014-11-17,23.83333333333333,-8.916666666666666,6.291666666666667,1030.5833333333333,30.63874999999999,0.0,0.0,122.375 322 | 2014-11-18,85.16666666666667,-6.75,4.166666666666667,1029.0416666666667,5.84708333333333,0.0,0.0,23.83333333333333 323 | 2014-11-19,319.875,-2.0416666666666665,2.625,1023.0,1.506666666666667,0.0,0.0,85.16666666666667 324 | 2014-11-20,335.5993589743589,-0.5,2.833333333333333,1017.5416666666666,2.511666666666667,0.0,0.0,319.875 325 | 2014-11-21,169.15064102564102,-6.375,5.416666666666667,1020.625,5.7,0.0,0.0,335.5993589743589 326 | 2014-11-22,44.333333333333336,-8.875,5.083333333333333,1026.75,12.149583333333334,0.0,0.0,169.15064102564102 327 | 2014-11-23,128.04166666666666,0.2083333333333333,3.6666666666666665,1025.5,4.191666666666669,0.0,0.0,44.333333333333336 328 | 2014-11-24,96.125,-7.083333333333333,3.9583333333333335,1026.8333333333333,8.531666666666665,0.0,0.0,128.04166666666666 329 | 2014-11-25,173.16666666666666,-1.5833333333333333,3.208333333333333,1020.6666666666666,4.056666666666667,0.0,0.0,96.125 330 | 2014-11-26,302.1666666666667,-0.25,2.75,1016.4166666666666,2.305416666666667,0.0,0.0,173.16666666666666 331 | 2014-11-27,80.41666666666667,-12.666666666666666,5.5,1023.7083333333334,9.517916666666666,0.0,0.0,302.1666666666667 332 | 2014-11-28,95.375,-5.5,4.75,1020.7916666666666,13.615416666666668,0.0,0.0,80.41666666666667 333 | 2014-11-29,301.5416666666667,0.0416666666666666,1.9583333333333333,1020.6666666666666,3.611250000000001,0.0,0.0416666666666666,95.375 334 | 2014-11-30,91.41666666666669,-12.916666666666666,3.5,1023.2916666666666,65.90708333333333,0.0,0.0,301.5416666666667 335 | 2014-12-01,15.041666666666666,-22.375,-3.5416666666666665,1031.75,299.76250000000005,0.0,0.0,91.41666666666669 336 | 2014-12-02,51.79166666666666,-19.5,-5.0,1027.8333333333333,38.07124999999999,0.0,0.0,15.041666666666666 337 | 2014-12-03,25.375,-22.25,-2.7916666666666665,1026.625,53.08041666666668,0.0,0.0,51.79166666666666 338 | 2014-12-04,9.208333333333334,-22.416666666666668,-2.0,1027.375,60.92458333333334,0.0,0.0,25.375 339 | 2014-12-05,36.375,-20.25,-2.75,1027.2083333333333,14.563333333333338,0.0,0.0,9.208333333333334 340 | 2014-12-06,70.54166666666667,-16.541666666666668,-1.9583333333333333,1026.2916666666667,4.210833333333333,0.0,0.0,36.375 341 | 2014-12-07,55.25,-12.875,0.9166666666666666,1026.75,26.038750000000004,0.0,0.0,70.54166666666667 342 | 2014-12-08,71.10416666666667,-13.291666666666666,-2.1666666666666665,1033.875,7.44958333333333,0.0,0.0,55.25 343 | 2014-12-09,307.7291666666667,-8.583333333333334,-2.958333333333333,1033.8333333333333,2.2500000000000004,0.0,0.0,71.10416666666667 344 | 2014-12-10,142.95833333333334,-12.041666666666666,-0.25,1028.0,37.244166666666665,0.0416666666666666,0.0,307.7291666666667 345 | 2014-12-11,24.791666666666668,-17.041666666666668,0.0416666666666666,1031.2916666666667,63.77541666666667,0.0,0.0,142.95833333333334 346 | 2014-12-12,13.708333333333334,-18.791666666666668,-0.7916666666666666,1027.9583333333333,62.42708333333335,0.0,0.0,24.791666666666668 347 | 2014-12-13,46.583333333333336,-15.666666666666666,-2.9166666666666665,1028.125,3.2,0.0,0.0,13.708333333333334 348 | 2014-12-14,100.75,-14.875,-1.625,1026.0416666666667,4.248333333333334,0.0,0.0,46.583333333333336 349 | 2014-12-15,88.75,-16.541666666666668,-0.75,1028.25,67.06916666666667,0.0,0.0,100.75 350 | 2014-12-16,11.125,-19.45833333333333,-3.2916666666666665,1031.2916666666667,247.5483333333334,0.0,0.0,88.75 351 | 2014-12-17,97.70833333333331,-16.0,-2.9166666666666665,1028.7083333333333,29.870833333333323,0.0,0.0,11.125 352 | 2014-12-18,169.25,-10.083333333333334,-3.4166666666666665,1028.2916666666667,4.767500000000002,0.0,0.0,97.70833333333331 353 | 2014-12-19,77.66666666666667,-14.416666666666666,-0.2916666666666667,1024.8333333333333,72.06541666666668,0.0,0.0,169.25 354 | 2014-12-20,10.916666666666666,-18.58333333333333,-1.9583333333333333,1030.2083333333333,244.44374999999997,0.0,0.0,77.66666666666667 355 | 2014-12-21,18.5,-18.541666666666668,-1.7083333333333333,1027.5416666666667,304.14500000000004,0.0,0.0,10.916666666666666 356 | 2014-12-22,95.25,-13.375,-0.75,1023.3333333333334,4.31625,0.0,0.0,18.5 357 | 2014-12-23,101.875,-13.166666666666666,-0.1666666666666666,1020.875,10.973333333333334,0.0,0.0,95.25 358 | 2014-12-24,14.125,-14.416666666666666,0.8333333333333334,1031.5,26.39,0.0,0.0,101.875 359 | 2014-12-25,27.0,-13.125,0.5,1033.0833333333333,24.64166666666665,0.0,0.0,14.125 360 | 2014-12-26,170.25,-9.583333333333334,-2.7916666666666665,1031.7083333333333,2.0425,0.0,0.0,27.0 361 | 2014-12-27,238.66666666666663,-9.666666666666666,-1.7916666666666667,1027.8333333333333,9.278333333333332,0.0,0.0,170.25 362 | 2014-12-28,197.375,-10.791666666666666,1.5833333333333333,1019.9583333333334,10.94875,0.0,0.0,238.66666666666663 363 | 2014-12-29,159.0,-12.333333333333334,0.75,1013.75,8.0,0.0,0.0,197.375 364 | 2014-12-30,46.083333333333336,-13.916666666666666,1.875,1019.125,9.778333333333334,0.0,0.0,159.0 365 | 2014-12-31,10.041666666666666,-21.791666666666668,-1.9166666666666667,1032.125,167.45833333333334,0.0,0.0,46.083333333333336 366 | -------------------------------------------------------------------------------- /docs/setup.md: -------------------------------------------------------------------------------- 1 | # Setup python enviorment 2 | 3 | If you want to run the notebooks on your computer make sure you install the requirements.txt python dependencies. I recommend using virtual environments, you could set up one for this repository like this: 4 | 5 | 6 | Create the environment 7 | ``` 8 | conda create --name {YOURENVNAME} python=3.7 9 | ``` 10 | 11 | Activate the environment 12 | ``` 13 | conda activate {YOURENVNAME} 14 | ``` 15 | 16 | Install requirements dependencies 17 | 18 | ``` 19 | python -m pip install -r requirements.txt 20 | ``` 21 | 22 | 23 | Do you want to run this enviornment in your jupyter? You can add it as a kernel : 24 | 25 | ``` 26 | conda install -c anaconda ipykernel 27 | ``` 28 | 29 | ``` 30 | python -m ipykernel install --user --name={KERNELNAME} 31 | ``` 32 | 33 | The `{KERNELNAME}` should now appear on your jupyter kernel list! -------------------------------------------------------------------------------- /docs/stationary_vs_not.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiwidi/time-series-forecasting-with-python/3a9133af1a32c8065868f6017501a4ea65b6c04c/docs/stationary_vs_not.png -------------------------------------------------------------------------------- /environment.yml: -------------------------------------------------------------------------------- 1 | name: time 2 | channels: 3 | - anaconda 4 | - defaults 5 | dependencies: 6 | - appnope=0.1.0=py37_0 7 | - backcall=0.2.0=py_0 8 | - ca-certificates=2020.10.14=0 9 | - certifi=2020.6.20=py37_0 10 | - decorator=4.4.2=py_0 11 | - ipykernel=5.3.4=py37h5ca1d4c_0 12 | - ipython=7.18.1=py37h5ca1d4c_0 13 | - ipython_genutils=0.2.0=py37_0 14 | - jedi=0.18.0=py37hecd8cb5_1 15 | - jupyter_client=6.1.7=py_0 16 | - jupyter_core=4.6.3=py37_0 17 | - libcxx=10.0.0=1 18 | - libffi=3.3=hb1e8313_2 19 | - libsodium=1.0.18=h1de35cc_0 20 | - ncurses=6.2=h0a44026_1 21 | - openssl=1.1.1k=h9ed2024_0 22 | - parso=0.8.0=py_0 23 | - pexpect=4.8.0=py37_0 24 | - pickleshare=0.7.5=py37_0 25 | - pip=21.0.1=py37hecd8cb5_0 26 | - prompt-toolkit=3.0.8=py_0 27 | - ptyprocess=0.6.0=py37_0 28 | - pygments=2.7.1=py_0 29 | - python=3.7.10=h88f2d9e_0 30 | - pyzmq=19.0.2=py37hb1e8313_1 31 | - readline=8.1=h9ed2024_0 32 | - setuptools=52.0.0=py37hecd8cb5_0 33 | - six=1.15.0=py_0 34 | - sqlite=3.35.4=hce871da_0 35 | - tk=8.6.10=hb0a8c7a_0 36 | - tornado=6.0.4=py37h1de35cc_1 37 | - traitlets=5.0.5=py_0 38 | - wcwidth=0.2.5=py_0 39 | - wheel=0.36.2=pyhd3eb1b0_0 40 | - xz=5.2.5=h1de35cc_0 41 | - zeromq=4.3.3=hb1e8313_3 42 | - zlib=1.2.11=h1de35cc_3 43 | - pip: 44 | - absl-py==0.12.0 45 | - astunparse==1.6.3 46 | - attrs==21.2.0 47 | - autoflake==1.4 48 | - autopep8==1.5.7 49 | - bayesian-optimization==1.2.0 50 | - beautifultable==1.0.0 51 | - cachetools==4.2.2 52 | - chardet==3.0.4 53 | - cleanipynb==0.4.2 54 | - cloudpickle==1.6.0 55 | - cmdstanpy==0.9.5 56 | - convertdate==2.3.2 57 | - cycler==0.10.0 58 | - cython==0.29.17 59 | - ephem==3.7.7.1 60 | - fbprophet==0.7 61 | - flatbuffers==1.12 62 | - gast==0.3.3 63 | - gluonts==0.6.0 64 | - google-auth==1.30.0 65 | - google-auth-oauthlib==0.4.4 66 | - google-pasta==0.2.0 67 | - grpcio==1.32.0 68 | - h5py==2.10.0 69 | - hijri-converter==2.1.1 70 | - holidays==0.11.1 71 | - idna==2.10 72 | - importanize==0.7.0 73 | - importlib-metadata==4.0.1 74 | - jinja2==2.11.0 75 | - joblib==1.0.1 76 | - jsonschema==3.2.0 77 | - jupytext==1.11.2 78 | - keras-preprocessing==1.1.2 79 | - kiwisolver==1.3.1 80 | - korean-lunar-calendar==0.2.1 81 | - lightgbm==3.2.0 82 | - llvmlite==0.36.0 83 | - lunarcalendar==0.0.9 84 | - markdown==3.3.4 85 | - markdown-it-py==1.1.0 86 | - markupsafe==1.1.1 87 | - matplotlib==3.4.0 88 | - mdit-py-plugins==0.2.8 89 | - mxnet==1.8.0.post0 90 | - nbformat==5.1.3 91 | - numba==0.53.1 92 | - numpy==1.19.5 93 | - oauthlib==3.1.0 94 | - opt-einsum==3.3.0 95 | - pandas==1.2.0 96 | - pathlib2==2.3.5 97 | - patsy==0.5.1 98 | - pillow==8.2.0 99 | - pmdarima==1.8.0 100 | - protobuf==3.16.0 101 | - pyasn1==0.4.8 102 | - pyasn1-modules==0.2.8 103 | - pycodestyle==2.7.0 104 | - pydantic==1.4 105 | - pyflakes==2.3.1 106 | - pymeeus==0.5.11 107 | - pyparsing==2.4.7 108 | - pyrsistent==0.17.3 109 | - pystan==2.19.1.1 110 | - python-dateutil==2.8.0 111 | - python-graphviz==0.8.4 112 | - pytz==2021.1 113 | - pyyaml==5.4.1 114 | - requests==2.25.0 115 | - requests-oauthlib==1.3.0 116 | - rsa==4.7.2 117 | - scikit-learn==0.24.0 118 | - scipy==1.4.0 119 | - setuptools-git==1.2 120 | - shap==0.39.0 121 | - slicer==0.0.7 122 | - statsmodels==0.12.1 123 | - tabulate==0.8.0 124 | - tensorboard==2.5.0 125 | - tensorboard-data-server==0.6.1 126 | - tensorboard-plugin-wit==1.8.0 127 | - tensorflow==2.4.0 128 | - tensorflow-estimator==2.4.0 129 | - termcolor==1.1.0 130 | - threadpoolctl==2.1.0 131 | - toml==0.10.2 132 | - toolz==0.11.1 133 | - tqdm==4.59.0 134 | - typing-extensions==3.7.4.3 135 | - ujson==1.35 136 | - urllib3==1.26.4 137 | - werkzeug==1.0.1 138 | - wrapt==1.12.1 139 | - xgboost==1.1.0 140 | - zipp==3.4.1 141 | prefix: /Users/jaimeferrando/miniconda3/envs/time 142 | -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | tqdm==4.59 2 | pydantic==1.6.2 3 | pystan==2.19.1.1 4 | requests==2.25 5 | xgboost==1.1 6 | fbprophet==0.7 7 | lightgbm==3.2 8 | bayesian-optimization==1.2 9 | pandas==1.2 10 | holidays==0.11.1 11 | python-dateutil==2.8.0 12 | numpy 13 | scipy==1.4 14 | mxnet~=1.8 15 | gluonts==0.6 16 | tensorflow==2.7.2 17 | scikit-learn==0.24 18 | matplotlib==3.4 19 | statsmodels==0.12.1 20 | beautifultable==1.0 21 | tabulate==0.8 22 | pmdarima==1.8 23 | shap==0.39 24 | Jinja2==2.11.3 -------------------------------------------------------------------------------- /results/beijing.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiwidi/time-series-forecasting-with-python/3a9133af1a32c8065868f6017501a4ea65b6c04c/results/beijing.jpg -------------------------------------------------------------------------------- /results/metrics.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiwidi/time-series-forecasting-with-python/3a9133af1a32c8065868f6017501a4ea65b6c04c/results/metrics.png -------------------------------------------------------------------------------- /results/pollution.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiwidi/time-series-forecasting-with-python/3a9133af1a32c8065868f6017501a4ea65b6c04c/results/pollution.png -------------------------------------------------------------------------------- /results/predictions.pickle: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiwidi/time-series-forecasting-with-python/3a9133af1a32c8065868f6017501a4ea65b6c04c/results/predictions.pickle -------------------------------------------------------------------------------- /results/results_summary.csv: -------------------------------------------------------------------------------- 1 | ,mae,rmse,mape,r2 2 | EnsembleXG+TF,27.64,40.23,0.42,0.76 3 | EnsembleLIGHT+TF,27.34,39.27,0.42,0.77 4 | EnsembleXG+LIGHT+TF,27.63,39.69,0.44,0.76 5 | EnsembleXG+LIGHT,29.95,42.7,0.52,0.73 6 | Randomforest tunned,40.79,53.2,0.9,0.57 7 | SVM RBF GRID SEARCH,38.57,50.34,0.78,0.62 8 | DeepAR,71.37,103.97,0.96,-0.63 9 | Tensorflow simple LSTM,30.13,43.08,0.42,0.72 10 | Prophet multivariate,38.25,50.45,0.74,0.62 11 | Kneighbors,57.05,80.39,1.08,0.03 12 | SVM RBF,40.81,56.03,0.79,0.53 13 | Lightgbm,30.21,42.76,0.52,0.72 14 | XGBoost,32.13,45.59,0.56,0.69 15 | Randomforest,45.84,59.45,1.03,0.47 16 | Lasso,39.24,54.58,0.71,0.55 17 | BayesianRidge,39.24,54.63,0.71,0.55 18 | Prophet univariate,61.33,83.64,1.26,-0.05 19 | "AutoSARIMAX (1, 0, 1),(0, 0, 0, 6)",51.29,71.49,0.91,0.23 20 | SARIMAX,51.25,71.33,0.91,0.23 21 | "AutoARIMA (0, 0, 3)",47.01,64.71,1.0,0.37 22 | ARIMA,48.25,66.39,1.06,0.34 23 | ARMA,47.1,64.86,1.01,0.37 24 | MA,49.04,66.2,1.05,0.34 25 | AR,47.24,65.32,1.02,0.36 26 | HWES,52.96,74.67,1.11,0.16 27 | SES,52.96,74.67,1.11,0.16 28 | Yesterdays value,52.67,74.52,1.04,0.16 29 | Naive mean,59.38,81.44,1.32,-0.0 30 | -------------------------------------------------------------------------------- /results/results_summary.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 |
maermsemaper2
EnsembleXG+TF27.6440.230.420.76
EnsembleLIGHT+TF27.3439.270.420.77
EnsembleXG+LIGHT+TF27.6339.690.440.76
EnsembleXG+LIGHT29.9542.700.520.73
Randomforest tunned40.7953.200.900.57
SVM RBF GRID SEARCH38.5750.340.780.62
DeepAR71.37103.970.96-0.63
Tensorflow simple LSTM30.1343.080.420.72
Prophet multivariate38.2550.450.740.62
Kneighbors57.0580.391.080.03
SVM RBF40.8156.030.790.53
Lightgbm30.2142.760.520.72
XGBoost32.1345.590.560.69
Randomforest45.8459.451.030.47
Lasso39.2454.580.710.55
BayesianRidge39.2454.630.710.55
Prophet univariate61.3383.641.26-0.05
AutoSARIMAX (1, 0, 1),(0, 0, 0, 6)51.2971.490.910.23
SARIMAX51.2571.330.910.23
AutoARIMA (0, 0, 3)47.0164.711.000.37
ARIMA48.2566.391.060.34
ARMA47.1064.861.010.37
MA49.0466.201.050.34
AR47.2465.321.020.36
HWES52.9674.671.110.16
SES52.9674.671.110.16
Yesterdays value52.6774.521.040.16
Naive mean59.3881.441.32-0.00
-------------------------------------------------------------------------------- /results/scores.pickle: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiwidi/time-series-forecasting-with-python/3a9133af1a32c8065868f6017501a4ea65b6c04c/results/scores.pickle -------------------------------------------------------------------------------- /utils/__pycache__/metrics.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiwidi/time-series-forecasting-with-python/3a9133af1a32c8065868f6017501a4ea65b6c04c/utils/__pycache__/metrics.cpython-36.pyc -------------------------------------------------------------------------------- /utils/metrics.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | from sklearn.metrics import r2_score 3 | 4 | EPSILON = 1e-10 5 | 6 | 7 | def _error(actual: np.ndarray, predicted: np.ndarray): 8 | """Simple error""" 9 | return actual - predicted 10 | 11 | 12 | def _percentage_error(actual: np.ndarray, predicted: np.ndarray): 13 | """ 14 | Percentage error 15 | 16 | Note: result is NOT multiplied by 100 17 | """ 18 | return _error(actual, predicted) / (actual + EPSILON) 19 | 20 | 21 | def _naive_forecasting(actual: np.ndarray, seasonality: int = 1): 22 | """Naive forecasting method which just repeats previous samples""" 23 | return actual[:-seasonality] 24 | 25 | 26 | def _relative_error( 27 | actual: np.ndarray, predicted: np.ndarray, benchmark: np.ndarray = None 28 | ): 29 | """Relative Error""" 30 | if benchmark is None or isinstance(benchmark, int): 31 | # If no benchmark prediction provided - use naive forecasting 32 | if not isinstance(benchmark, int): 33 | seasonality = 1 34 | else: 35 | seasonality = benchmark 36 | return _error(actual[seasonality:], predicted[seasonality:]) / ( 37 | _error(actual[seasonality:], _naive_forecasting(actual, seasonality)) 38 | + EPSILON 39 | ) 40 | 41 | return _error(actual, predicted) / (_error(actual, benchmark) + EPSILON) 42 | 43 | 44 | def _bounded_relative_error( 45 | actual: np.ndarray, predicted: np.ndarray, benchmark: np.ndarray = None 46 | ): 47 | """Bounded Relative Error""" 48 | if benchmark is None or isinstance(benchmark, int): 49 | # If no benchmark prediction provided - use naive forecasting 50 | if not isinstance(benchmark, int): 51 | seasonality = 1 52 | else: 53 | seasonality = benchmark 54 | 55 | abs_err = np.abs(_error(actual[seasonality:], predicted[seasonality:])) 56 | abs_err_bench = np.abs( 57 | _error(actual[seasonality:], _naive_forecasting(actual, seasonality)) 58 | ) 59 | else: 60 | abs_err = np.abs(_error(actual, predicted)) 61 | abs_err_bench = np.abs(_error(actual, benchmark)) 62 | 63 | return abs_err / (abs_err + abs_err_bench + EPSILON) 64 | 65 | 66 | def _geometric_mean(a, axis=0, dtype=None): 67 | """Geometric mean""" 68 | if not isinstance(a, np.ndarray): # if not an ndarray object attempt to convert it 69 | log_a = np.log(np.array(a, dtype=dtype)) 70 | elif dtype: # Must change the default dtype allowing array type 71 | if isinstance(a, np.ma.MaskedArray): 72 | log_a = np.log(np.ma.asarray(a, dtype=dtype)) 73 | else: 74 | log_a = np.log(np.asarray(a, dtype=dtype)) 75 | else: 76 | log_a = np.log(a) 77 | return np.exp(log_a.mean(axis=axis)) 78 | 79 | 80 | def mse(actual: np.ndarray, predicted: np.ndarray): 81 | """Mean Squared Error""" 82 | return np.mean(np.square(_error(actual, predicted))) 83 | 84 | 85 | def rmse(actual: np.ndarray, predicted: np.ndarray): 86 | """Root Mean Squared Error""" 87 | return np.sqrt(mse(actual, predicted)) 88 | 89 | 90 | def nrmse(actual: np.ndarray, predicted: np.ndarray): 91 | """Normalized Root Mean Squared Error""" 92 | return rmse(actual, predicted) / (actual.max() - actual.min()) 93 | 94 | 95 | def me(actual: np.ndarray, predicted: np.ndarray): 96 | """Mean Error""" 97 | return np.mean(_error(actual, predicted)) 98 | 99 | 100 | def mae(actual: np.ndarray, predicted: np.ndarray): 101 | """Mean Absolute Error""" 102 | return np.mean(np.abs(_error(actual, predicted))) 103 | 104 | 105 | mad = mae # Mean Absolute Deviation (it is the same as MAE) 106 | 107 | 108 | def gmae(actual: np.ndarray, predicted: np.ndarray): 109 | """Geometric Mean Absolute Error""" 110 | return _geometric_mean(np.abs(_error(actual, predicted))) 111 | 112 | 113 | def mdae(actual: np.ndarray, predicted: np.ndarray): 114 | """Median Absolute Error""" 115 | return np.median(np.abs(_error(actual, predicted))) 116 | 117 | 118 | def mpe(actual: np.ndarray, predicted: np.ndarray): 119 | """Mean Percentage Error""" 120 | return np.mean(_percentage_error(actual, predicted)) 121 | 122 | 123 | def mape(actual: np.ndarray, predicted: np.ndarray): 124 | """ 125 | Mean Absolute Percentage Error 126 | 127 | Properties: 128 | + Easy to interpret 129 | + Scale independent 130 | - Biased, not symmetric 131 | - Undefined when actual[t] == 0 132 | 133 | Note: result is NOT multiplied by 100 134 | """ 135 | return np.mean(np.abs(_percentage_error(actual, predicted))) 136 | 137 | 138 | def mdape(actual: np.ndarray, predicted: np.ndarray): 139 | """ 140 | Median Absolute Percentage Error 141 | 142 | Note: result is NOT multiplied by 100 143 | """ 144 | return np.median(np.abs(_percentage_error(actual, predicted))) 145 | 146 | 147 | def smape(actual: np.ndarray, predicted: np.ndarray): 148 | """ 149 | Symmetric Mean Absolute Percentage Error 150 | 151 | Note: result is NOT multiplied by 100 152 | """ 153 | return np.mean( 154 | 2.0 155 | * np.abs(actual - predicted) 156 | / ((np.abs(actual) + np.abs(predicted)) + EPSILON) 157 | ) 158 | 159 | 160 | def smdape(actual: np.ndarray, predicted: np.ndarray): 161 | """ 162 | Symmetric Median Absolute Percentage Error 163 | 164 | Note: result is NOT multiplied by 100 165 | """ 166 | return np.median( 167 | 2.0 168 | * np.abs(actual - predicted) 169 | / ((np.abs(actual) + np.abs(predicted)) + EPSILON) 170 | ) 171 | 172 | 173 | def maape(actual: np.ndarray, predicted: np.ndarray): 174 | """ 175 | Mean Arctangent Absolute Percentage Error 176 | 177 | Note: result is NOT multiplied by 100 178 | """ 179 | return np.mean(np.arctan(np.abs((actual - predicted) / (actual + EPSILON)))) 180 | 181 | 182 | def mase(actual: np.ndarray, predicted: np.ndarray, seasonality: int = 1): 183 | """ 184 | Mean Absolute Scaled Error 185 | 186 | Baseline (benchmark) is computed with naive forecasting (shifted by @seasonality) 187 | """ 188 | return mae(actual, predicted) / mae( 189 | actual[seasonality:], _naive_forecasting(actual, seasonality) 190 | ) 191 | 192 | 193 | def std_ae(actual: np.ndarray, predicted: np.ndarray): 194 | """Normalized Absolute Error""" 195 | __mae = mae(actual, predicted) 196 | return np.sqrt( 197 | np.sum(np.square(_error(actual, predicted) - __mae)) / (len(actual) - 1) 198 | ) 199 | 200 | 201 | def std_ape(actual: np.ndarray, predicted: np.ndarray): 202 | """Normalized Absolute Percentage Error""" 203 | __mape = mape(actual, predicted) 204 | return np.sqrt( 205 | np.sum(np.square(_percentage_error(actual, predicted) - __mape)) 206 | / (len(actual) - 1) 207 | ) 208 | 209 | 210 | def rmspe(actual: np.ndarray, predicted: np.ndarray): 211 | """ 212 | Root Mean Squared Percentage Error 213 | 214 | Note: result is NOT multiplied by 100 215 | """ 216 | return np.sqrt(np.mean(np.square(_percentage_error(actual, predicted)))) 217 | 218 | 219 | def rmdspe(actual: np.ndarray, predicted: np.ndarray): 220 | """ 221 | Root Median Squared Percentage Error 222 | 223 | Note: result is NOT multiplied by 100 224 | """ 225 | return np.sqrt(np.median(np.square(_percentage_error(actual, predicted)))) 226 | 227 | 228 | def rmsse(actual: np.ndarray, predicted: np.ndarray, seasonality: int = 1): 229 | """Root Mean Squared Scaled Error""" 230 | q = np.abs(_error(actual, predicted)) / mae( 231 | actual[seasonality:], _naive_forecasting(actual, seasonality) 232 | ) 233 | return np.sqrt(np.mean(np.square(q))) 234 | 235 | 236 | def inrse(actual: np.ndarray, predicted: np.ndarray): 237 | """Integral Normalized Root Squared Error""" 238 | return np.sqrt( 239 | np.sum(np.square(_error(actual, predicted))) 240 | / np.sum(np.square(actual - np.mean(actual))) 241 | ) 242 | 243 | 244 | def rrse(actual: np.ndarray, predicted: np.ndarray): 245 | """Root Relative Squared Error""" 246 | return np.sqrt( 247 | np.sum(np.square(actual - predicted)) 248 | / np.sum(np.square(actual - np.mean(actual))) 249 | ) 250 | 251 | 252 | def mre(actual: np.ndarray, predicted: np.ndarray, benchmark: np.ndarray = None): 253 | """Mean Relative Error""" 254 | return np.mean(_relative_error(actual, predicted, benchmark)) 255 | 256 | 257 | def rae(actual: np.ndarray, predicted: np.ndarray): 258 | """Relative Absolute Error (aka Approximation Error)""" 259 | return np.sum(np.abs(actual - predicted)) / ( 260 | np.sum(np.abs(actual - np.mean(actual))) + EPSILON 261 | ) 262 | 263 | 264 | def mrae(actual: np.ndarray, predicted: np.ndarray, benchmark: np.ndarray = None): 265 | """Mean Relative Absolute Error""" 266 | return np.mean(np.abs(_relative_error(actual, predicted, benchmark))) 267 | 268 | 269 | def mdrae(actual: np.ndarray, predicted: np.ndarray, benchmark: np.ndarray = None): 270 | """Median Relative Absolute Error""" 271 | return np.median(np.abs(_relative_error(actual, predicted, benchmark))) 272 | 273 | 274 | def gmrae(actual: np.ndarray, predicted: np.ndarray, benchmark: np.ndarray = None): 275 | """Geometric Mean Relative Absolute Error""" 276 | return _geometric_mean(np.abs(_relative_error(actual, predicted, benchmark))) 277 | 278 | 279 | def mbrae(actual: np.ndarray, predicted: np.ndarray, benchmark: np.ndarray = None): 280 | """Mean Bounded Relative Absolute Error""" 281 | return np.mean(_bounded_relative_error(actual, predicted, benchmark)) 282 | 283 | 284 | def umbrae(actual: np.ndarray, predicted: np.ndarray, benchmark: np.ndarray = None): 285 | """Unscaled Mean Bounded Relative Absolute Error""" 286 | __mbrae = mbrae(actual, predicted, benchmark) 287 | return __mbrae / (1 - __mbrae) 288 | 289 | 290 | def mda(actual: np.ndarray, predicted: np.ndarray): 291 | """Mean Directional Accuracy""" 292 | return np.mean( 293 | ( 294 | np.sign(actual[1:] - actual[:-1]) == np.sign(predicted[1:] - predicted[:-1]) 295 | ).astype(int) 296 | ) 297 | 298 | 299 | def bias(actual: np.ndarray, predicted: np.ndarray): 300 | """Mean forecast error(or Forecast Bias)""" 301 | return np.mean(actual - predicted) 302 | 303 | 304 | METRICS = { 305 | "mse": mse, 306 | "rmse": rmse, 307 | "nrmse": nrmse, 308 | "me": me, 309 | "mae": mae, 310 | "mad": mad, 311 | "gmae": gmae, 312 | "mdae": mdae, 313 | "mpe": mpe, 314 | "mape": mape, 315 | "mdape": mdape, 316 | "smape": smape, 317 | "smdape": smdape, 318 | "maape": maape, 319 | "mase": mase, 320 | "std_ae": std_ae, 321 | "std_ape": std_ape, 322 | "rmspe": rmspe, 323 | "rmdspe": rmdspe, 324 | "rmsse": rmsse, 325 | "inrse": inrse, 326 | "rrse": rrse, 327 | "mre": mre, 328 | "rae": rae, 329 | "mrae": mrae, 330 | "mdrae": mdrae, 331 | "gmrae": gmrae, 332 | "mbrae": mbrae, 333 | "umbrae": umbrae, 334 | "mda": mda, 335 | "bias": bias, 336 | "r2": r2_score, 337 | } 338 | 339 | 340 | def evaluate( 341 | actual: np.ndarray, predicted: np.ndarray, metrics=("mae", "rmse", "mape", "r2") 342 | ): 343 | results = {} 344 | for name in metrics: 345 | try: 346 | results[name] = METRICS[name](actual, predicted) 347 | except Exception as err: 348 | results[name] = np.nan 349 | print("Unable to compute metric {0}: {1}".format(name, err)) 350 | return results 351 | 352 | 353 | def evaluate_all(actual: np.ndarray, predicted: np.ndarray): 354 | return evaluate(actual, predicted, metrics=set(METRICS.keys())) 355 | -------------------------------------------------------------------------------- /utils/plots.py: -------------------------------------------------------------------------------- 1 | import matplotlib.pyplot as plt 2 | import pandas as pd 3 | 4 | 5 | def bar_metrics(resultsDict): 6 | df = pd.DataFrame.from_dict(resultsDict) 7 | colors = plt.rcParams["axes.prop_cycle"].by_key()["color"] 8 | pallette = plt.cm.get_cmap("tab20c", len(df.columns)) 9 | colors = [pallette(x) for x in range(len(df.columns))] 10 | color_dict = dict(zip(df.columns, colors)) 11 | fig = plt.figure(figsize=(20, 15)) 12 | 13 | # MAE plot 14 | fig.add_subplot(2, 2, 1) 15 | df.loc["mae"].sort_values().plot( 16 | kind="bar", 17 | colormap="Paired", 18 | color=[color_dict.get(x, "#333333") for x in df.loc["mae"].sort_values().index], 19 | ) 20 | plt.legend() 21 | plt.title("MAE Metric, lower is better") 22 | fig.add_subplot(2, 2, 2) 23 | df.loc["rmse"].sort_values().plot( 24 | kind="bar", 25 | colormap="Paired", 26 | color=[ 27 | color_dict.get(x, "#333333") for x in df.loc["rmse"].sort_values().index 28 | ], 29 | ) 30 | plt.legend() 31 | plt.title("RMSE Metric, lower is better") 32 | fig.add_subplot(2, 2, 3) 33 | df.loc["mape"].sort_values().plot( 34 | kind="bar", 35 | colormap="Paired", 36 | color=[ 37 | color_dict.get(x, "#333333") for x in df.loc["mape"].sort_values().index 38 | ], 39 | ) 40 | plt.legend() 41 | plt.title("MAPE Metric, lower is better") 42 | fig.add_subplot(2, 2, 4) 43 | df.loc["r2"].sort_values(ascending=False).plot( 44 | kind="bar", 45 | colormap="Paired", 46 | color=[ 47 | color_dict.get(x, "#333333") 48 | for x in df.loc["r2"].sort_values(ascending=False).index 49 | ], 50 | ) 51 | plt.legend() 52 | plt.title("R2 Metric, higher is better") 53 | plt.tight_layout() 54 | plt.savefig("results/metrics.png") 55 | plt.show() 56 | --------------------------------------------------------------------------------