Chips & Truths No spin. Just the math.

The Persistence Amplification Model of Electronic Gambling Losses

A research-style paper integrating near-misses, LDWs, loss chasing, frictionless payment, and vulnerability into a unified model of persistent play.

By H. Omer Aktas

The Persistence Amplification Model of Electronic Gambling Losses: Near-Misses, Losses Disguised as Wins, Loss Chasing, and Payment Friction in Electronic Gambling and Loot-Box Systems

Abstract

Electronic gambling machines, online slots, and randomized digital reward systems are usually described in terms of chance, entertainment, and consumer choice. That vocabulary captures only part of what happens during play. A game’s mathematical odds do not, by themselves, determine the player’s experience. The same losing outcome can be presented as an ordinary failure, an “almost win,” a partial success, or a temporary setback on the way to recovery, and each presentation tends to produce a different behavioral response even when expected value is held constant.

This paper develops the Persistence Amplification Model of Electronic Gambling Losses, a framework for explaining how near-misses, losses disguised as wins, accumulated loss, reduced payment friction, and player vulnerability interact to prolong play. The model draws on gambling-disorder research, behavioral economics, reinforcement theory, the cognitive-distortion literature, affective neuroscience, and recent product-safety debates surrounding electronic gambling and loot boxes.

The contribution is threefold. The paper first brings together several research strands that are usually treated in isolation: near-miss effects, losses disguised as wins, variable-ratio reinforcement, electronic gaming machine design, gambling-related cognitive distortions, randomized digital rewards, and responsible-gambling regulation. It then formalizes a stopping-and-continuation model in which persistence depends on how outcomes are framed as well as on payout structure. Finally, it presents a reproducible simulation built around a fixed random seed, explicit payout assumptions, stopping equations, chasing-escalation rules, regression output, diagnostics, and sensitivity checks.

In the simulation, persistence is lowest when losses are presented plainly and highest when near-misses, losses disguised as wins, and frictionless payment occur together. The simulation is offered as a transparent theoretical demonstration of these mechanisms rather than as real-world evidence; the mechanisms it isolates should be tested against experimental or session-level data. The broader argument is that gambling regulation and product-safety assessment need to reach beyond return-to-player percentages and random-number-generator certification. Speed, feedback, payment, audiovisual reinforcement, and the staging of “almost winning” belong inside the risk structure of the product.

1. Introduction

A player who keeps going during a losing streak seems, on the surface, to be working against his own interest. The expected value of electronic gambling is negative, and each additional wager increases exposure to the house edge. Yet prolonged play after repeated losses is common: players continue, raise their stakes, reload funds, or return later to recover what they lost. The puzzle runs deeper than a misunderstanding of probability. Most players know, at least in broad terms, that the game is unfavorable. What needs explaining is why that knowledge loses its grip during play.

Part of the answer lies in how electronic gambling environments present their outcomes. These products do more than generate random events. They translate those events into light, sound, motion, timing, and credit movement, and in doing so they can make a losing outcome feel like something other than a loss. A near-miss suggests proximity. A partial return can register as success. A rapid reload can make continued play feel less like a fresh financial decision than like the uninterrupted continuation of a single session.

From the standpoint of expected value, a losing spin is simply a losing spin. From the standpoint of motivation, losses are not interchangeable. A plain loss, a near-miss, and a loss disguised as a win can produce very different levels of frustration, arousal, perceived progress, and willingness to continue. Near-misses increase the motivation to gamble and recruit win-related brain circuitry even though the outcome is objectively unsuccessful (Clark et al., 2009). Losses disguised as wins generate physiological and perceptual responses closer to wins than to ordinary losses in multiline slot play (Dixon et al., 2010).

This paper argues that persistence through a losing streak is best understood as an interaction among probability, presentation, payment, and personal vulnerability. The Persistence Amplification Model of Electronic Gambling Losses is the original contribution. It does not claim that near-misses, losses disguised as wins, or payment friction are newly discovered in isolation; rather, it integrates them into a single account of why negative-value play can intensify at exactly the point where a rational player should walk away.

The framework reaches past the casino floor. Loot boxes, gacha mechanics, randomized card packs, mystery chests, and digital prize wheels have brought chance-based reward systems into mainstream video games. The loot-box evidence calls for caution: studies repeatedly find associations between loot-box purchasing and problem-gambling measures, but most of this work is cross-sectional and cannot establish causation (Zendle & Cairns, 2018; DCMS, 2022). The structural overlap is harder to dismiss. Many randomized digital reward systems combine uncertain rewards, rarity displays, payment abstraction, and repeated purchase opportunities. They are not equivalent to casino gambling in every legal or economic sense, but they recruit related behavioral principles.

