Speculative Positions and Oil Price Volatility: Evidence from Wavelet Decomposition
Description
This repository contains the managed money (MM) position series, tables, figures, and Jupyter notebooks used in the analysis. Full replication requires a processed input file named 20250525_processed_data.xlsx containing dates, Brent price data (CO1 Comdty), and managed money long and short positions. Brent price data are not included because they were obtained from Bloomberg and are subject to licensing restrictions. Users with Bloomberg access can reconstruct the processed dataset and run the notebooks in sequence to reproduce the main figures and supporting outputs.
Files
Steps to reproduce
Download the replication package and place all files in a single working directory. The repository includes the managed money (MM) position series, tables, figures, and Jupyter notebooks used in the analysis. The Brent price series is not included because it was obtained from Bloomberg and is subject to licensing restrictions. To run the full analysis, users must supply their own Bloomberg Brent futures price series and save it in the processed input file expected by the notebooks: 20250525_processed_data.xlsx The processed Excel file should contain at least the following columns: Dates CO1 Comdty (Brent price series) CO_m_money_long CO_m_money_short Managed money net positions are constructed in the notebooks as: CO_m_money_positions = CO_m_money_long - CO_m_money_short Run the notebooks in the following order: (a) Cross Wavelet Power Spectrum Mid Freq.ipynb This notebook: loads the processed dataset, computes the synchrosqueezed wavelet transform, produces the filtered cross-wavelet power figure, exports: d3_filtered_series.csv average_power_by_period.csv (b) Average Power with Significance.ipynb This notebook: loads average_power_by_period.csv, plots the average power spectrum by period with the significance threshold, saves: average_power_period_bands_colored_final.png (c) Cross Wavelet Power Spectrum.ipynb This notebook: computes the full cross-wavelet power spectrum, plots bandwise correlations, exports: bandwise_correlation_ssq.csv bandwise_correlation_ssq.png and creates animated outputs for Brent and managed money evolution. (d) Coherence Analysis.ipynb This notebook: computes the coherence map and phase arrows, generates the wavelet coherence figure. Python packages required: numpy pandas matplotlib ssqueezepy openpyxl (for Excel input) Without Bloomberg price data, users can still inspect the MM series, tables, figures, and notebook code, but they cannot fully rerun the wavelet and coherence analysis.
Institutions
- King Abdullah Petroleum Studies and Research CenterRiyadh Region, Riyadh