Forecasting East and West Coast Gasoline Prices with Tree-Based Machine Learning Algorithms
Abstract
:1. Introduction
2. Literature Review
3. Methodology and Data
3.1. Machine Learning
3.2. Decision Trees
3.3. Random Forest
3.4. XGBoost
3.5. Variable Importance Measure
3.6. Overfit
3.7. The Dataset
4. Empirical Results
5. Conclusions
Author Contributions
Funding
Data Availability Statement
Conflicts of Interest
Appendix A
Name | Description |
---|---|
Date | the date that we ran the model for our prediction (t0) |
DAAA | Moody’s Seasoned Aaa Corporate Bond Yield |
DBAA | Moody’s Seasoned Baa Corporate Bond Yield |
DFII5 | Market Yield on U.S. Treasury Securities at 5-Year Constant Maturity, Quoted on an Investment Basis, Inflation-Indexed |
DFII7 | Market Yield on U.S. Treasury Securities at 7-Year Constant Maturity, Quoted on an Investment Basis, Inflation-Indexed |
DFII10 | Market Yield on U.S. Treasury Securities at 10-Year Constant Maturity, Quoted on an Investment Basis, Inflation-Indexed |
DGS1 | Market Yield on U.S. Treasury Securities at 1-Year Constant Maturity, Quoted on an Investment Basis |
DGS1MO | Market Yield on U.S. Treasury Securities at 1-Month Constant Maturity, Quoted on an Investment Basis |
DGS2 | Market Yield on U.S. Treasury Securities at 2-Year Constant Maturity, Quoted on an Investment Basis |
DGS3 | Market Yield on U.S. Treasury Securities at 3-Year Constant Maturity, Quoted on an Investment Basis |
DGS3MO | Market Yield on U.S. Treasury Securities at 3-Month Constant Maturity, Quoted on an Investment Basis |
DGS5 | Market Yield on U.S. Treasury Securities at 5-Year Constant Maturity, Quoted on an Investment Basis |
DGS6MO | Market Yield on U.S. Treasury Securities at 6-Month Constant Maturity, Quoted on an Investment Basis |
DGS7 | Market Yield on U.S. Treasury Securities at 7-Year Constant Maturity, Quoted on an Investment Basis |
DGS10 | Market Yield on U.S. Treasury Securities at 10-Year Constant Maturity, Quoted on an Investment Basis |
DGS20 | Market Yield on U.S. Treasury Securities at 20-Year Constant Maturity, Quoted on an Investment Basis |
DGS30 | Market Yield on U.S. Treasury Securities at 30-Year Constant Maturity, Quoted on an Investment Basis |
DLTIIT | Treasury Long-Term Average (Over 10 Years), Inflation-Indexed |
DTB3 | 3-Month Treasury Bill Secondary Market Rate, Discount Basis |
DTB4WK | 4-Week Treasury Bill Secondary Market Rate, Discount Basis |
DTB6 | 6-Month Treasury Bill Secondary Market Rate, Discount Basis |
NGSP | Henry Hub Natural Gas Spot Price (Dollars per Million Btu) |
NGFP1 | Natural Gas Futures Contract 1 (Dollars per Million Btu) |
NGFP2 | Natural Gas Futures Contract 2 (Dollars per Million Btu) |
NGFP3 | Natural Gas Futures Contract 3 (Dollars per Million Btu) |
NGFP4 | Natural Gas Futures Contract 4 (Dollars per Million Btu) |
COFC1 | Cushing, OK Crude Oil Future Contract 1 (Dollars per Barrel) |
COFC2 | Cushing, OK Crude Oil Future Contract 2 (Dollars per Barrel) |
COFC3 | Cushing, OK Crude Oil Future Contract 3 (Dollars per Barrel) |
COFC4 | Cushing, OK Crude Oil Future Contract 4 (Dollars per Barrel) |
HOFC1 | New York Harbor No. 2 Heating Oil Future Contract 1 (Dollars per Gallon) |
HOFC2 | New York Harbor No. 2 Heating Oil Future Contract 2 (Dollars per Gallon) |
HOFC3 | New York Harbor No. 2 Heating Oil Future Contract 3 (Dollars per Gallon) |
HOFC4 | New York Harbor No. 2 Heating Oil Future Contract 4 (Dollars per Gallon) |
WTISP | Cushing, OK WTI Spot Price FOB (Dollars per Barrel) |
BRENTSP | Europe Brent Spot Price FOB (Dollars per Barrel) |
NYGSP | New York Harbor Conventional Gasoline Regular Spot Price FOB (Dollars per Gallon) |
GCGSP | U.S. Gulf Coast Conventional Gasoline Regular Spot Price FOB (Dollars per Gallon) |
LAGSP | Los Angeles Reformulated RBOB Regular Gasoline Spot Price (Dollars per Gallon) |
NYHOSP | New York Harbor No. 2 Heating Oil Spot Price FOB (Dollars per Gallon) |
LADSP | Los Angeles, CA Ultra-Low Sulfur CARB Diesel Spot Price (Dollars per Gallon) |
GCKRP | U.S. Gulf Coast Kerosene-Type Jet Fuel Spot Price FOB (Dollars per Gallon) |
MBPSP | Mont Belvieu, TX Propane Spot Price FOB (Dollars per Gallon) |
AEDUSD=X | AED/USD |
BP | BP p.l.c. |
CC=F | Cocoa, March 23 |
CNY=X | USD/CNY |
COP | ConocoPhillips |
CT=F | Cotton, March 23 |
CVX | Chevron Corporation |
ENB | Enbridge Inc. |
EQNR | Equinor ASA |
ES=F | E-Mini S&P 500, December 22 |
EURCAD=X | EUR/CAD |
EURUSD=X | EUR/USD |
GBPUSD=X | GBP/USD |
GC=F | Gold |
GF=F | Feeder Cattle Futures, January 2023 |
HE=F | Lean Hogs Futures, December 2022 |
HG=F | Copper, December 22 |
HKD=X | USD/HKD |
INR=X | USD/INR |
JPY=X | USD/JPY |
KC=F | Coffee, March 23 |
KE=F | KC HRW Wheat Futures, March 2023 |
LBS=F | Lumber, January 23 |
LE=F | Live Cattle Futures, December 2022 |
NQ=F | Nasdaq 100 December 22 |
NZDUSD=X | NZD/USD |
PA=F | Palladium, March 23 |
PBR | Petróleo Brasileiro S.A.—Petrobras |
PBR-A | Petróleo Brasileiro S.A.—Petrobras |
PL=F | Platinum, January 23 |
QAR=X | USD/QAR |
RUB=X | USD/RUB |
SARUSD=X | SAR/USD |
SB=F | Sugar #11, March 23 |
SGD=X | USD/SGD |
SHEL | Shell plc |
SI=F | Silver |
TTE | TotalEnergies SE |
XOM | Exxon Mobil Corporation |
YM=F | Mini Dow Jones Indus.-USD 5, December 22 |
ZB=F | U.S. Treasury Bond Futures, December |
ZC=F | Corn Futures, March 2023 |
ZF=F | Five-Year US Treasury Note Futures |
ZL=F | Soybean Oil Futures, January 2023 |
ZM=F | Soybean Meal Futures, January 2023 |
ZN=F | 10-Year T-Note Futures, December 2022 |
ZO=F | Oat Futures, March 2023 |
ZR=F | Rough Rice Futures, January 2023 |
ZS=F | Soybean Futures, January 2023 |
ZT=F | 2-Year T-Note Futures, December 2022 |
^AORD | ALL ORDINARIES |
^AXJO | S&P/ASX 200 |
^BFX | BEL 20 |
^BSESN | S&P BSE SENSEX |
^DJI | Dow 30 |
^FCHI | CAC 40 |
^FTSE | FTSE 100 |
^GDAXI | DAX PERFORMANCE-INDEX |
^GSPC | S&P 500 |
^GSPTSE | S&P/TSX Composite Index |
^HSI | Hang Seng Index |
^IXIC | Nasdaq |
^JKSE | Jakarta Composite Index |
^KLSE | FTSE Bursa Malaysia KLCI |
^KS11 | KOSPI Composite Index |
^MERV | MERVAL |
^MXX | IPC MEXICO |
^N100 | Euronext 100 Index |
^N225 | Nikkei 225 |
^NYA | NYSE COMPOSITE (DJ) |
^NZ50 | S&P/NZX 50 INDEX GROSS |
^RUT | Russell 2000 |
^STI | STI Index |
^TWII | TSEC Weighted Index |
^VIX | CBOE Volatility Index |
^XAX | NYSE AMEX COMPOSITE INDEX |
Washington | Average temperature in Washington |
London | Average temperature in London |
Hong Kong | Average temperature in Hong Kong |
Saudi Arabia | Average temperature in Saudi Arabia |
Moscow | Average temperature in Moscow |
São Paulo | Average temperature in São Paulo |
Tokyo | Average temperature in Tokyo |
day | day of the month number |
month | month number |
day_name | day number |
References
- Gogas, P.; Papadimitriou, T. Machine Learning in Economics and Finance. Comput. Econ. 2021, 57, 1–4. [Google Scholar] [CrossRef]
- Baumeister, C.; Kilian, L.; Lee, T.K. Inside the Crystal Ball: New Approaches to Predicting the Gasoline Price at the Pump. J. Appl. Econ. 2016, 32, 275–295. [Google Scholar] [CrossRef]
- Anderson, S.T.; Kellogg, R.; Sallee, J.M.; Curtin, R.T. Forecasting Gasoline Prices Using Consumer Surveys. Am. Econ. Rev. 2011, 101, 110–114. [Google Scholar] [CrossRef]
- Baghestani, H. Predicting gasoline prices using Michigan survey data. Energy Econ. 2015, 50, 27–32. [Google Scholar] [CrossRef]
- Baghestani, H. Inflation expectations and energy price forecasting. OPEC Energy Rev. 2014, 38, 21–35. [Google Scholar] [CrossRef]
- Carpio, L.G.T. The effects of oil price volatility on ethanol, gasoline, and sugar price forecasts. Energy 2019, 181, 1012–1022. [Google Scholar] [CrossRef]
- Dimitriadou, A.; Gogas, P.; Papadimitriou, T.; Plakandaras, V. Oil Market Efficiency under a Machine Learning Perspective. Forecasting 2018, 1, 157–168. [Google Scholar] [CrossRef]
- Mouchtaris, D.; Sofianos, E.; Gogas, P.; Papadimitriou, T. Forecasting Natural Gas Spot Prices with Machine Learning. Energies 2021, 14, 5782. [Google Scholar] [CrossRef]
- Wang, B.; Wang, J. Energy futures and spots prices forecasting by hybrid SW-GRU with EMD and error evaluation. Energy Econ. 2020, 90, 104827. [Google Scholar] [CrossRef]
- Mustaffa, Z.; Yusof, Y.; Kamaruddin, S.S. Gasoline Price Forecasting: An Application of LSSVM with Improved ABC. Procedia Soc. Behav. Sci. 2014, 129, 601–609. [Google Scholar] [CrossRef]
- Malliaris, M.E.; Malliaris, S.G. Forecasting inter-related energy product prices. Eur. J. Financ. 2008, 14, 453–468. [Google Scholar] [CrossRef]
- Li, R. Forecasting energy spot prices: A multiscale clustering recognition approach. Resour. Policy 2023, 81, 103320. [Google Scholar] [CrossRef]
- Ma, C.W. Forecasting efficiency of energy futures prices. J. Futur. Mark. 1989, 9, 393–419. [Google Scholar] [CrossRef]
- Chinn, M.; LeBlanc, M.; Coibion, O. The Predictive Content of Energy Futures: An Update on Petroleum, Natural Gas, Heating Oil and Gasoline; National Bureau of Economic Research: Cambridge, MA, USA, 2005. [Google Scholar] [CrossRef]
- Gumus, M.; Kiran, M.S. Crude oil price forecasting using XGBoost. In Proceedings of the 2017 International Conference on Computer Science and Engineering (UBMK), Antalya, Turkey, 5–8 October 2017; pp. 1100–1103. [Google Scholar] [CrossRef]
- Yu, L.; Ma, Y.; Ma, M. An effective rolling decomposition-ensemble model for gasoline consumption forecasting. Energy 2021, 222, 119869. [Google Scholar] [CrossRef]
- Ceylan, Z.; Akbulut, D.; Baytürk, E. Forecasting gasoline consumption using machine learning algorithms during COVID-19 pandemic. Energy Sources Part A Recover. Util. Environ. Eff. 2022, 1–19. [Google Scholar] [CrossRef]
- Escribano, Á.; Wang, D. Mixed random forest, cointegration, and forecasting gasoline prices. Int. J. Forecast. 2021, 37, 1442–1462. [Google Scholar] [CrossRef]
- Gogas, P.; Papadimitriou, T.; Sofianos, E. Forecasting unemployment in the euro area with machine learning. J. Forecast. 2021, 41, 551–566. [Google Scholar] [CrossRef]
- Breiman, L. Bagging predictors. Mach. Learn. 1996, 24, 123–140. [Google Scholar] [CrossRef]
- Freund, Y.; Schapire, R.E. A Decision-Theoretic Generalization of On-Line Learning and an Application to Boosting. J. Comput. Syst. Sci. 1997, 55, 119–139. [Google Scholar] [CrossRef]
- Breiman, L. Random forests. Mach. Learn. 2001, 45, 5–32. [Google Scholar] [CrossRef]
- González, S.; García, S.; Del Ser, J.; Rokach, L.; Herrera, F. A practical tutorial on bagging and boosting based ensembles for machine learning: Algorithms, software tools, performance study, practical perspectives and opportunities. Inf. Fusion 2020, 64, 205–237. [Google Scholar] [CrossRef]
- Breiman, L.; Friedman, J.H.; Olshen, R.A.; Stone, C.J. Classification and Regression Trees; Wadsworth Inc.: Monterey, CA, USA, 1984. [Google Scholar]
- Chen, T.; Guestrin, C. XGBoost: A Scalable Tree Boosting System. In Proceedings of the 22nd ACM SIGKDD International Conference on Knowledge Discovery and Data Mining (KDD ’16), San Francisco, CA, USA, 13–17 August 2016; Association for Computing Machinery: New York, NY, USA, 2016; pp. 785–794. [Google Scholar] [CrossRef]
- Gogas, P.; Papadimitriou, T.; Sofianos, E. Money Neutrality, Monetary Aggregates and Machine Learning. Algorithms 2019, 12, 137. [Google Scholar] [CrossRef]
- Drachal, K. Forecasting selected energy commodities prices with Bayesian dynamic finite mixtures. Energy Econ. 2021, 99, 105283. [Google Scholar] [CrossRef]
- Herrera, G.P.; Constantino, M.; Tabak, B.M.; Pistori, H.; Su, J.-J.; Naranpanawa, A. Long-term forecast of energy commodities price using machine learning. Energy 2019, 179, 214–221. [Google Scholar] [CrossRef]
- Idilbi-Bayaa, Y.; Qadan, M. Forecasting Commodity Prices Using the Term Structure. J. Risk Financ. Manag. 2021, 14, 585. [Google Scholar] [CrossRef]
- Huang, S.-C.; Wu, C.-F. Energy Commodity Price Forecasting with Deep Multiple Kernel Learning. Energies 2018, 11, 3029. [Google Scholar] [CrossRef]
- Timmer, R.P.; Lamb, P.J. Relations between Temperature and Residential Natural Gas Consumption in the Central and Eastern United States. J. Appl. Meteorol. Clim. 2007, 46, 1993–2013. [Google Scholar] [CrossRef]
- Yadav, M.P.; Sehgal, V.; Ratra, D.; Wajid, A. Forecasting the Energy Commodities: An evidence of ARIMA and Intervention Analysis. Int. J. Monet. Econ. Financ. 2023, 16, 443–457. [Google Scholar] [CrossRef]
NYGSP | LAGSP | |
---|---|---|
Decision Tree | ||
in-sample | 2.93% | 3.60% |
out-of-sample | 3.34% | 4.04% |
Random Forest | ||
in-sample | 2.74% | 3.35% |
out-of-sample | 3.23% | 3.78% |
XGBoost | ||
in-sample | 3.30% | 4.00% |
out-of-sample | 3.92% | 3.87% |
Variable Importance Measure | |||
---|---|---|---|
NYGSP | LAGSP | ||
Variable | VIM Score | Variable | VIM Score |
NYGSP_lag_1 | 68.59% | LAGSP_lag_1 | 84.83% |
BRENTSP_lag_3 | 14.92% | BRENTSP_lag_3 | 6.62% |
GCKRP_lag_3 | 2.53% | LADSP_lag_2 | 2.45% |
GCGSP_lag_1 | 1.45% | GCGSP_lag_1 | 1.15% |
LAGSP_lag_2 | 1.18% | NYGSP_lag_1 | 0.83% |
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2024 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).
Share and Cite
Sofianos, E.; Zaganidis, E.; Papadimitriou, T.; Gogas, P. Forecasting East and West Coast Gasoline Prices with Tree-Based Machine Learning Algorithms. Energies 2024, 17, 1296. https://doi.org/10.3390/en17061296
Sofianos E, Zaganidis E, Papadimitriou T, Gogas P. Forecasting East and West Coast Gasoline Prices with Tree-Based Machine Learning Algorithms. Energies. 2024; 17(6):1296. https://doi.org/10.3390/en17061296
Chicago/Turabian StyleSofianos, Emmanouil, Emmanouil Zaganidis, Theophilos Papadimitriou, and Periklis Gogas. 2024. "Forecasting East and West Coast Gasoline Prices with Tree-Based Machine Learning Algorithms" Energies 17, no. 6: 1296. https://doi.org/10.3390/en17061296
APA StyleSofianos, E., Zaganidis, E., Papadimitriou, T., & Gogas, P. (2024). Forecasting East and West Coast Gasoline Prices with Tree-Based Machine Learning Algorithms. Energies, 17(6), 1296. https://doi.org/10.3390/en17061296