The pertinent question, then, is not only whether a product is random or whether its odds are technically disclosed. It is how the product makes randomness feel. Where losses are represented as near-successes, partial victories, or recoverable setbacks, the behavioral risk of the product cannot be read off the paytable.

2. Core Concepts

A near-miss is a losing outcome that resembles a winning one. On a slot machine it might involve two jackpot symbols landing on the payline while the third stops just above or below it. In a loot-box or prize-wheel animation it might involve the display sweeping past a rare item before settling on a common one. What defines the near-miss is perceived rather than mathematical closeness: the event communicates “almost,” even though it carries no information about the next result (Reid, 1986; Clark et al., 2009).

A loss disguised as a win (LDW) occurs when the return is smaller than the wager but the game celebrates the outcome anyway. A player who bets 100 credits and receives 40 has lost 60. If the machine answers with celebratory sounds, flashing lights, and win-like animation, the sensory message contradicts the financial result. In fast multiline environments this contradiction has consequences, because players may encode the event as positive even as their bankroll falls (Dixon et al., 2010; Barton et al., 2017).

Loss chasing is continued or intensified gambling driven by the desire to recover prior losses. It can happen within a session, where the player keeps going to “get back to even,” or across sessions, where the player returns later to repair an earlier loss. Chasing is clinically significant because it ties together financial loss, emotional distress, impaired control, and escalation (American Psychiatric Association, 2013; World Health Organization, 2019).

Payment friction is the psychological and procedural resistance involved in spending money. Physical cash makes loss visible: the player watches money leave his hand. Digital credits, stored balances, virtual currencies, instant deposits, casino markers, and one-click reloading erode that visibility, so the spending decision grows less salient and continued play feels less like a fresh act of paying (Prelec & Loewenstein, 1998; Schull, 2012).

Session persistence is the continuation of play after loss. It can be captured through number of spins, time on device, the probability of continuing after a losing event, reload behavior, stake escalation, or return after a losing session.

Vulnerability covers player-level characteristics that heighten sensitivity to gambling cues: impulsivity, stress, prior gambling involvement, financial pressure, distorted gambling beliefs, or impaired self-regulation. The model does not assume that design features act on every player equally. It predicts stronger effects among players who are already more reactive to gambling-related cues (Raylu & Oei, 2004; Clark et al., 2009).

3. Literature Review

3.1 Gambling Disorder and the Problem of Impaired Control

DSM-5 places gambling disorder among the addictive disorders, reflecting the view that persistent gambling problems share features with substance-related addictions, including craving, impaired control, tolerance-like escalation, and continuation despite harm (American Psychiatric Association, 2013). ICD-11 likewise defines gambling disorder through impaired control, increasing priority given to gambling, and continuation despite negative consequences (World Health Organization, 2019).

This clinical framing moves the discussion away from simple moral judgment. Players do not continue merely because they are careless or unintelligent. In harmful gambling, self-regulation becomes compromised under conditions of reward uncertainty, emotional arousal, financial pressure, and distorted outcome interpretation. Loss chasing is one expression of that compromised control: the player does not experience continued gambling as reckless spending but as a possible route back to emotional and financial repair.

A product-safety approach has to look past diagnosis. Many players experience gambling-related harm without meeting full clinical criteria, and debt, secrecy, family conflict, shame, work disruption, and stress can all appear before any formal disorder. If particular product features increase persistence during losing streaks, those features warrant scrutiny even when most users never develop a diagnosable disorder.

3.2 Near-Misses: Losing Outcomes That Motivate Continued Play

The near-miss has long held a central place in gambling psychology. Reid (1986) described it as a losing outcome that can nonetheless encourage continued play because it resembles success. In skill-based settings the logic is intuitive. A basketball shot that nearly drops may suggest improved aim; a near-miss in archery, darts, or tennis often carries usable feedback. Under random-number generation, the same intuition misleads. A slot symbol stopping just above the payline does not bring the jackpot any closer.

Clark et al. (2009) supplied a major neurocognitive account of the mechanism. In a slot-machine task, near-misses were rated as less pleasant than wins yet increased the desire to keep gambling, and they recruited reward-processing regions including striatal circuitry. That combination accounts for the dual character of the near-miss, which is frustrating and motivating at once. The player registers loss and proximity simultaneously.

