November 22, 2025
Bayesian cohort-level ARPU Model
A frequent problem in User Acquisition is to estimate ARPU of users in a cohort. Cohort — a group of users acquired together (same date, source, channel, etc.). Individual user revenue follows a heavy-tailed distribution: • Majority (~75%) generate zero revenue • Some (~20%) generate modest revenue • Tiny minority (~5%) generate the si...
Read more
Read more
November 15, 2025
Bayesian nonlinear asymptotic regression model
A frequent problem in User Acquisition is to estimate ARPU (aka LTV when t->+inf) of the cohort — and a solid retention model is the foundation of any decent ARPU forecast. A common approach to model retention is nonlinear asymptotic regression: y(t) = a + b/(c + t) Think of it as: most users bail early, then things flatten out. Here, ...
Read more
Read more
November 10, 2025
What Changed? Pin-pointing behavior shift
Let’s say you know that your metrics changed at a certain point of time. How could you leverage this to learn what exactly has changed? Sometimes it's possible to reduce a practical problem down to a well-studied one. In this case it’s possible to turn “What Changed?” into a Classification Problem. 1. Label data • Everything before the...
Read more
Read more
November 10, 2025
Bayesian Switch-Point Detection: Catch the Exact Day Metrics Changed
A common problem when running User Acquisition at scale (or any marketing activity) is detecting if performance is changing over time - and more importantly, exactly when. The usual manual way: export daily data from your BI tool (Meta Ads, Google Ads, AppsFlyer, etc.), paste it into Excel, and squint at the charts until something look...
Read more
Read more
August 17, 2025
Permutation test for binomial data
Based on Jake Vanderplas' presentation Statistics for Hackers video, section 2 Shuffling It's almost the same setup as in the presentation, the only missing piece is how to break down binomial data into individual examples (Bernoulli trials). One way is to represent it with a sequence of k 1s and (n - k) 0s. For example, n=5, k=2 could...
Read more
Read more
July 28, 2025
Application factory pattern in jupyter notebooks
After working with jupyter notebooks for a while, I faced an annoying boilerplate code migrating from notebook to notebook: import pandas as pd import numpy as np import seaborn as sns from pyspark.sql import SparkSession clickhouse = create_engine(…) spark = SparkSession.builder.appName(app_name).getOrCreate() minio = boto3.client("s3...
Read more
Read more
June 4, 2025
Cost-Effective IoT Data Processing on a Shoestring Budget
A friend running a pre-revenue startup asked me how to collect and analyze IoT data affordably. With a tight budget, the challenge was to build an efficient, scalable solution without breaking the bank. Here's a streamlined approach that delivers robust performance at minimal cost. Traditional Approach A typical IoT data pipeline might...
Read more
Read more
May 3, 2025
Low-Latency Bayesian Inference: Deploying Models with PyTorch and ONNX
Deploying Bayesian models in production often requires balancing predictive accuracy with low-latency inference. A common approach is to use inference data from PyMC and perform pm.sample_posterior_predictive. While effective, this method typically takes seconds, which is unacceptable when latency requirements are in milliseconds. Alte...
Read more
Read more
January 29, 2025
The Phenomenon of No-Performers
Over the past few weeks, I’ve been working on a project that involves collaborating with a team I didn’t personally hire. What I experienced was nothing short of cultural shock. It took me a while to even grasp how this was possible. I call it the no-performer phenomenon. So, what is a no-performer? A no-performer is someone who contri...
Read more
Read more
January 3, 2025
A short story on the importance of details in a contract. Spanish edition.
Llivia, a small exclave of Spain inside France, exists due to historical treaties and political arrangements dating back to the 17th century. Key Reasons: 1. Treaty of the Pyrenees (1659) • This treaty ended the Franco-Spanish War (1635–1659), and Spain ceded several territories in the northern Catalonia region to France. 2. Treaty of ...
Read more
Read more