gaussian ar1
9 changed files+118−5
README.mdmodified+3−0View file
@@ -45,6 +45,9 @@ The project consists of two main components:
4545
4646 1. Install Python dependencies:
4747 ```bash
48+# You may need to first install wavpack
49+# apt-get install libwavpack-dev
50+
4851 cd benchcompress
4952 pip install -e .
5053
benchcompress/src/benchcompress/datasets/__init__.pymodified+2−0View file
@@ -1,5 +1,6 @@
11 from .bernoulli import datasets as bernoulli_datasets
22 from .gaussian import datasets as gaussian_datasets
3+from .gaussian_ar1 import datasets as gaussian_ar1_datasets
34 from .ecephys import datasets as ecephys_datasets
45 from .seismic import datasets as seismic_datasets
56 from .ieeg import datasets as ieeg_datasets
@@ -8,6 +9,7 @@ from .fmri import datasets as fmri_datasets
89 datasets_list = [
910 bernoulli_datasets,
1011 gaussian_datasets,
12+ gaussian_ar1_datasets,
1113 ecephys_datasets,
1214 seismic_datasets,
1315 ieeg_datasets,
benchcompress/src/benchcompress/datasets/ecephys/__init__.pymodified+1−1View file
@@ -18,7 +18,7 @@ def _load_long_description():
1818
1919 LONG_DESCRIPTION = _load_long_description()
2020
21-tags = ["real", "ecephys", "timeseries", "1d", "integer", "continuous"]
21+tags = ["real", "ecephys", "timeseries", "1d", "integer", "correlated"]
2222
2323
2424 def _load_real_000876(
benchcompress/src/benchcompress/datasets/fmri/__init__.pymodified+1−1View file
@@ -15,7 +15,7 @@ def _load_long_description():
1515
1616 LONG_DESCRIPTION = _load_long_description()
1717
18-tags = ["real", "fmri", "timeseries", "1d", "integer", "bold", "continuous"]
18+tags = ["real", "fmri", "timeseries", "1d", "integer", "bold", "correlated"]
1919
2020
2121 def _load_bold_data(*, slice_indices: Optional[List[int]] = None) -> np.ndarray:
benchcompress/src/benchcompress/datasets/gaussian_ar1/__init__.pyadded+86−0View file
@@ -0,0 +1,86 @@
1+import numpy as np
2+import os
3+
4+SOURCE_FILE = "gaussian_ar1/__init__.py"
5+
6+
7+def _load_long_description():
8+ current_dir = os.path.dirname(os.path.abspath(__file__))
9+ md_path = os.path.join(current_dir, "gaussian_ar1.md")
10+ with open(md_path, "r", encoding="utf-8") as f:
11+ return f.read()
12+
13+
14+LONG_DESCRIPTION = _load_long_description()
15+
16+
17+def create_gaussian_ar1_quantized(
18+ *, n_samples: int, phi: float, stddev: float, seed: int
19+) -> np.ndarray:
20+ """Generate quantized Gaussian AR(1) process.
21+
22+ Args:
23+ n_samples: Number of samples to generate
24+ phi: AR(1) coefficient (-1 < phi < 1)
25+ stddev: Standard deviation of Gaussian innovations
26+ seed: Random seed
27+ """
28+ rng = np.random.default_rng(seed)
29+ x = np.zeros(n_samples)
30+ x[0] = rng.normal(0, stddev) # Initialize first sample
31+
32+ # Generate AR(1) process
33+ for t in range(1, n_samples):
34+ x[t] = phi * x[t - 1] + rng.normal(0, stddev)
35+
36+ # Quantize to integers
37+ x = np.round(x).astype(np.int16)
38+ return x
39+
40+
41+tags = [
42+ "gaussian",
43+ "integer",
44+ "discrete",
45+ "timeseries",
46+ "1d",
47+ "synthetic",
48+ "ar1",
49+ "correlated",
50+]
51+
52+datasets = [
53+ {
54+ "name": "gaussian-ar1-02",
55+ "version": "1",
56+ "create": lambda: create_gaussian_ar1_quantized(
57+ n_samples=1_000_000, phi=0.2, stddev=3, seed=0
58+ ),
59+ "description": "Quantized Gaussian AR(1) process with φ=0.2, σ=3.",
60+ "tags": tags,
61+ "source_file": SOURCE_FILE,
62+ "long_description": LONG_DESCRIPTION,
63+ },
64+ {
65+ "name": "gaussian-ar1-05",
66+ "version": "1",
67+ "create": lambda: create_gaussian_ar1_quantized(
68+ n_samples=1_000_000, phi=0.5, stddev=3, seed=0
69+ ),
70+ "description": "Quantized Gaussian AR(1) process with φ=0.5, σ=3.",
71+ "tags": tags,
72+ "source_file": SOURCE_FILE,
73+ "long_description": LONG_DESCRIPTION,
74+ },
75+ {
76+ "name": "gaussian-ar1-08",
77+ "version": "1",
78+ "create": lambda: create_gaussian_ar1_quantized(
79+ n_samples=1_000_000, phi=0.8, stddev=3, seed=0
80+ ),
81+ "description": "Quantized Gaussian AR(1) process with φ=0.8, σ=3.",
82+ "tags": tags,
83+ "source_file": SOURCE_FILE,
84+ "long_description": LONG_DESCRIPTION,
85+ },
86+]
benchcompress/src/benchcompress/datasets/gaussian_ar1/gaussian_ar1.mdadded+22−0View file
@@ -0,0 +1,22 @@
1+# Gaussian AR(1) Dataset
2+
3+These datasets contain sequences from autoregressive AR(1) processes with Gaussian innovations. The data is generated using the model:
4+
5+```
6+x[t] = φ * x[t-1] + ε[t]
7+```
8+
9+where:
10+- φ is the autoregressive parameter controlling temporal correlation
11+- ε[t] follows a Gaussian distribution with μ=0 and σ=3
12+- Values are quantized to integers after generation
13+
14+## Variants
15+
16+We provide three AR(1) variants with different temporal correlation strengths:
17+
18+- gaussian-ar1-02 (φ=0.2): Weak temporal correlation
19+- gaussian-ar1-05 (φ=0.5): Moderate temporal correlation
20+- gaussian-ar1-08 (φ=0.8): Strong temporal correlation
21+
22+Each variant has σ=3 for the Gaussian innovations and uses integer quantization after generation to maintain compatibility with integer-based compression algorithms.
benchcompress/src/benchcompress/datasets/ieeg/__init__.pymodified+1−1View file
@@ -15,7 +15,7 @@ def _load_long_description():
1515
1616 LONG_DESCRIPTION = _load_long_description()
1717
18-tags = ["real", "ecephys", "ieeg", "timeseries", "1d", "continuous"]
18+tags = ["real", "ecephys", "ieeg", "timeseries", "1d", "correlated"]
1919 tags_float = tags + ["float"]
2020 tags_integer = tags + ["integer"]
2121
benchcompress/src/benchcompress/datasets/seismic/__init__.pymodified+1−1View file
@@ -16,7 +16,7 @@ def _load_long_description():
1616
1717 LONG_DESCRIPTION = _load_long_description()
1818
19-tags = ["real", "seismic", "continuous", "timeseries", "1d"]
19+tags = ["real", "seismic", "correlated", "timeseries", "1d"]
2020 tags_float = tags + ["float"]
2121 tags_integer = tags + ["integer"]
2222
benchcompress/src/benchcompress/run_benchmarks/is_compatible.pymodified+1−1View file
@@ -14,7 +14,7 @@ def is_compatible(algorithm_tags: List[str], dataset_tags: List[str]) -> bool:
1414 # If algorithm has delta_encoding or markov_prediction, dataset must have continuous, timeseries, 1d, integer
1515 if "delta_encoding" in algorithm_tags or "markov_prediction" in algorithm_tags:
1616 if (
17- "continuous" not in dataset_tags
17+ "correlated" not in dataset_tags
1818 or "timeseries" not in dataset_tags
1919 or "1d" not in dataset_tags
2020 or "integer" not in dataset_tags