Chase and Clark (2010) extended the work by showing that gambling severity predicted midbrain response to near-miss outcomes, which implies that near-misses may bite hardest among those already more involved in gambling. In a systematic review, Barton et al. (2017) concluded that near-misses are often more arousing and motivating than ordinary losses, though effects vary with design, population, and measurement.

Near-misses, in short, create a false continuity between independent events. The machine has not edged closer to a win, but the player feels that it has, and a loss that means nothing mathematically acquires meaning anyway.

3.3 Losses Disguised as Wins

Losses disguised as wins matter most in multiline slot machines, where a player can collect a payout on one or more lines while still losing money overall. Dixon et al. (2010) showed that these events can produce arousal patterns more like wins than ordinary losses: the player’s net position worsens while the machine’s sensory response signals success.

The mechanism alters the perceived rhythm of play. A machine that celebrates only true net wins creates one reinforcement environment; a machine that also celebrates partial returns below stake creates another. The second adds win-like events without improving expected return, raising the emotional frequency of winning while leaving the financial structure of losing untouched.

Barton et al. (2017) noted that LDWs can distort players’ sense of how often they are winning, which becomes consequential during rapid play, where players rarely tally each net result. A player may remember a machine as “paying often” even though many of those payments fell below the amount wagered.

Regulators have started to recognize the distinction. The UK Gambling Commission’s online game-design rules prohibit sounds or imagery that make a return equal to or below the stake appear as a win (UK Gambling Commission, 2021), treating the presentation of loss as a safety question rather than a decorative one.

3.4 Variable-Ratio Reinforcement and the Pull of Uncertainty

Variable-ratio reinforcement schedules sustain responding because rewards arrive after an unpredictable number of actions (Ferster & Skinner, 1957). Gambling products are not laboratory Skinner boxes, but the principle transfers cleanly. The next spin might be the winning spin; the next box might hold the rare item; the next hand might repair the session.

Uncertainty grows more powerful when events come fast. Electronic gaming machines compress stake, suspense, outcome, and reinvestment into a few seconds, letting reinforcement patterns repeat before reflection can intervene. Griffiths (1993) identified structural characteristics such as event frequency, stake size, and audiovisual feedback as central to machine gambling, and Schull (2012) later characterized machine gambling as a continuous, immersive form of play in which time and money recede into the background.

Uncertainty does not account for persistence on its own. The modern machine does not simply randomize outcomes; it stages them. A near-miss, a bonus tease, a partial return, or a celebratory animation reshapes the player’s relationship to the outcome. The game functions as a feedback system, not only a probability device.

3.5 Structural Characteristics of Electronic Gaming Machines

The structural-characteristics literature examines how design features shape gambling behavior, including spin speed, stake range, credit format, bonus rounds, autoplay, stop buttons, multiline betting, near-miss presentation, and audiovisual reinforcement (Griffiths, 1993; Harrigan & Dixon, 2009; Schull, 2012).

Harrigan and Dixon (2009) demonstrated that slot-machine design can open a gap between the visible experience of the game and its underlying mathematical structure. Probability accounting reports show how reel mapping, symbol weighting, and payout design produce experiences that are not obvious to players, who encounter the game as a sensory interface rather than as a mathematical table.

Schull’s ethnographic work adds another layer. Many machine gamblers are not chiefly chasing excitement; they are seeking immersion, rhythm, and escape. The “machine zone” describes a state of absorption in continuous interaction with the device (Schull, 2012), and within that state small differences in speed, sound, payment, and feedback can carry large weight.

3.6 Cognitive Distortions in Gambling

Gambling-related cognitive distortions include the illusion of control, the gambler’s fallacy, interpretive bias, predictive control, and a perceived inability to stop. Raylu and Oei (2004) developed the Gambling Related Cognitions Scale to measure these patterns, and Goodie and Fortune (2013) later reviewed their measurement and underlined their relevance to gambling severity.

The illusion of control is especially pertinent in electronic games. Langer (1975) showed that people may behave as though they have control in chance situations whenever features of skill are present. Stop buttons, manual timing, player choice, and interactive animations can all cue this illusion, and even when they leave the outcome untouched they can change how the player relates to it.

Near-misses reinforce the effect by dressing random failure as performance feedback. LDWs reinforce it along a different route, by recasting financial loss as partial success. Both can prop up the belief that continued play is reasonable, strategic, or on the verge of paying off.

