Replace words by items: shopping baskets, web sessions, headline tests or colour bins. The paper’s own EachMovie experiment (Sec. 7.3) is the non-text precedent. In a probabilistic program, topics per token are summed out so that only θd and ϕk are sampled; label switching and sparsity then drive the diagnostics (Hungarian alignment, label-free summaries).
Main Content
Mapping (the paper’s remark in Sec. 2, “not tied to text”). Document = unit with a bag of discrete observations: a customer (items purchased), a web session (pages visited), a headline test, a poster (colour bins). Topic = a mixture over items/pages/colours. For marketing: customers as documents and products as words.
Collapsed likelihood. From the continuous-mixture view: for document d with item counts ndv, p(nd∣θd,ϕ)=∏vpdvndv with pd=θdTϕ (multinomial). This removes the Nd discrete variables zdn and leaves a continuous model that gradient-based samplers can handle.
PyMC-style sketch (untested; PyMC 5)
import pymc as pm, numpy as np# counts: (D, V) array of item counts; K topicswith pm.Model() as lda: theta = pm.Dirichlet("theta", a=np.full(K, 0.1), shape=(D, K)) phi = pm.Dirichlet("phi", a=np.full(V, 0.1), shape=(K, V)) p = pm.math.dot(theta, phi) # (D, V), z summed out pm.Multinomial("n", n=counts.sum(1), p=p, observed=counts)
Caveats: multimodal posterior, label switching across chains, funnel-like geometry for small Dirichlet concentrations; diagnose with label-free summaries and expect NUTS to struggle on sparse, high-dimensional simplices.
Label switching and alignment. Topic labels are exchangeable under the prior, so a posterior sample’s topic index k is meaningless across draws/chains. To compare estimated topics ϕ^ to truth (known-truth check) or across restarts, match topics by minimum cost assignment (Hungarian algorithm) on L1 distance and then compare. Label-free summaries: θdTϕ (predicted item distribution), co-assignment of items/documents, topic coherence.
Customers × products matrix with ≈3,661×2,087 entries (counts): a topic is a product bundle; θd is the customer’s mix of bundles. Held-out evaluation: hold out purchases within customers and compare θdTϕ log-predictive; this is the collaborative-filtering protocol of Sec. 7.3 (hold out one item, predict it).
Relevance to marketing measurement
Topic proportions can be used as customer descriptors in downstream models (Customer Lifetime Value - Overview, BG-NBD Model covariates). They are noisy estimates: propagate posterior uncertainty rather than plugging in point values, and avoid reading topics as causal segments.