{
 "version": 1,
 "basis": "Declared next part of the marketplace experiment designs study, on the group forecast part's simulator: what the coupling between group-mates does to a retention test that randomizes users, against one that randomizes groups, on the same simulated apps. Declared before any run of the test code on the declared seed; every earlier run and its files are unchanged and their hashes are listed below and checked before and after the run.",
 "declaration": "DESIGN-retention-test.md",
 "seed": 23,
 "histories": 200,
 "replication_rule": "200 simulated histories per setting, no reduction. Months 1 to 36 replay the group forecast part's draws exactly (spawn keys (0, history), (1, history) and (2, history) from seed 23), so each history before the test is that part's history. Assignments use spawn key (3, history). Within a history the four worlds (nobody treated, every test user treated, the user test, the group test) share every activity draw, so they differ only by who is treated.",
 "pilot": "None. No outcome of the test code was computed on any seed before this declaration; the tests run on a reduced population and check mechanics only.",
 "months": 60,
 "population": {
  "users": 14000,
  "group_sizes": [
   2,
   3,
   4,
   5,
   6,
   7,
   8
  ],
  "group_size_weights": [
   0.22,
   0.2,
   0.18,
   0.15,
   0.11,
   0.08,
   0.06
  ],
  "overlap_share": 0.15,
  "source": "sim.groups.make_population, called unchanged: groups of 2 to 8 drawn in order on a ring; 15% of users also join one second group among the 20 nearest theirs. Its outcome draws are not used.",
  "mates": "A user's group-mates are every other member of every group the user belongs to, counted once."
 },
 "arrivals": {
  "first_month_groups": 24,
  "monthly_growth": 0.02,
  "member_join_chance": 0.4,
  "rule": "Groups are created in ring order. New groups per month are Poisson with mean 24 x 1.02 to the power (month minus 1). A group's lowest-numbered member creates it and joins that month; every other member joins after a geometric delay of 0, 1, 2, ... months with a 40% chance per month. Groups and users that would arrive after month 60 never appear. A user is active in the month they join."
 },
 "activity": {
  "intercept": -2.2,
  "last_month": 3.6,
  "user_sd": 1.0,
  "group_sd": 0.5,
  "shock_memory": 0.7,
  "shock_sd": 0.08,
  "coupling_reference": 0.5,
  "rule": "From the month after joining, a user is active with chance logistic(-2.2 + 3.6 x active last month + user effect (normal, SD 1.0) + first-group effect (normal, SD 0.5) + month shock + coupling x (share of the user's joined group-mates active last month minus 0.5)). A user with no joined group-mate gets no coupling term. The month shock is shared by every user: shock(t) = 0.7 x shock(t minus 1) + normal noise with SD 0.08 (0 in the control setting)."
 },
 "settings": [
  {
   "name": "none",
   "coupling": 0.0,
   "shock": true,
   "label": "no coupling"
  },
  {
   "name": "moderate",
   "coupling": 1.0,
   "shock": true,
   "label": "moderate coupling"
  },
  {
   "name": "strong",
   "coupling": 2.0,
   "shock": true,
   "label": "strong coupling"
  }
 ],
 "coupling_reason": "Coupling is the change in the log odds of being active between a user whose joined group-mates were all inactive last month and one whose group-mates were all active: 0, 1 and 2, so the odds differ 1, 2.7 and 7.4 times.",
 "base_setting": "moderate",
 "zero_setting": "none",
 "strong_setting": "strong",
 "test": {
  "start_month": 36,
  "population": "Users active in month 36 (the test users). Nobody else is ever treated.",
  "treatment": "From month 37 on, a treated user's log-odds of being active each month rise by the lift. The lift adds to the activity model's log-odds; nothing else changes.",
  "lifts": [
   0.3,
   0.15
  ],
  "lengths": [
   3,
   6,
   12
  ],
  "outcome": "Active in the test's last month (month 36 plus the length), among the test users.",
  "user_test": "Half of the test users (rounded down) treated, chosen at random. Difference in the share active between arms, with a Welch interval (sim.groups.user_difference, unchanged).",
  "group_test": "Test users take their first group's assignment; half (rounded down) of the first groups holding a test user are treated, chosen at random. Users in two groups follow their first group. Difference in the share active between arms, with an interval clustered by first group (sim.groups.cluster_difference, unchanged).",
  "same_size": "Both tests use the same test users in the same history; only the unit of randomization differs.",
  "full_effect": "Every test user treated against no test user treated, in the same history with the same draws: the share active in the outcome month, everyone treated minus nobody treated."
 },
 "primary": {
  "lift": 0.3,
  "length": 6
 },
 "example": {
  "history": 0,
  "rule": "History 0 of the base setting at the primary lift and length, declared before the run; it is not chosen to show a pattern."
 },
 "metrics": {
  "share_measured": "Per setting, lift, length and design: mean estimate over histories divided by mean full effect over histories, with a bootstrap 95% Monte Carlo interval (resampling histories).",
  "bias": "Mean of (estimate minus the history's full effect), in percentage points, with the same interval.",
  "spread": "Standard deviation over histories of (estimate minus the history's full effect); the group test's over the user test's.",
  "coverage": "Share of histories whose 95% interval contains that history's full effect.",
  "power": "Share of histories whose 95% interval lies above zero.",
  "pieces": "Estimate minus full effect = treated shortfall (treated arm minus the same users with everyone treated) minus control lift (control arm minus the same users with nobody treated) plus chance imbalance (the remainder: the arms' split of users who would differ anyway). The pieces add up by construction; their sizes are what the split shows."
 },
 "summary": {
  "bootstrap_seed": 2929,
  "bootstrap_replicates": 2000
 },
 "predictions": [
  {
   "id": "no_coupling_unbiased",
   "text": "With no coupling, at the primary lift and length, the user test and the group test each measure 95% to 105% of the full effect. A safe bet: with no coupling no user's activity depends on another's, so both are unbiased by construction; only Monte Carlo noise could fail it."
  },
  {
   "id": "user_misses_moderate",
   "text": "At moderate coupling, primary lift and length, the user test measures 70% to 95% of the full effect."
  },
  {
   "id": "user_misses_more_strong",
   "text": "At strong coupling, primary lift and length, the user test measures less than at moderate coupling, and less than 85% of the full effect."
  },
  {
   "id": "group_recovers",
   "text": "At the primary lift and length, the group test measures at least 92% of the full effect in every coupling setting."
  },
  {
   "id": "precision_cost",
   "text": "At moderate coupling, primary lift and length, the group test's spread is 1.0 to 1.5 times the user test's."
  },
  {
   "id": "longer_tests_miss_more",
   "text": "At moderate coupling and the primary lift, the user test measures a smaller share of the full effect at 12 months than at 3 months."
  }
 ],
 "predictions_rule": "Each prediction is scored held or missed on its point value after the run; a prediction holds only if every part holds. Misses are reported, never rerun with other draws.",
 "checks": {
  "census": "3 settings x 200 histories x 2 lifts x 3 lengths = 3,600 rows; every value finite.",
  "sizes": "The user test treats exactly half (rounded down) of the test users; the group test treats at least one user.",
  "replay": "The nobody-treated world's monthly active users, months 1 to 48, equal group-forecast-months.csv for every setting and history (28,800 month counts). A wrong replay of the simulator fails it; the tests show a changed coupling failing it.",
  "no_coupling_gap": "With no coupling, each design's mean gap from the full effect is within 4 Monte Carlo standard errors plus 0.1 point, at every lift and length. A test that leaks treatment between users with no coupling fails it.",
  "failed_check_rule": "A failed check is reported and kept; nothing is rerun with other random draws."
 },
 "replay_reference": "group-forecast-months.csv",
 "outputs": [
  "retention-test.json",
  "retention-test-runs.csv"
 ],
 "frozen_sha256": {
  "vendor/readout_rule/decision.py": "d385cbbedddf605ffc00a59de9fc547ff7f641db2c1f4f6699811fc805fab43a",
  "data/protocol.json": "07bb54ed1ab973adc7ce79d32d0abfc5f49c28df3e3dbb20b69a014ec9ad73be",
  "data/decision-protocol.json": "94e7fd25bc3087ed07fdd84898e3bcf90416602fcca8a674e31f97c91aed41b4",
  "results.json": "c1f085fd7de02bc02adaed497225fd8c8513ff4d8bd3c041d09f78d7f9900e5e",
  "scenarios.csv": "86e6683f683b9d36435b6dec46084701cdaff56a565bfff0143fe937ab3a6aa0",
  "sensitivity.json": "744b26854cb67df63b5af161bfaaf5f7250cc71a5dc42c2a9ff6d7f64be43aa7",
  "sensitivity-ar1.csv": "446c7db26584bd0e3b621cafa94602047c3c8ee969762b8cf551a2fd11d18623",
  "sensitivity-blocks.csv": "e5a39e0280d869add9ba3af5fa558c1e50ecbfaf14d6d3a069fc88ee86080136",
  "decision.json": "3f1859995ee633c6a62b864b0defdad06ee272e73bdc510e7bccf735a3eb4bbe",
  "decision-runs.csv": "09c5fd8cea17a544c62ee3fac75c6f0410885f50ded52f49dfc85b4a59170d1c",
  "sequential.json": "3943519b57e1afdbd304d92f4fdf402cbd60b2537104cf5195152761dd3b7bb5",
  "sequential-runs.csv": "bd64b8c9c248774096eb5304fd718e83c3c61de91387ea2c679030aedb71d9ae",
  "looks.csv.gz": "60abcc2701265caae4fcf1ae965aafe525dc29607d1e86d9e6f6727053cc49cc",
  "carryover-sweep.json": "9a4d127767c8a81dca7c820e9c7375040e358f8b812c504e5c214630a0b1e160",
  "carryover-sweep.csv": "ee8a10be33cf6cc397aff390ab80842f879284b496b37fe739d52bf26f3f0f10",
  "data/groups-protocol.json": "a79a2fec08428ef58f16c49dab67a415f481fc0404699e7b26af391169243ef5",
  "groups.json": "a223dd923b5b80a9936e2664ef293b29e110a6e9a997abba47421af3c41c6edf",
  "groups-runs.csv": "d75c34d7162e0c2da255d6e3702e5841d61b7e49a00d0de6b678e4d1c6503525",
  "groups-populations.csv": "7e5a509bb30314cf685724aa934c816dd84c67ed9ea0ef45ed9da50b4cefbfd1",
  "groups-tiebreak.json": "cf5eeeddc8a792ba89f6560aab4431c33ea74f34cd4ef937ec24c310a9304709",
  "groups-tiebreak-runs.csv": "6039b40b8d14ab7785cd5c3869ec93c8b53b5a26d2b3fcb5c681100511d11f3d",
  "groups-tiebreak-populations.csv": "5cbe4ff0a41c76fdba7799fc46a7ae94a0085da14ddec9a9eec30256cec18c07",
  "data/groups-tiebreak-protocol.json": "a0b079dae0b30dbf68249c2b2164c15f10eaab9e0ee52e769fb22a6176de2214",
  "sim/groups.py": "97da056b4ff82f60d8a155323b1b12b8cc851546b5279750254a84237e3608c6",
  "data/group-forecast-protocol.json": "afa0fe92e42f93f514798c1565c48f1158e8b35ca5b093d2f448986325131f77",
  "group-forecast.json": "d6d2529137eebb315a75769894c287db09e85824f386745068195796d4652663",
  "group-forecast-months.csv": "a8a56db416ef01ed3aa1df9c6f1627c7540c6f8b3af1ef220507c2e713c4d057",
  "group-forecast-runs.csv": "553b37cc20624951095e751bee41baadafda538d5c36031b7a9669f710625a05",
  "group-forecast-events.csv": "161a59a34c38b0bab285c97ce2daf6b58e2016a2cce3d0ff819d421f9bbd0d0d",
  "sim/group_forecast.py": "f0cd0dac79760f453039deb457677c12856456a88dd25ad3566b3bf1a1973f62",
  "sim/inference.py": "ef887873f7ba59715ec012d6d0f23c654cd06e50f87d948eff051f6f3a1c130e"
 }
}