3.7 Affective Neuroscience and Reward Processing

Gambling decisions are not made by calculation alone. Wins, near-misses, and losses generate affective responses: excitement, frustration, bodily arousal, regret, relief, and craving. Clark et al. (2009) found that near-misses recruited win-related neural circuitry while raising the desire to gamble; Chase and Clark (2010) found that gambling severity predicted midbrain response to near-misses; Dixon et al. (2010) showed that LDWs can produce arousal closer to wins than losses.

The implication is that negative financial outcomes can still motivate. A near-miss is unpleasant yet can sharpen the urge to continue, and a loss disguised as a win blunts the clarity of negative feedback. In both cases the emotional signal diverges from the mathematical one.

This is why education about odds has limited force during play. The player may know the game is random while the interface delivers immediate affective cues that say otherwise: close, promising, paying, warming up, worth another try.

3.8 Loot Boxes, Gacha, and Randomized Digital Rewards

Loot boxes and gacha systems import chance-based reward mechanics into video games, and they vary widely. Some are earned through play, some are purchased, some contain cosmetic items, and some confer competitive advantage, so they should not be treated as a single category.

The strongest available evidence is not that loot boxes cause gambling disorder. The more defensible conclusion is that loot-box spending is repeatedly associated with problem-gambling measures while the causal direction remains unresolved (Zendle & Cairns, 2018; DCMS, 2022). Players with gambling problems may spend more on loot boxes; loot boxes may increase gambling-like behavior; or both may reflect shared vulnerability factors such as impulsivity or reward sensitivity.

The structural overlap still deserves attention. Loot boxes frequently combine payment abstraction, uncertain reward, rarity hierarchy, suspense animation, near-miss presentation, and repeated purchase opportunities. Where they are available to minors, they may normalize paying for uncertain outcomes well before the player ever meets regulated gambling. Even where the legal category differs, the behavioral questions persist.

3.9 Responsible Gambling and Safer Product Design

Responsible-gambling interventions have traditionally centered on the player: information, self-exclusion, deposit limits, time limits, and treatment referral. These measures matter, but they fall short when the product itself is built to intensify persistence. A safer-gambling framework therefore has to examine the architecture of play alongside the user (Blaszczynski et al., 2004; UK Gambling Commission, 2021).

The UK Gambling Commission’s online slot rules offer a leading example of design-based regulation. They restrict autoplay, require a minimum spin speed of 2.5 seconds, prohibit features that speed up play or manufacture an illusion of control, and ban audiovisual effects that present net losses as wins (UK Gambling Commission, 2021). Under this approach, speed, feedback, and payment are treated as risk factors rather than neutral presentation choices.

4. The Persistence Amplification Model

The model treats continued play during a losing streak as the outcome of a dynamic interaction between objective loss and amplified motivation. The player does not decide in one clean moment whether to stop or continue. Instead, each event updates a set of pressures: financial deficit, arousal, perceived proximity, and ease of continuing.

At any moment (t), the probability of continuing can be written as:

[ P(Continue_t = 1) = \sigma!\left( \alpha

  • \beta_1 NearMiss_t
  • \beta_2 LDW_t
  • \beta_3 CumulativeLoss_t
  • \beta_4 FrictionlessPayment_t
  • \beta_5 Vulnerability_i
  • \beta_6 Arousal_t \right) ]

where (\sigma) is the logistic function and (i) indexes the player.

The terms carry distinct meanings. (NearMiss_t) captures whether the most recent loss looked like a close success. (LDW_t) captures whether the player received a net-negative return presented as a win. (CumulativeLoss_t) measures how far the player is down. (FrictionlessPayment_t) reflects whether payment barriers are low: stored balances, rapid reloads, virtual currencies, or account-linked deposits. (Vulnerability_i) summarizes player-level risk factors, and (Arousal_t) carries the emotional state from one event to the next.

Arousal can be modeled recursively:

[ Arousal_t = \rho Arousal_{t-1} + \lambda_1 NearMiss_t + \lambda_2 LDW_t + \lambda_3 Win_t ]

with (0 < \rho < 1). The key point is not the exact form but the carryover: emotionally charged outcomes do not reset instantly. Near-misses, LDWs, and wins can all sustain momentum even when the session is becoming less favorable in financial terms.

The model predicts that persistence is weakest where losses are presented plainly and payment is effortful, and strongest where near-misses, LDWs, fast event rates, and easy reloads are layered together.

5. Hypotheses

