Quiz 2
Registry Synced

Randomization Tests

98 words
1 min read

Reading compass

Now · 10.1 Permutation Test

Randomization Tests

10.1 Permutation Test

python
import numpy as np
# Two-sample permutation test
group_a = np.array([2, 3, 4, 5])
group_b = np.array([6, 7, 8, 9])
observed_diff = np.mean(group_b) - np.mean(group_a)
all_data = np.concatenate([group_a, group_b])
n_perm = 10000
count = 0
for _ in range(n_perm):
    np.random.shuffle(all_data)
    a = all_data[:4]
    b = all_data[4:]
    if np.mean(b) - np.mean(a) >= observed_diff:
        count += 1
p_value = count / n_perm
print(f"p-value: {p_value}")

10.2 Advantages

Document outline

Keep your place and jump directly to a heading.

Table of Contents
System Normal // Awaiting Context

Intelligence Hub

Navigate the knowledge graph to generate context. The Hub adapts dynamically to surface backlinks, related notes, and metadata insights.