{
  "version": 1,
  "basis": "Declared next part of the marketplace experiment designs study, on the shared-groups simulator: forecasting monthly active users when a user's chance of staying active depends on how much of their group was active. Declared before any run of the forecasting code on the declared seed; every earlier run and its files are unchanged.",
  "declaration": "DESIGN-group-forecast.md",
  "seed": 23,
  "histories": 200,
  "replication_rule": "200 simulated histories per setting (50 for the control setting), no reduction. Every setting reuses the same draws for the same history (spawn keys (0, history) for the groups, (1, history) for arrivals and joining, (2, history) for user and group effects, monthly shocks and activity draws), so settings differ only by the coupling and the shock switch.",
  "pilot": "A calibration and timing pilot on the reserved seed 90017 (3 histories per coupling) read only activity levels and time: over months 37 to 60 about 85% of a month's active users were active the next month and about 8% of joined, inactive users came back; about 0.05 s to simulate a history. It ran no plan and computed no forecast error. The settings below are the ones the pilot ran.",
  "months": 60,
  "fit_months": 36,
  "origins": [
    36,
    57
  ],
  "origins_rule": "Each plan is fitted on months 1 to 36 only, once per history. From every origin month 36 to 57 it forecasts 1, 2 and 3 months ahead using the data observed up to the origin and the rates fitted on months 1 to 36. 22 origins per horizon, targets months 37 to 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"
    },
    {
      "name": "control",
      "coupling": 0.0,
      "shock": false,
      "histories": 50,
      "scored": false,
      "label": "control: no coupling, no month shock"
    }
  ],
  "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",
  "plans": {
    "tenure_bucket_starts": [
      0,
      1,
      2,
      3,
      6,
      12
    ],
    "growth_fit_first_month": 13,
    "user_plan": "Fitted on months 1 to 36: the chance a user is active next month, by tenure bucket (months since joining: 0, 1, 2, 3 to 5, 6 to 11, 12 or more) and whether they are active this month. At an origin every joined user starts from their observed state and is carried forward month by month through those chances as their tenure grows; planned new users are active in their joining month and carried forward the same way. The plan is the sum of expected actives (the active-drivers method at user level).",
    "group_plan": "Fitted on months 1 to 36: the chance a group (active when at least one first-group member is active) is active next month, by group tenure bucket (months since it was created) and whether it is active this month; users per active group, by tenure bucket and whether the group was active the month before; users per active group in a group's first month. At an origin every created group starts from its observed state and is carried forward; expected actives are expected active groups times users per active group, plus planned new groups times users per new group, carried forward the same way.",
    "naive": "Last year times recent growth: actives in the target month a year earlier, times actives at the origin over actives twelve months before the origin.",
    "arrivals": "Planned new users (user plan) and new groups (group plan) for origin + m: the mean of the origin month and the two months before it, times (1 + g)^m, where g is the monthly growth of a least-squares line through the log of monthly new users (new groups) over months 13 to 36."
  },
  "metrics": {
    "error": "Percentage error per forecast: (plan minus actual) / actual x 100. Per history, method and horizon: mean absolute error over the 22 origins, and mean signed error (bias).",
    "summary": "Per setting, method and horizon: mean over histories with a bootstrap 95% Monte Carlo interval (resampling histories), and the middle 90% of histories (5th to 95th percentile). Paired difference of the group plan and of last year times growth against the user plan, per history, with the same interval and the share of histories where it is lower.",
    "account": "User level per month: new (joined this month), retained (active this and last month), returning (active this month, not last month, joined before), lapsed (active last month, not this month). Group level the same with groups (a group is new in the month it is created). Users per active group: actives over active groups. Rates over months 37 to 60, each flow summed over the months and divided by the previous month's actives (or active groups) summed.",
    "bridge": "The group plan one month ahead. Actual minus plan splits into: new groups (actual minus planned new groups, times the plan's users per new group), groups kept or lost (actual minus planned active groups among those created by the origin, times the plan's users per such group), and users per active group (actual users minus actual groups times the plan's users per group, for both kinds). The three pieces add up exactly (bookkeeping). Per setting: how often each piece is the largest in absolute size, and its mean absolute size as a share of actual actives.",
    "most_active_member": "For each month 13 to 58 and each group with at least 3 first-group members who joined at least 6 months earlier: the most active member has the most active months over the previous 6 (ties: lowest user number) and was active last month. Followers are the group's other members active last month and this month. A follower lapses if inactive in either of the next two months. Per history: the share of followers who lapse when the most active member lapsed this month, minus the share when the most active member stayed active. Per setting: mean over histories with a bootstrap interval; and the base coupling's gap minus the no-coupling gap, paired by history.",
    "worked_example": "Base coupling, history 0: the first group (by month from 37, then group number) with at least 4 such members where the most active member lapsed and at least two followers lapsed within two months. It is chosen to show the pattern, not as a typical group."
  },
  "events": {
    "lookback": 6,
    "min_members": 3,
    "example_members": 4,
    "first_month": 13,
    "last_month": 58
  },
  "summary": {
    "bootstrap_seed": 2323,
    "bootstrap_replicates": 2000
  },
  "predictions": [
    {
      "id": "user_beats_naive",
      "text": "One month ahead, in each of the three coupling settings, the user plan's mean error is below last year times growth's."
    },
    {
      "id": "no_coupling_no_gain",
      "text": "With no coupling, one month ahead, the group plan's mean error is at least the user plan's."
    },
    {
      "id": "group_plan_three_months",
      "text": "At the base (moderate) coupling, three months ahead, the group plan's mean error is below the user plan's."
    },
    {
      "id": "coupling_harder",
      "text": "The user plan's three-month mean error at strong coupling is at least 1.2 times its error with no coupling."
    },
    {
      "id": "bridge_users_per_group",
      "text": "At the base coupling, users per active group is the largest piece of the group plan's month-ahead miss in more than half of the months."
    },
    {
      "id": "hidden_cascade",
      "text": "At the base coupling, followers lapse after the most active member lapses at least 5 points more often than when the most active member stays, beyond the same gap with no coupling (paired by history)."
    }
  ],
  "predictions_rule": "Each prediction is scored true or false 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 x 200 + 50 = 650 histories: 650 x 22 = 14,300 plan rows and 650 x 60 = 39,000 month rows; every plan value finite.",
    "flow_identity": "Bookkeeping: actives this month minus last month equals new plus returning minus lapsed, for users and for groups, in every month. It confirms the accounting code, not a finding.",
    "bridge_closes": "Bookkeeping: the three bridge pieces add up to actual minus plan within 1e-6 users in every month.",
    "control": {
      "setting": "control",
      "user_plan_max_error": 2.0,
      "group_plan_max_error": 3.0,
      "max_abs_bias": 1.0,
      "rule": "With no coupling and no month shock, one month ahead: the user plan's mean absolute error is at most 2.0% and the group plan's at most 3.0%, and each plan's mean signed error is within 1.0 point. A wrongly built plan fails this; it is the check with a positive control in the tests."
    },
    "reported_either_way": "A failed check is reported and kept; no outcome is rerun with other draws."
  },
  "outputs": [
    "group-forecast.json",
    "group-forecast-months.csv",
    "group-forecast-runs.csv",
    "group-forecast-events.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"
  }
}
