A Bayesian analysis of real-world message response times using probabilistic cognitive models.
This project investigates whether the probability of responding to a message increases, decreases, or remains constant as time elapses. Using 50 real text message response times, I fit three probability distributions (Exponential, Gamma, Weibull) and compared their fit using Bayes Factors.
The core question: When someone receives a message but hasn't replied yet, does the probability they'll respond in the next moment stay constant, build up over time, or decay?
Built three probabilistic models in PyMC, each representing a different hypothesis about response behavior:
- Exponential Model: Assumes constant hazard rate—equally likely to respond at any moment (memoryless process).
- Gamma Model: Models response time as the sum of α exponentially-distributed sub-events (e.g., noticing message + deciding to respond + typing).
- Weibull Model: Flexible hazard rate controlled by shape parameter α. When α > 1, response probability increases over time; when α < 1, it decreases.
NSAMPLES = 10000 # Posterior draws
CHAINS = 4 # Parallel chains
CORES = 8 # CPU cores
PRIOR_SAMPLES = 40000 # Prior predictive samplesUsed Sequential Monte Carlo (SMC) sampling to compute marginal likelihoods, then calculated pairwise Bayes Factors:
BF₁₂ = p(data | Model₁) / p(data | Model₂)Interpretation follows Jeffreys' scale: BF > 10 = strong evidence, BF > 100 = extreme evidence.
Python, PyMC 5, ArviZ, NumPy, Pandas, Matplotlib. No pre-built statistical templates—all model specifications and prior selections done from scratch.
| Metric | Value |
|---|---|
| Sample size | 50 messages |
| Type | Text messages |
| Mean MRT | ~44.7 minutes |
| Median MRT | ~32 minutes |
| Range | 1 - 174 minutes |
All messages sent to the same recipient. MRT = time in minutes from sending to receiving a reply.
| Comparison | Bayes Factor | Interpretation |
|---|---|---|
| Exponential vs Gamma | 3.62 | Moderate evidence for Exponential |
| Exponential vs Weibull | 20.64 | Strong evidence for Exponential |
| Gamma vs Weibull | 5.70 | Moderate evidence for Gamma |
The Exponential model provides the best fit to the data, suggesting that message response times follow a constant hazard rate—the probability of responding is roughly the same whether 1 minute or 100 minutes have passed. This implies a "memoryless" process: how long someone has waited doesn't predict when they'll respond.
Ranking: Exponential > Gamma > Weibull
| Model | Parameter | Prior | Rationale |
|---|---|---|---|
| Exponential | λ | Gamma(2, 100) | Weakly informative; allows mean MRT ~50 min |
| Gamma | α | Gamma(2, 2/1.1) | Centered near 1, allows shape flexibility |
| Gamma | β | Gamma(2, 2/0.0245) | Scaled to expected MRT range |
| Weibull | α | Gamma(2, 0.5) | Allows both increasing/decreasing hazard |
| Weibull | β | Gamma(2, 2/44) | Scaled to observed mean |
| Function | Responsibility |
|---|---|
pm.sample() |
MCMC posterior sampling with NUTS |
pm.sample_prior_predictive() |
Generate predictions before seeing data |
pm.sample_posterior_predictive() |
Generate predictions from fitted model |
marginal_llk_smc() |
Compute log marginal likelihood via SMC |
bayes_factor() |
Compute BF between two models |
report_bf() |
Format and interpret BF results |
For each model:
- Plot I: Prior vs Posterior distributions for each parameter
- Plot II/III: Prior predictive, posterior predictive, and observed data histogram
message-response-time-modeling/
├── README.md
├── requirements.txt
├── data/
│ ├── README.md
│ └── message_response_times.csv
├── src/
│ └── analysis.py
└── results/
└── figures/
# Clone and setup
git clone https://github.com/yourusername/message-response-time-modeling.git
cd message-response-time-modeling
pip install -r requirements.txt
# Run analysis
python src/analysis.pyCS134/PSY141: Computational Models in Cognitive Science — Tufts University, Fall 2025