Skip to content

Commit 4951ed8

Browse files
author
andre_ramos
committed
update estimation procedure and paper experiments
1 parent b3560d7 commit 4951ed8

23 files changed

Lines changed: 955 additions & 48469 deletions

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,7 @@ paper_tests/m4_test/evaluate_model2.jl
2323
results_PROPHET/
2424
results_SS/
2525
sarima/
26+
27+
results_simulation/
28+
results_metrics/
29+
ssl_vs_kalman_paired_tests.csv

Project.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
name = "StateSpaceLearning"
22
uuid = "971c4b7c-2c4e-4bac-8525-e842df3cde7b"
33
authors = ["andreramosfc <andreramosfdc@gmail.com>"]
4-
version = "2.0.15"
4+
version = "2.1.0"
55

66
[deps]
77
Distributions = "31c24e10-a181-5473-b8eb-7969acd0382f"
88
GLMNet = "8d5ece8b-de18-5317-b113-243142960cc6"
9+
HTTP = "cd3eb016-35fb-5094-929b-558a96fad6f3"
910
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
11+
PyCall = "438e738f-606a-5dbb-bf0a-cddfbfd45ab0"
1012
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
1113
SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
1214
Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"

README.md

Lines changed: 35 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,8 @@ log_air_passengers = log.(airp.passengers)
7373
steps_ahead = 30
7474

7575
model = StructuralModel(log_air_passengers)
76-
fit!(model)
77-
prediction_log = forecast(model, steps_ahead) # arguments are the output of the fitted model and number of steps ahead the user wants to forecast
76+
StateSpaceLearning.fit!(model)
77+
prediction_log = StateSpaceLearning.forecast(model, steps_ahead) # arguments are the output of the fitted model and number of steps ahead the user wants to forecast
7878
prediction = exp.(prediction_log)
7979

8080
plot_point_forecast(airp.passengers, prediction)
@@ -234,36 +234,57 @@ StateSpaceModels.fit!(ss_model)
234234

235235
## Paper Results Reproducibility
236236

237-
The paper has two experiments (results for the M4 competition and a simulation study). To reproduce each experiment follow the instructions below:
237+
To reproduce the paper results, run the following experiments:
238238

239-
### M4 Experiment
239+
### M4 Competition Test
240240

241-
To reproduce M4 paper results you can clone the repository and run the following commands on terminal:
241+
Evaluates SSL and SS (StateSpaceModels) benchmark models on M4 competition dataset across all granularities (Monthly, Quarterly, Daily, Hourly, Weekly, Yearly).
242242

243243
```shell
244244
julia paper_tests/m4_test/m4_test.jl
245-
python paper_tests/m4_test/m4_test.py
246245
```
247246

248-
The results for SSL model in terms of MASE and sMAPE for all 48000 series will be stored in folder "paper_tests/m4_test/results_SSL". The average results of MASE, sMAPE and OWA will be saved in file "paper_tests/m4_test/metric_results/SSL_METRICS_RESULTS.csv".
247+
The script:
248+
- Downloads M4 competition datasets directly from GitHub
249+
- Runs SSL models with various configurations (with/without outliers, different selection methods, and alpha values)
250+
- Runs SS (StateSpaceModels) benchmark models using PyCall
251+
- Calculates metrics (MASE, sMAPE, OWA, CRPS) for all models
252+
253+
Results are saved in:
254+
- `paper_tests/m4_test/results_SSL/` - SSL model results by granularity
255+
- `paper_tests/m4_test/metrics_results/` - Summary metrics and benchmark results
256+
257+
Note: Requires PyCall and Python packages (`statsmodels`, `numpy`) for the SS benchmark evaluation.
249258

250-
The results for SS model in terms of MASE and sMAPE for all 48000 series will be stored in folder "paper_tests/m4_test/results_SS". The average results of MASE, sMAPE and OWA will be saved in file "paper_tests/m4_test/metric_results/SS_METRICS_RESULTS.csv".
259+
### Simulation Parameter Study
251260

252-
### Simulation Experiment
261+
Compares SSL vs Kalman filter on simulated data.
253262

254-
To reproduce the simulation results you can clone the repository and run the following commands on terminal:
263+
```shell
264+
julia paper_tests/simulation_param/simulation.jl [repetitions] [sample_sizes]
265+
```
255266

267+
Example:
256268
```shell
257-
julia paper_tests/simulation_test/simulation.jl 0
269+
julia paper_tests/simulation_param/simulation.jl 100 60,120,240
258270
```
259271

260-
As this test takes a long time, you may want to run it in parallel, for that you can change the last argument to be number of workers to use in the parallelization:
272+
Results are saved in `paper_tests/simulation_param/ssl_vs_kalman_paired_tests.csv`.
273+
274+
### Simulation Test
275+
276+
Large-scale simulation comparing SSL, SS, and other methods.
277+
278+
```shell
279+
julia paper_tests/simulation_test/simulation.jl [num_workers]
280+
```
261281

282+
Example (with 4 parallel workers):
262283
```shell
263-
julia paper_tests/simulation_test/simulation.jl 3
284+
julia paper_tests/simulation_test/simulation.jl 4
264285
```
265286

266-
The results will be saved in two separated files: "paper_tests/simulation_test/results_metrics/metrics_confusion_matrix.csv" and "paper_tests/simulation_test/results_metrics/metrics_bias_mse.csv"
287+
Results are saved in `paper_tests/simulation_test/results_simulation/` and `paper_tests/simulation_test/results_metrics/`.
267288

268289

269290
## Contributing

0 commit comments

Comments
 (0)