From the model, five testable hypotheses follow.

  1. Near-miss-enriched environments produce longer sessions than ordinary-loss environments.
  2. Environments rich in losses disguised as wins produce longer sessions than ordinary-loss environments.
  3. A combined environment containing near-misses, LDWs, and frictionless payment produces the strongest persistence.
  4. Player vulnerability predicts persistence across all conditions.
  5. Frictionless payment strengthens the tendency to continue after loss.

6. Illustrative Simulation Study

6.1 Purpose

Because product-level session data are rarely public, the paper uses a transparent simulation rather than proprietary operator data. The aim is methodological: to show how structural design variables can be modeled while holding baseline payout structure constant.

6.2 Conditions

A synthetic sample of 3,200 players was generated and assigned evenly across four conditions:

ConditionDescription
Ordinary lossesStandard losses with no enhanced near-miss or LDW treatment
Near-miss enrichedElevated frequency of visually salient near-misses
LDW enrichedElevated frequency of celebratory net-loss events
Combined high-risk conditionNear-misses, LDWs, and low-friction payment continuation

Players began with a bankroll of 100 units. In the combined condition, limited top-ups were allowed to stand in for rapid reloads or low-friction continuation.

6.3 Stopping rule

Stopping probability after each event followed a logistic rule:

[ P(Stop_t = 1) = \sigma!\left( \gamma_0

  • \gamma_1 SpinCount_t
  • \gamma_2 CumulativeLoss_t
  • \gamma_3 NearMissCondition_i
  • \gamma_4 LDWCondition_i
  • \gamma_5 CombinedCondition_i
  • \gamma_6 Vulnerability_i
  • \gamma_7 Arousal_t \right) ]

Lower stopping probability implies longer persistence.

6.4 Outcomes

Four outcomes were tracked: number of plays, total amount wagered, final net loss, and whether the player entered a chasing state. Chasing was coded where the player continued after large losses, escalated stake following loss, or replenished funds after depletion.

7. Simulated Results

7.1 Descriptive results

ConditionnMean playsSDMedian playsChasing rateMean net lossMean amount wagered
Ordinary losses80063.033.756.019.4%36.168.6
Near-miss enriched80077.739.173.533.1%47.390.4
LDW enriched80082.848.774.026.4%38.994.6
Combined high-risk condition800155.073.5152.066.9%122.1299.1

The ordering follows the theory. Ordinary losses produce the shortest sessions. Near-misses and LDWs each lift persistence independently. The combined condition produces the longest sessions and the highest chasing rate.

7.2 Regression model: session length

An ordinary least squares model was estimated with log session length as the dependent variable, using ordinary losses as the reference category.

PredictorCoefficientRobust SE95% CIp-valueApproximate effect
Intercept4.0040.018[3.969, 4.039]< .001-
Near-miss enriched0.2110.026[0.160, 0.262]< .001+23.5%
LDW enriched0.2200.028[0.166, 0.275]< .001+24.7%
Combined high-risk condition0.8940.027[0.841, 0.948]< .001+144.6%
Vulnerability0.1740.009[0.155, 0.192]< .001+19.0% per unit

The near-miss and LDW conditions each increase session length by roughly one quarter. The combined condition increases it by far more, which is consistent with compounding structural risk.

7.3 Logistic model: chasing behavior

PredictorCoefficientSE95% CIp-valueOdds ratio
Intercept-1.6170.096[-1.805, -1.428]< .0010.199
Near-miss enriched0.8110.124[0.568, 1.054]< .0012.25
LDW enriched0.4200.127[0.171, 0.669].0011.52
Combined high-risk condition2.4410.128[2.190, 2.691]< .00111.48
Vulnerability0.8480.048[0.754, 0.942]< .0012.34

The combined condition again dominates. Vulnerability remains a strong independent predictor, which fits the model’s interactional view of product structure and personal risk.

8. Discussion

The results support a structural account of persistent play. Near-misses and LDWs are not incidental flourishes; they change how losses are interpreted. A plain loss says money is gone. A near-miss says success was close. An LDW says something positive happened, even when the net position worsened.

Players respond to the event as presented, not solely to the accounting result. That is why a product’s risk cannot be inferred from RTP alone. A relatively generous payout structure can still be dangerous if the game is fast, loaded with event-like feedback, and easy to keep playing. Structural risk belongs to the whole environment, not to the house edge in isolation.

9. Regulatory Implications

A product-safety approach should examine how losses are displayed, not just how outcomes are generated. Several consequences follow.

