File size: 2,733 Bytes
ea6881f
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
---
license: cc-by-4.0
task_categories:
- other
language:
- en
tags:
- spatial-statistics
- DBSCAN
- point-process
- cluster-detection
- Monte-Carlo
pretty_name: DBSCAN Cluster Density Ratios on CSR Point Fields
size_categories:
- 1B<n<10B
---

# DBSCAN Cluster Density Ratios — CSR Simulation Data

Monte-Carlo simulation of DBSCAN clustering applied to complete-spatial-randomness (CSR)
point fields. Used to characterize the null distribution of detected cluster density ratios
and calibrate anomaly detection p-values (look-elsewhere correction).

## Simulation parameters

| Parameter | Value |
|---|---|
| N (points per field) | 10,000 |
| Domain | Disk, radius R=100 |
| Domain area S₀ | π·100² ≈ 31,415.93 |
| Background intensity λ₀ | N/S₀ = 1/π ≈ 0.31831 |
| DBSCAN min_samples | 10 |
| Post-filter min_cluster_size | 10 |
| Post-filter min_area | 0.5 |
| eps sweep | 0.80 → 2.86 (step 0.01, 207 values) |
| Iterations per eps | ~12,000 – 1,000,000 |

**Total compute**: ~60 h on a single workstation (16-process parallel).

## Schema

Each parquet file corresponds to one `eps` value (filename: `data/eps_X.XX.parquet`).

| Column | Type | Description |
|---|---|---|
| `S_prime` | float64 | Convex-hull area of detected cluster. **-1.0 = no cluster found** (placeholder row) |
| `N_prime` | int64 | Point count of detected cluster. **-1 = no cluster found** |
| `iteration` | int64 | Field index (1-based). Multiple clusters per iteration are all recorded. |

**Always filter** `S_prime != -1` before analysis. Placeholder rows mark iterations with no
valid DBSCAN cluster (common at low eps where clustering is rare).

## Key derived quantities

```python
lambda0 = 10000 / (np.pi * 100**2)   # ≈ 0.31831
R = (df.N_prime / df.S_prime) / lambda0   # density ratio (main statistic)
R_tilde = R * eps**2                       # eps-collapsed statistic (eps-invariant master)
```

The density ratio `R` follows a heavy-tailed distribution (tail index α≈7). After
rescaling to `R̃ = R·eps²`, the distribution collapses to a single master inverse-gamma
(shape≈20.5) across all eps — the central empirical finding of this dataset.

## Usage

```python
import pandas as pd
import numpy as np

# Load one eps slice
eps = 1.20
df = pd.read_parquet(f"hf://datasets/Winternewt/cluster-distribution-simdata/data/eps_{eps:.2f}.parquet")
df = df[df.S_prime != -1]   # drop placeholder rows

lambda0 = 10000 / (np.pi * 100**2)
df['R'] = (df.N_prime / df.S_prime) / lambda0
df['R_tilde'] = df['R'] * eps**2
print(df.R_tilde.describe())
```

## Repository

Source code and analysis: https://github.com/winternewt/cluster_distribution
Analytic findings: see `docs/analytic_findings.md` in the source repo.