This project implements a basic pipeline for forecasting hourly electricity prices in the California ISO (CAISO) markets. It demonstrates how to ingest public market data from the CAISO OASIS API, prepare a time-series dataset, and train baseline models to predict future prices.
The CAISO OASIS service provides historical price data for day-ahead and real-time markets. A helper function in caiso_price_forecast.py fetches price data by constructing a query to the OASIS endpoint with parameters for market (e.g. DAM for day-ahead) and node. The downloaded zip file is parsed into a Pandas DataFrame.
The script supports two forecasting approaches:
-
ARIMA: A classical autoregressive integrated moving average model. It is simple and fast to fit and serves as a baseline. In the
__main__section, a demonstration uses an ARIMA(5,1,0) model on a synthetic dataset, achieving a root-mean-square error (RMSE) around 3.9 on a 24-hour forecast horizon. -
LSTM (optional): A recurrent neural network model implemented with PyTorch. If PyTorch is available, the script can train a single-layer LSTM on normalized price data and forecast future prices. Users can adjust the look-back window and number of training epochs. The LSTM section is wrapped in a try/except block so that the script still runs when PyTorch is unavailable.
- Clone this repository and install the required Python packages (
pandas,numpy,statsmodels, and optionallytorchandscikit-learn). - To fetch CAISO price data, call
fetch_oasis(start, end, market, node)with the desired date range. - Fit an ARIMA model with
arima_forecast(series, order, steps)and optionally an LSTM model withlstm_forecast(series, look_back, steps, epochs). - Run the module directly (
python caiso_price_forecast.py) to execute a synthetic demonstration and print RMSE metrics.
- This repository is intended as a starting point for more advanced forecasting work. You can extend it by adding exogenous variables (load, renewable generation, weather) and performing more sophisticated model selection. For an example of a similar project where LSTM models reduced the root-mean-square error by 40–50 % compared with ARIMA for CAISO prices, see Morgan‑Sell’s GitHub project.