Net losses should be presented as losses, without celebratory imagery or sound. Near-miss density should be auditable, and regulators should distinguish between incidental near-misses arising from random display and design choices that emphasize them. Speed controls, autoplay restrictions, and payment friction are safety features, not cosmetic options. And randomized digital reward systems aimed at minors should face the same scrutiny when real money buys uncertain outcomes.

10. Clinical Implications

The model supports interventions aimed at distorted gambling beliefs. Cognitive-behavioral treatment can help players challenge thoughts such as “I was close,” “the machine is due,” or “I can recover if I keep going.” But the paper also argues that treatment cannot carry the whole burden where products are deliberately structured to intensify persistence.

11. Limitations

The empirical section is simulated. It does not estimate real-world prevalence, effect sizes, or operator behavior. The parameters are theoretically motivated but not calibrated to proprietary session logs. Real players also differ in ways the model compresses into a single vulnerability term. A fuller empirical program would need laboratory experiments, session-level records, and longitudinal follow-up.

12. Conclusion

The Persistence Amplification Model argues that gambling harm during losing streaks emerges from an interaction among probability, presentation, payment, and player vulnerability. Near-misses make failure feel close to success. Losses disguised as wins make net-negative results feel rewarding. Frictionless payment removes the pause that might otherwise interrupt chasing. Vulnerability determines how strongly those forces take hold.

A product can therefore be mathematically fair in one narrow sense and behaviorally dangerous in another. Serious regulation should not stop at disclosure of odds or RNG certification. It should ask how losses are staged, how quickly re-staking can happen, whether payment design preserves the reality of spending, and whether the player can still see the session clearly while inside it.


Appendix A: Reproducible Simulation Code

import numpy as np
import pandas as pd
import statsmodels.api as sm
from sklearn.metrics import roc_auc_score, brier_score_loss, log_loss
from statsmodels.stats.outliers_influence import variance_inflation_factor

