matricesearth

an independent practice · automation · optimization · modeling · ai

matrices builds systems that decide.

these are the field notes.

Most software waits to be told what to do. The systems built here hold a model of their world instead: written down in Stan or NumPyro before the first data point is trusted, updated as evidence arrives, acted on when the posterior says act. Three of them follow, told the way a notebook tells things: the problem, the model, and what the evidence did to it.

01

three systems

entry i

serif

a consumer-health causal inference engine

Wearable and biomarker data in, personalized dose-aware recommendations out, and a causal model standing between the two.

problem

Wearables and blood panels produce a stream of numbers and almost no guidance on what to change. Generic advice ignores the only thing that matters: how your outcomes respond to your behaviors, at your doses.

approach

The mechanism goes down on paper first, as a causal DAG: sleep and training load act on biomarkers, biomarkers act on outcomes. Only then does data enter. Bayesian posteriors are fit over the edges of that graph in NumPyro, so every recommendation arrives carrying a dose and an uncertainty, not just a direction. And before any of it ships, the fitted model has to pass posterior predictive checks: it simulates the data it believes in, the simulations are held against what was actually recorded, and disagreement sends it back to the notebook.

Causal diagram: sleep and training load point to biomarker, biomarker points along a salmon path to a salmon outcome node, with dotted direct paths from sleep and training load to outcome. sleep training load biomarker outcome direct effects mediated
The DAG, specified before the data. Dotted paths are direct effects; the salmon path is the mediated effect the engine estimates, per person and per dose.
The quantity behind every recommendation: the effect of a dose, with person-level uncertainty θ integrated out rather than ignored. The mark of this practice is an integral for exactly that reason.

result

The engine has run for 1,188 participants across 3 cohorts, turning raw wearable and biomarker streams into recommendations that are personal, dose-aware, and honest about what the data can and cannot support.

Hand-drawn chart of outcome versus dose: a rising, saturating curve inside a salmon uncertainty band that widens at higher doses. A dashed line marks the current dose; a circled salmon point marks the recommended dose. dose outcome current dose recommended the posterior band
The posterior over one person's dose response, drawn from NumPyro. The band is the honest part: where it widens, the engine claims less and recommends more carefully.

entry ii

prism

a Bayesian adaptive political-disposition quiz

Political disposition as 14 latent dimensions and 130 archetypes, measured by a quiz that rewrites itself as you answer.

problem

Political labels compress a person onto one axis, and fixed-form quizzes spend most of their questions confirming what the first few already established. The interesting structure, how someone reasons and not just where they land, never gets measured.

approach

prism holds a posterior over 14 latent dimensions and matches it, continuously, against 130 archetypes. Each answer updates the posterior; each next question is chosen by expected information gain, the one whose answer should move the posterior most. The quiz is not a script with a scorer bolted on. It is the inference loop itself, worn as an interface.

# after each answer: ask whatever is expected
# to move the posterior the most
next_q = argmax  E[ KL( p(θ | answers, q) ‖ p(θ | answers) ) ]
            q
prism's entire selection strategy, one notebook line: expected information gain decides what gets asked next.

result

The estimate converges in about 30 questions: enough to place a person among 130 archetypes without asking a hundred things their earlier answers already implied.

Scatter plot sketch: archetype dots across two dimensions, with a dotted salmon path that starts wide and spirals inward to a circled salmon point labeled about question 30. one latent dimension another dimension question 1 about question 30
Two of prism's 14 dimensions, sketched. Dots are archetypes; the dotted line is the running posterior, jumping widely on early answers and settling, near question 30, on the salmon point.

entry iii

markets

prediction-market decomposition and tooling

A prediction-market price is one number wearing many beliefs. The tooling here takes the number apart.

problem

Related contracts move together because they share underlying drivers, and the price alone will not tell you which driver moved. Trading or forecasting on raw prices means reasoning about a sum without seeing its parts.

approach

The model is written in Stan: each contract's price decomposes into a small set of latent terms shared across a family of related contracts, plus a residual that belongs to the contract alone. Live dashboards keep the decomposition current, and when prices move, refitting says which latent term did the moving.

result

Live dashboards over the decomposition, and an active forecasting track record built on the same machinery: forecasts made against the latent terms, not against the headline number.

Tree diagram: a salmon contract-price node at the root splits into latent term a, latent term b, latent term c, and a residual; the latent terms are marked as shared with related contracts. contract price latent term a latent term b latent term c residual + + + shared with related contracts this contract only
Each contract price, decomposed into shared latent terms plus a residual of its own. When a family of contracts moves together, the fit says which shared term did the moving.
02

the practice

The three notebooks above are built from four kinds of work. Engagements draw on whichever mix the problem needs.

aautomation

Agentic pipelines and workflow orchestration: LLM-powered systems that run unattended, designed with a human in the loop exactly where judgment matters and nowhere else.

boptimization

Portfolio and resource-allocation optimization, and decision analysis under uncertainty. Objectives are distribution-aware: the full shape of outcomes, not just the expected value.

cmodeling

Models are written down before they are believed: causal structure drawn as a DAG, priors argued in the open, inference sketched in PyMC while a question is still forming and hardened in Stan or NumPyro once it holds still. The same discipline carries treatment effects, synthetic populations, and probabilistic forecasts.

dai

Applied LLM systems: evaluation and scoring pipelines, adaptive question engines, and machine learning that ships to real users rather than staying in a notebook.

matrices is the independent practice of sam cialek: fifteen years across quantitative finance, data science, and software engineering, now pointed at systems that decide, adapt, and improve themselves.

B.A. Economics & Mathematics New York University 2011

MBA Columbia Business School 2019

M.S. Computer Science Georgia Tech 2024

03

start a conversation

If you have a decision process that should be a system, or a system that should be smarter about its decisions, get in touch. Thirty minutes is usually enough to tell whether the problem is a fit.