The full dataset viewer is not available (click to read why). Only showing a preview of the rows.
Error code: DatasetGenerationCastError
Exception: DatasetGenerationCastError
Message: An error occurred while generating the dataset
All the data files must have the same columns, but at some point there are 3 new columns ({'RMSE opening (ticks)', 'opening / midday', 'RMSE midday (ticks)'}) and 3 missing columns ({'IQR', 'days beating linear (%)', 'median daily RMSE'}).
This happened while the csv dataset builder was generating data using
hf://datasets/nyakslamo/mnq-numerical-analysis/output/part1_session.csv (at revision e587679184673c214d91737b4c5f364ebc569777), ['hf://datasets/nyakslamo/mnq-numerical-analysis@e587679184673c214d91737b4c5f364ebc569777/output/part1_consistency.csv', 'hf://datasets/nyakslamo/mnq-numerical-analysis@e587679184673c214d91737b4c5f364ebc569777/output/part1_session.csv', 'hf://datasets/nyakslamo/mnq-numerical-analysis@e587679184673c214d91737b4c5f364ebc569777/output/part1_summary.csv', 'hf://datasets/nyakslamo/mnq-numerical-analysis@e587679184673c214d91737b4c5f364ebc569777/output/part2_convergence.csv', 'hf://datasets/nyakslamo/mnq-numerical-analysis@e587679184673c214d91737b4c5f364ebc569777/output/part2_cost.csv', 'hf://datasets/nyakslamo/mnq-numerical-analysis@e587679184673c214d91737b4c5f364ebc569777/output/part2_forecasts.csv', 'hf://datasets/nyakslamo/mnq-numerical-analysis@e587679184673c214d91737b4c5f364ebc569777/output/part2_grid.csv', 'hf://datasets/nyakslamo/mnq-numerical-analysis@e587679184673c214d91737b4c5f364ebc569777/output/part2_parameters.csv', 'hf://datasets/nyakslamo/mnq-numerical-analysis@e587679184673c214d91737b4c5f364ebc569777/output/part2_planned_step.csv', 'hf://datasets/nyakslamo/mnq-numerical-analysis@e587679184673c214d91737b4c5f364ebc569777/output/part2_stability.csv', 'hf://datasets/nyakslamo/mnq-numerical-analysis@e587679184673c214d91737b4c5f364ebc569777/output/summary_statistics.csv']
Please either edit the data files to have matching columns, or separate them into different configurations (see docs at https://hf.co/docs/hub/datasets-manual-configuration#multiple-configurations)
Traceback: Traceback (most recent call last):
File "/usr/local/lib/python3.14/site-packages/datasets/builder.py", line 1856, in _prepare_split_single
writer.write_table(table)
~~~~~~~~~~~~~~~~~~^^^^^^^
File "/usr/local/lib/python3.14/site-packages/datasets/arrow_writer.py", line 811, in write_table
self._write_table(pa_table, writer_batch_size=writer_batch_size)
~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.14/site-packages/datasets/arrow_writer.py", line 822, in _write_table
pa_table = table_cast(pa_table, self._schema)
File "/usr/local/lib/python3.14/site-packages/datasets/table.py", line 2394, in table_cast
return cast_table_to_schema(table, schema)
File "/usr/local/lib/python3.14/site-packages/datasets/table.py", line 2322, in cast_table_to_schema
raise CastError(
...<3 lines>...
)
datasets.table.CastError: Couldn't cast
spacing: string
method: string
RMSE opening (ticks): double
RMSE midday (ticks): double
opening / midday: double
-- schema metadata --
pandas: '{"index_columns": [{"kind": "range", "name": null, "start": 0, "' + 917
to
{'spacing': Value('string'), 'method': Value('string'), 'median daily RMSE': Value('float64'), 'IQR': Value('float64'), 'days beating linear (%)': Value('float64')}
because column names don't match
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/src/services/worker/src/worker/job_runners/config/parquet_and_info.py", line 1379, in compute_config_parquet_and_info_response
parquet_operations, partial, estimated_dataset_info = stream_convert_to_parquet(
~~~~~~~~~~~~~~~~~~~~~~~~~^
builder, max_dataset_size_bytes=max_dataset_size_bytes
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
)
^
File "/src/services/worker/src/worker/job_runners/config/parquet_and_info.py", line 956, in stream_convert_to_parquet
builder._prepare_split(split_generator=splits_generators[split], file_format="parquet")
~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.14/site-packages/datasets/builder.py", line 1702, in _prepare_split
for job_id, done, content in self._prepare_split_single(
~~~~~~~~~~~~~~~~~~~~~~~~~~^
gen_kwargs=gen_kwargs, job_id=job_id, **_prepare_split_args
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
):
^
File "/usr/local/lib/python3.14/site-packages/datasets/builder.py", line 1858, in _prepare_split_single
raise DatasetGenerationCastError.from_cast_error(
...<4 lines>...
)
datasets.exceptions.DatasetGenerationCastError: An error occurred while generating the dataset
All the data files must have the same columns, but at some point there are 3 new columns ({'RMSE opening (ticks)', 'opening / midday', 'RMSE midday (ticks)'}) and 3 missing columns ({'IQR', 'days beating linear (%)', 'median daily RMSE'}).
This happened while the csv dataset builder was generating data using
hf://datasets/nyakslamo/mnq-numerical-analysis/output/part1_session.csv (at revision e587679184673c214d91737b4c5f364ebc569777), ['hf://datasets/nyakslamo/mnq-numerical-analysis@e587679184673c214d91737b4c5f364ebc569777/output/part1_consistency.csv', 'hf://datasets/nyakslamo/mnq-numerical-analysis@e587679184673c214d91737b4c5f364ebc569777/output/part1_session.csv', 'hf://datasets/nyakslamo/mnq-numerical-analysis@e587679184673c214d91737b4c5f364ebc569777/output/part1_summary.csv', 'hf://datasets/nyakslamo/mnq-numerical-analysis@e587679184673c214d91737b4c5f364ebc569777/output/part2_convergence.csv', 'hf://datasets/nyakslamo/mnq-numerical-analysis@e587679184673c214d91737b4c5f364ebc569777/output/part2_cost.csv', 'hf://datasets/nyakslamo/mnq-numerical-analysis@e587679184673c214d91737b4c5f364ebc569777/output/part2_forecasts.csv', 'hf://datasets/nyakslamo/mnq-numerical-analysis@e587679184673c214d91737b4c5f364ebc569777/output/part2_grid.csv', 'hf://datasets/nyakslamo/mnq-numerical-analysis@e587679184673c214d91737b4c5f364ebc569777/output/part2_parameters.csv', 'hf://datasets/nyakslamo/mnq-numerical-analysis@e587679184673c214d91737b4c5f364ebc569777/output/part2_planned_step.csv', 'hf://datasets/nyakslamo/mnq-numerical-analysis@e587679184673c214d91737b4c5f364ebc569777/output/part2_stability.csv', 'hf://datasets/nyakslamo/mnq-numerical-analysis@e587679184673c214d91737b4c5f364ebc569777/output/summary_statistics.csv']
Please either edit the data files to have matching columns, or separate them into different configurations (see docs at https://hf.co/docs/hub/datasets-manual-configuration#multiple-configurations)Need help to make the dataset viewer work? Make sure to review how to configure the dataset viewer, and open a discussion for direct support.
spacing string | method string | median daily RMSE float64 | IQR float64 | days beating linear (%) float64 |
|---|---|---|---|---|
10 min | Linear | 77.130998 | 32.700526 | null |
10 min | Natural cubic spline | 78.2331 | 40.772761 | 18.367347 |
10 min | PCHIP | 79.793452 | 38.989809 | 32.653061 |
10 min | Newton degree 2 | 79.352774 | 42.762884 | 20.408163 |
10 min | Newton degree 3 | 78.995517 | 41.7737 | 34.693878 |
10 min | Newton degree 5 | 85.381135 | 51.310502 | 24.489796 |
15 min | Linear | 90.099778 | 44.210364 | null |
15 min | Natural cubic spline | 94.215445 | 44.458914 | 38.77551 |
15 min | PCHIP | 94.830935 | 42.873286 | 42.857143 |
15 min | Newton degree 2 | 97.910067 | 47.98229 | 24.489796 |
15 min | Newton degree 3 | 95.79073 | 40.251741 | 40.816327 |
15 min | Newton degree 5 | 105.031295 | 37.377944 | 36.734694 |
30 min | Linear | 119.227632 | 57.478311 | null |
30 min | Natural cubic spline | 121.404621 | 67.728935 | 46.938776 |
30 min | PCHIP | 118.587204 | 73.83135 | 46.938776 |
30 min | Newton degree 2 | 129.404198 | 61.811505 | 36.734694 |
30 min | Newton degree 3 | 116.880346 | 76.989859 | 48.979592 |
30 min | Newton degree 5 | 125.006654 | 81.463254 | 34.693878 |
10 min | Linear | null | null | null |
10 min | Natural cubic spline | null | null | null |
10 min | PCHIP | null | null | null |
10 min | Newton degree 2 | null | null | null |
10 min | Newton degree 3 | null | null | null |
10 min | Newton degree 5 | null | null | null |
15 min | Linear | null | null | null |
15 min | Natural cubic spline | null | null | null |
15 min | PCHIP | null | null | null |
15 min | Newton degree 2 | null | null | null |
15 min | Newton degree 3 | null | null | null |
15 min | Newton degree 5 | null | null | null |
30 min | Linear | null | null | null |
30 min | Natural cubic spline | null | null | null |
30 min | PCHIP | null | null | null |
30 min | Newton degree 2 | null | null | null |
30 min | Newton degree 3 | null | null | null |
30 min | Newton degree 5 | null | null | null |
10 min | Linear | null | null | null |
10 min | Natural cubic spline | null | null | null |
10 min | PCHIP | null | null | null |
10 min | Newton degree 2 | null | null | null |
10 min | Newton degree 3 | null | null | null |
10 min | Newton degree 5 | null | null | null |
15 min | Linear | null | null | null |
15 min | Natural cubic spline | null | null | null |
15 min | PCHIP | null | null | null |
15 min | Newton degree 2 | null | null | null |
15 min | Newton degree 3 | null | null | null |
15 min | Newton degree 5 | null | null | null |
30 min | Linear | null | null | null |
30 min | Natural cubic spline | null | null | null |
30 min | PCHIP | null | null | null |
30 min | Newton degree 2 | null | null | null |
30 min | Newton degree 3 | null | null | null |
30 min | Newton degree 5 | null | null | null |
null | null | null | null | null |
null | null | null | null | null |
null | null | null | null | null |
null | null | null | null | null |
null | null | null | null | null |
null | null | null | null | null |
null | null | null | null | null |
null | null | null | null | null |
null | null | null | null | null |
null | null | null | null | null |
null | null | null | null | null |
null | null | null | null | null |
null | null | null | null | null |
null | null | null | null | null |
null | null | null | null | null |
null | null | null | null | null |
null | null | null | null | null |
null | null | null | null | null |
null | null | null | null | null |
null | null | null | null | null |
null | null | null | null | null |
null | null | null | null | null |
null | null | null | null | null |
null | null | null | null | null |
null | null | null | null | null |
null | null | null | null | null |
null | null | null | null | null |
null | null | null | null | null |
null | null | null | null | null |
null | null | null | null | null |
null | null | null | null | null |
null | null | null | null | null |
null | null | null | null | null |
null | null | null | null | null |
null | null | null | null | null |
null | null | null | null | null |
null | null | null | null | null |
null | null | null | null | null |
null | null | null | null | null |
null | null | null | null | null |
null | null | null | null | null |
null | null | null | null | null |
null | null | null | null | null |
null | null | null | null | null |
null | null | null | null | null |
null | null | null | null | null |
Cubic Splines and IVP Solvers for Short-Horizon Forecasting of MNQ Futures
The main project page is the Space: https://huggingface.co/spaces/nyakslamo/mnq-interpolation - the same code and results, plus step-by-step tools that run the code in your browser. This dataset is a static copy.
MATH 5670 Numerical Analysis, Austin Peay State University, Fall 2026 - individual project by Lameck Nyakweba.
The full write-up is in report/MNQ_Final_Report_Lameck.pdf.
The question
Can features built from cubic splines help predict Micro E-mini Nasdaq-100 futures (MNQ) a few minutes ahead, better than simply assuming the price stays the same? Data: 49 trading days of five-minute prices (Sep 11 - Nov 18, 2026, 9:30 a.m. - 4:00 p.m. New York time).
- Part 1 - hide and reconstruct. Keep every 2nd, 3rd or 6th price (nodes 10, 15 or 30 minutes apart), hide the rest, and let linear interpolation, a natural cubic spline, PCHIP and Newton divided differences (degree 2, 3, 5) rebuild the hidden prices.
- Part 2 - IVP forecasting. Price as a moving object with friction and a spring: dP/dt = v, dv/dt = -gammav - kappa(P - m), with v(0) = slope of a cubic spline through the last 2 hours. Solved with Improved Euler, RK4, Adams-Bashforth 4 and a predictor-corrector.
Main findings
| Finding | |
|---|---|
| Part 1 | All methods gave similar errors; linear interpolation was as good as or better than the higher-order methods (RMSE 84 vs 88-94 ticks at 10-minute spacing). Error grew like h^0.45, close to the square-root growth of a random walk, not h^2 or h^4. The spline overshot at about 19% of hidden prices; linear and PCHIP never did. |
| Part 2 | Solvers reached their theoretical orders (about 2 and 4); Adams-Bashforth had the smallest stability region. The development data chose very strong friction (gamma = 32), making the model stiff: at a step of 1/4 bar all four explicit solvers diverged, and Adams-Bashforth became the most expensive. |
| Forecasts | The spline-slope model did not beat the no-change baseline at 5 or 30 minutes; all four solvers matched the exact solution to about 2e-9 ticks, so solver choice did not matter. |
Files
| Path | Content |
|---|---|
interpolation.py |
The four interpolation methods (Newton written from scratch) with self-tests |
solvers.py |
The four IVP solvers (written from scratch) with self-tests on dy/dt = -y |
01_load_and_clean.py |
Cleaning, development/test split, summary statistics, price chart |
02_part1_reconstruction.py |
Part 1 tables and figures |
03_part2_ivp.py |
Part 2 parameter choice, accuracy / stability / cost experiments, forecasts |
run_all.py |
Runs everything in order |
output/ |
All result tables (CSV) and figures (PNG) used in the report |
data/README_data.txt |
How, when and with which settings the data were downloaded, and the checks done |
report/ |
Final report (PDF) |
About the data (not included)
The raw five-minute prices came from Yahoo Finance via the yfinance library and are not included,
because Yahoo's terms restrict redistribution. data/README_data.txt gives the exact download command.
Yahoo only serves about the last 60 days of five-minute data, so a new download covers different days
and will give different numbers. To rerun: save the download as data/mnq_5m.csv, set N_DEV_DAYS and
N_TEST_DAYS at the top of 01_load_and_clean.py to match the number of full days you have, then
pip install -r requirements.txt
python run_all.py
The code was developed with help from an AI assistant (Claude); every part was reviewed, run and checked by the author.
- Downloads last month
- 63