def simulate(
    n_per=1000,
    seed=20260608,
    bankroll_size=100,
    max_spins=300,
    p_win=0.12,
    p_partial=0.20,
    win_net=6.0,
    nm_freq_override=None
):
    np.random.seed(seed)

    partial_net = -0.6

    conditions = [
        ("ordinary_losses", 0.02, 0, 0, 0.00),
        ("near_miss_enriched", 0.18, 0, 0, 0.28),
        ("ldw_enriched", 0.02, 1, 0, 0.38),
        ("near_miss_plus_ldw", 0.18, 1, 0, 0.70),
        ("near_miss_ldw_frictionless", 0.18, 1, 1, 1.05),
    ]

    if nm_freq_override:
        conditions = [
            (c, nm_freq_override.get(c, nm), ldw, fr, off)
            for c, nm, ldw, fr, off in conditions
        ]

    rows = []
    session_rows = []
    sid = 0

    for cond, nm_freq, ldw_enabled, frictionless, cond_offset in conditions:
        for _ in range(n_per):
            sid += 1
            vulnerability = np.random.normal(0, 1)
            bankroll = float(bankroll_size)
            reloads = 0
            total_staked = 0
            total_returned = 0
            escalated_any = 0
            max_stake = 1
            cum_nm = 0
            cum_ldw = 0

            for spin in range(1, max_spins + 1):
                funds = bankroll_size + 0.5 * bankroll_size * reloads
                loss_depth_pre = max(0, funds - bankroll)

                logit_escalate = (
                    -4.40
                    + 0.045 * loss_depth_pre
                    + 0.40 * vulnerability
                    + 0.25 * ldw_enabled
                    + 0.18 * (nm_freq / 0.18)
                    + 0.25 * frictionless
                )

                p_escalate = 1 / (1 + np.exp(-logit_escalate))

                if loss_depth_pre > 45 and np.random.rand() < p_escalate * 0.8:
                    stake = 5.0
                elif loss_depth_pre > 18 and np.random.rand() < p_escalate:
                    stake = 2.0
                else:
                    stake = 1.0

                stake = min(stake, max(1.0, bankroll)) if bankroll > 0 else 1.0

                if stake > 1:
                    escalated_any = 1

                max_stake = max(max_stake, stake)
                total_staked += stake

                u = np.random.rand()
                near_miss = 0
                ldw = 0
                win = 0

                if u < p_win:
                    win = 1
                    net = win_net * stake
                    returned = (win_net + 1) * stake

                elif u < p_win + p_partial:
                    net = partial_net * stake
                    returned = (1 + partial_net) * stake

                    if ldw_enabled:
                        ldw = 1
                        cum_ldw += 1

                else:
                    net = -1 * stake
                    returned = 0

                    if np.random.rand() < nm_freq:
                        near_miss = 1
                        cum_nm += 1

                bankroll += net
                total_returned += returned

                funds = bankroll_size + 0.5 * bankroll_size * reloads
                loss_depth = max(0, funds - bankroll)
                fatigue = spin / 100
                cumulative_salience = np.log1p(cum_nm + cum_ldw) / 3

                logit_continue = (
                    2.55
                    + cond_offset
                    + 0.55 * win
                    + 0.65 * near_miss
                    + 0.78 * ldw
                    + 0.28 * (loss_depth / 25)
                    + 0.58 * frictionless
                    + 0.28 * vulnerability
                    + 0.22 * near_miss * vulnerability
                    + 0.26 * ldw * frictionless
                    + 0.32 * cumulative_salience
                    - 0.12 * fatigue
                )

                p_continue = 1 / (1 + np.exp(-logit_continue))

                if spin == max_spins:
                    continued = 0
                    reason = "max_spins"

                elif bankroll <= 0:
                    logit_reload = (
                        -1.80
                        + 1.25 * frictionless
                        + 0.35 * vulnerability
                        + 0.30 * ldw_enabled
                        + 0.20 * (nm_freq / 0.18)
                        - 0.35 * reloads
                    )

                    p_reload = 1 / (1 + np.exp(-logit_reload))

                    if reloads < 2 and np.random.rand() < p_reload:
                        reloads += 1
                        bankroll += 0.5 * bankroll_size
                        continued = 1
                    else:
                        continued = 0
                        reason = "bankroll_exhausted"

                else:
                    continued = int(np.random.rand() < p_continue)
                    if continued == 0:
                        reason = "voluntary_stop"

                rows.append({
                    "session_id": sid,
                    "condition": cond,
                    "spin": spin,
                    "vulnerability": vulnerability,
                    "frictionless": frictionless,
                    "near_miss": near_miss,
                    "ldw": ldw,
                    "win": win,
                    "stake": stake,
                    "bankroll": bankroll,
                    "loss_depth": loss_depth,
                    "continued": continued,
                    "reloads_so_far": reloads,
                    "cum_salience": cumulative_salience
                })

                if continued == 0:
                    break

            session_rows.append({
                "session_id": sid,
                "condition": cond,
                "vulnerability": vulnerability,
                "spins": spin,
                "final_bankroll": bankroll,
                "net_loss": bankroll_size + 0.5 * bankroll_size * reloads - bankroll,
                "total_staked": total_staked,
                "total_returned": total_returned,
                "reloads": reloads,
                "any_reload": int(reloads > 0),
                "escalated_any": escalated_any,
                "max_stake": max_stake,
                "stopped_reason": reason,
                "bankroll_exhausted": int(reason == "bankroll_exhausted")
            })

    return pd.DataFrame(rows), pd.DataFrame(session_rows)

events, sessions = simulate()

summary = sessions.groupby("condition").agg(
    mean_spins=("spins", "mean"),
    sd_spins=("spins", "std"),
    median_spins=("spins", "median"),
    bet_escalation=("escalated_any", "mean"),
    reload_rate=("any_reload", "mean"),
    bankroll_exhaustion=("bankroll_exhausted", "mean"),
    mean_net_loss=("net_loss", "mean")
)

summary["continue_after_loss"] = (
    events[events["win"] == 0]
    .groupby("condition")["continued"]
    .mean()
)

print(summary)

df = events[
    (events["win"] == 0)
    & (events["bankroll"] > 5)
    & (events["spin"] < 280)
].copy()

df["loss_depth_25"] = df["loss_depth"] / 25
df["nm_vuln"] = df["near_miss"] * df["vulnerability"]
df["ldw_frictionless"] = df["ldw"] * df["frictionless"]

X = sm.add_constant(df[
    [
        "near_miss",
        "ldw",
        "loss_depth_25",
        "frictionless",
        "vulnerability",
        "nm_vuln",
        "ldw_frictionless",
        "cum_salience"
    ]
])

y = df["continued"]

model = sm.GLM(y, X, family=sm.families.Binomial())
result = model.fit(cov_type="cluster", cov_kwds={"groups": df["session_id"]})

print(result.summary())

odds_table = pd.DataFrame({
    "coef": result.params,
    "cluster_se": result.bse,
    "odds_ratio": np.exp(result.params),
    "ci_low_or": np.exp(result.conf_int()[0]),
    "ci_high_or": np.exp(result.conf_int()[1]),
    "p_value": result.pvalues
})

print(odds_table)

pred = result.predict(X)

print("ROC AUC:", roc_auc_score(y, pred))
print("Brier score:", brier_score_loss(y, pred))
print("Log loss:", log_loss(y, pred))

vif_data = pd.DataFrame({
    "variable": X.columns,
    "VIF": [
        variance_inflation_factor(X.values, i)
        for i in range(X.shape[1])
    ]
})

print(vif_data)

References

American Psychiatric Association. (2013). Diagnostic and Statistical Manual of Mental Disorders, Fifth Edition.

Barton, K. R., Yazdani, N., Ayer, N., Kalvapalle, S., Brown, S., Stapleton, J., Brown, D. G., & Harrigan, K. A. (2017). The effect of losses disguised as wins and near misses in electronic gaming machines: A systematic review. Journal of Gambling Studies, 33, 1241–1260.

Blaszczynski, A., Ladouceur, R., & Shaffer, H. J. (2004). A science-based framework for responsible gambling: The Reno model. Journal of Gambling Studies, 20, 301–317.

Chase, H. W., & Clark, L. (2010). Gambling severity predicts midbrain response to near-miss outcomes. Journal of Neuroscience, 30(18), 6180–6187.

Clark, L., Lawrence, A. J., Astley-Jones, F., & Gray, N. (2009). Gambling near-misses enhance motivation to gamble and recruit win-related brain circuitry. Neuron, 61(3), 481–490.

DCMS. (2022). Government response to the call for evidence on loot boxes in video games. Department for Digital, Culture, Media and Sport.

Dixon, M. J., Harrigan, K. A., Sandhu, R., Collins, K., & Fugelsang, J. A. (2010). Losses disguised as wins in modern multiline video slot machines. Addiction, 105(10), 1819–1824.

Ferster, C. B., & Skinner, B. F. (1957). Schedules of Reinforcement. Appleton-Century-Crofts.

Goodie, A. S., & Fortune, E. E. (2013). Measuring cognitive distortions in pathological gambling: Review and meta-analyses. Psychology of Addictive Behaviors, 27(3), 730–743.

Griffiths, M. D. (1993). Fruit machine gambling: The importance of structural characteristics. Journal of Gambling Studies, 9, 101–120.

Harrigan, K. A., & Dixon, M. J. (2009). PAR sheets, probabilities, and slot machine play: Implications for problem and non-problem gambling. Journal of Gambling Issues, 23, 81–110.

Kahneman, D., & Tversky, A. (1979). Prospect theory: An analysis of decision under risk. Econometrica, 47(2), 263–291.

King, D. L., & Delfabbro, P. H. (2018). Predatory monetization schemes in video games: An ethical and regulatory challenge. Addiction, 113(11), 1967–1969.

Ladouceur, R., Sylvain, C., Boutin, C., Lachance, S., Doucet, C., & Leblond, J. (2001). Cognitive treatment of pathological gambling. Journal of Nervous and Mental Disease, 189(11), 774–780.

Langer, E. J. (1975). The illusion of control. Journal of Personality and Social Psychology, 32(2), 311–328.

Lesieur, H. R. (1979). The compulsive gambler’s spiral of options and involvement. Psychiatry, 42(1), 79–87.

Prelec, D., & Loewenstein, G. (1998). The red and the black: Mental accounting of savings and debt. Marketing Science, 17(1), 4–28.

Raylu, N., & Oei, T. P. S. (2004). The Gambling Related Cognitions Scale: Development, confirmatory factor validation and psychometric properties. Addiction, 99(6), 757–769.

Reid, R. L. (1986). The psychology of the near miss. Journal of Gambling Behavior, 2, 32–39.

Schull, N. D. (2012). Addiction by Design: Machine Gambling in Las Vegas. Princeton University Press.

UK Gambling Commission. (2021). Online games design and reverse withdrawals: Package of changes to make online games safer by design.

World Health Organization. (2019). International Classification of Diseases, Eleventh Revision.

Zendle, D., & Cairns, P. (2018). Video game loot boxes are linked to problem gambling: Results of a large-scale survey. PLOS ONE, 13(11), e0206767.

Play smart. Gambling involves real financial risk. If the game stops being entertainment, it's time to stop playing.