<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Posts on Gabes Gulch</title><link>https://gstechschulte.github.io/posts/</link><description>Recent content in Posts on Gabes Gulch</description><generator>Hugo</generator><language>en-us</language><lastBuildDate>Fri, 31 Jul 2026 00:00:00 +0000</lastBuildDate><atom:link href="https://gstechschulte.github.io/posts/index.xml" rel="self" type="application/rss+xml"/><item><title>Coordinating Agents With Mechanism Design</title><link>https://gstechschulte.github.io/posts/2026-07-31-why-mechanism-design/</link><pubDate>Fri, 31 Jul 2026 00:00:00 +0000</pubDate><guid>https://gstechschulte.github.io/posts/2026-07-31-why-mechanism-design/</guid><description>&lt;p&gt;Imagine the large scale deployment of AI agents that make decisions on behalf of individuals or firms. For example, in online advertising auctions, an advertiser gives their high-level goal and constraints to a personal bidding agent. The responsibility of the bidding agent is to convert the advertiser&amp;rsquo;s goal and constraints into per-auction bids without human review. How do we ensure: (1) the advertiser&amp;rsquo;s goal is maximized, and (2) the outcome (who wins the auction) is efficient?&lt;/p&gt;</description></item><item><title>Mechanism Design - A Primer</title><link>https://gstechschulte.github.io/posts/2026-05-08-thinking-about-mechanism-design/</link><pubDate>Fri, 29 May 2026 00:00:00 +0000</pubDate><guid>https://gstechschulte.github.io/posts/2026-05-08-thinking-about-mechanism-design/</guid><description>&lt;p&gt;This post is an ongoing investigation of my &lt;a href="https://gstechschulte.github.io/posts/2025-09-02-future-of-ai/"&gt;alternative view of AI&lt;/a&gt; and the role of algorithms for multi-agent systems in markets.&lt;/p&gt;
&lt;p&gt;Game theory is concerned with predicting the behavior of agents participating in an strategic interaction. We can also ask the inverse. Given a desired behavior of the agents, what strategic interaction would give rise to this behavior? For example, there are two firms $A$ and $B$. Each firm can choose to cooperate $C$ or defect $D$ which results in the following payoff matrix&lt;/p&gt;</description></item><item><title>The Construction Versus Finance Worker</title><link>https://gstechschulte.github.io/posts/2026-04-12-labor-margin/</link><pubDate>Sun, 12 Apr 2026 00:00:00 +0000</pubDate><guid>https://gstechschulte.github.io/posts/2026-04-12-labor-margin/</guid><description>&lt;p&gt;Being able to build something, or at least having some knowledge about how something is built is sort of beautiful. It&amp;rsquo;s a kind of hidden superpower. Whenever I see a new apartment building or street being built, it always crosses my mind how the people in this line of work are paid less, on average, than those in offices. It appears that the work of those building the houses and streets is more valuable than those of the management class, so why are they paid less?&lt;/p&gt;</description></item><item><title>Distributionally Robust Optimization - Part 1</title><link>https://gstechschulte.github.io/posts/2026-03-06-dro-part-one/</link><pubDate>Fri, 06 Mar 2026 00:00:00 +0000</pubDate><guid>https://gstechschulte.github.io/posts/2026-03-06-dro-part-one/</guid><description>&lt;p&gt;I recently read the paper &lt;a href="https://ieeexplore.ieee.org/document/11250739"&gt;Carbon-Aware Computing for Data Centers with Probabilistic Performance Guarantees &lt;/a&gt; which demonstrated the benefits and power of a Distributionally Robust Optimization method and I wanted to dive deeper into the method. This blog post is a result of the deep dive.&lt;/p&gt;
&lt;h2 id="introduction"&gt;Introduction&lt;/h2&gt;
&lt;p&gt;In Stochastic Optimization (SO), we are interested in solutions that account for different possible outcomes of uncertain data. Accounting for this uncertainty requires us to define a probability distribution over the uncertain quantities—a forecast error, a demand signal, a compute load—and then optimize an objective defined with respect to that distribution. The choice of how to use the distribution depends on the application: one might minimize expected cost, guard against a high-percentile loss using Conditional Value-at-Risk (CVaR), or enforce a chance constraint that a capacity limit is violated with probability no greater than some threshold. What all of these approaches share is the assumption that we know, or can accurately estimate, the distribution itself. Distributionally Robust Optimization is the framework we reach for when that assumption breaks down.&lt;/p&gt;</description></item><item><title>Stochastic Model Predictive Control</title><link>https://gstechschulte.github.io/posts/2025-11-18-stochastic-mpc/</link><pubDate>Tue, 18 Nov 2025 00:00:00 +0000</pubDate><guid>https://gstechschulte.github.io/posts/2025-11-18-stochastic-mpc/</guid><description>&lt;p&gt;Many applications of optimization and control are performed in a deterministic setting. That is, the quantities of the problem such as the state variables, control variables, and or parameters of a model are treated as fixed known values. This assumption may be reasonable in applications such as robotics, but in others such as resource allocation, we may need to incorporate the uncertainty of various quantities in order to compute the &lt;strong&gt;expectation&lt;/strong&gt; of the objective.&lt;/p&gt;</description></item><item><title>Reproducing Uber's Marketplace Optimization</title><link>https://gstechschulte.github.io/posts/2025-09-15-marketplace-optimization/</link><pubDate>Mon, 15 Sep 2025 00:00:00 +0000</pubDate><guid>https://gstechschulte.github.io/posts/2025-09-15-marketplace-optimization/</guid><description>&lt;p&gt;Uber allocates money across different regions and programs to incentivize riders and drivers to use Uber products. This incentive structure ultimately influences the market. This leads to the natural question of &amp;ldquo;how much to allocate to each city and which program&amp;rdquo; to maximize business objectives? Uber has a finite amount of money that must be allocated accordingly. Given a total budget of say, $1,000,000, how should it be divied up amongst the cities and programs?&lt;/p&gt;</description></item><item><title>Alternative View of AI</title><link>https://gstechschulte.github.io/posts/2025-09-02-future-of-ai/</link><pubDate>Tue, 02 Sep 2025 00:00:00 +0000</pubDate><guid>https://gstechschulte.github.io/posts/2025-09-02-future-of-ai/</guid><description>&lt;p&gt;Nowadays, AI is primarily associated with LLMs, where the goal is to develop autonomous agents with human-level intelligence (whatever that means). I have always found the goal of creating something with &amp;ldquo;intelligence&amp;rdquo; boring for some reason. Maybe it is because the objective is too diffuse—create something at least as smart as humans and hope it figures out &lt;code&gt;&amp;lt;insert your problem here&amp;gt;&lt;/code&gt;. Regardless, these LLM-based agents are useful tools and should be used, but these systems are a narrow view of intelligence.&lt;/p&gt;</description></item><item><title>[WIP] Database Systems - Query Execution and Processing</title><link>https://gstechschulte.github.io/posts/db-systems-query-processing/</link><pubDate>Wed, 01 Jan 2025 00:00:00 +0000</pubDate><guid>https://gstechschulte.github.io/posts/db-systems-query-processing/</guid><description>&lt;h2 id="operator-execution"&gt;Operator execution&lt;/h2&gt;
&lt;p&gt;In OLAP systems, sequential scans are the primary method for query execution. The goal is two-fold: (1) minimize the amount of data fetched from the disk or a remote object store, and (2) maximize the use of hardware resources for efficient query execution.&lt;/p&gt;
&lt;p&gt;Andy’s (unscientific) top three execution optimization techniques:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Data parallelization (vectorization)&lt;/strong&gt;. Breaking down a query into smaller tasks and running them in parallel on different cores, threads, or nodes.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Task parallelization (multi-threading)&lt;/strong&gt;. Breaking down a query into smaller independent tasks and executing them concurrently. This allows the DBMS to take full advantage of hardware capabilities and or multiple machines to improve query execution time.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Code specialization (pre-compiled / JIT)&lt;/strong&gt;. Code generation for specific queries, e.g. JIT or pre-compiled parameters.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;which fall into three primary ways for speeding up queries:&lt;/p&gt;</description></item><item><title>[WIP] Database Systems - Storage</title><link>https://gstechschulte.github.io/posts/db-systems-file-formats/</link><pubDate>Sun, 01 Dec 2024 00:00:00 +0000</pubDate><guid>https://gstechschulte.github.io/posts/db-systems-file-formats/</guid><description>&lt;h2 id="introduction"&gt;Introduction&lt;/h2&gt;
&lt;p&gt;As the business landscape embraces data-driven approaches for analysis and decision-making, there is a rapid surge in the volume of data requiring storage and processing. This surge has led to the growing popularity of OLAP database systems.&lt;/p&gt;
&lt;p&gt;An OLAP system workload is characterized by complex queries that require scanning over large portions of the database. In OLAP workloads, the database system is often analyzing and deriving new data from existing data collected on the OLTP side. In contrast, OLTP workloads are characterized by fast, relatively simple and repetitive queries that operate on a single entity at a time (usually involving an update or insert).&lt;/p&gt;</description></item><item><title>Creating C Callbacks with Numba and Calling Them From Rust</title><link>https://gstechschulte.github.io/posts/2024-11-30-c-callbacks/</link><pubDate>Sat, 30 Nov 2024 00:00:00 +0000</pubDate><guid>https://gstechschulte.github.io/posts/2024-11-30-c-callbacks/</guid><description>&lt;p&gt;When interfacing with libraries written in C/C++ from Rust, it may require writing native callbacks to provide functionality or logic to the library. A C Callback is a function pointer that is passed as an argument to another function, allowing that function to &amp;ldquo;call back&amp;rdquo; and execute the passed function at runtime.&lt;/p&gt;
&lt;p&gt;When interfacing with Python from Rust, there may be scenarios where the Rust code also needs to be able to call a Python function. Rust&amp;rsquo;s foreign function interface (FFI) and &lt;code&gt;pyo3&lt;/code&gt; crate in fact lets you do this. However, calling Python from Rust involves invoking the Python interpreter, which can reduce performance. If one of the goals for using Rust is to improve the performance of your application or library, this overhead might be undesirable. To avoid invoking the Python interpreter, you can use Numba. Numba allows you to create a C callback, pass this function pointer to Rust, and perform the callback without incurring the overhead associated with Python.&lt;/p&gt;</description></item><item><title>Database Systems - Series Overview</title><link>https://gstechschulte.github.io/posts/db-systems-blog-series-overview/</link><pubDate>Tue, 22 Oct 2024 00:00:00 +0000</pubDate><guid>https://gstechschulte.github.io/posts/db-systems-blog-series-overview/</guid><description>&lt;p&gt;A blog series consisting of my notes on the Carnegie Mellon University (CMU) Introduction and Advanced Database Systems Lectures by Andy Pavlo and Jignesh Patel. The primary goal of this series is to: (1) consolidate my notes, and (2) act as a reference guide for my future self. Perhaps some readers may extract some value, but I would highly recommend watching the lectures for yourself.&lt;/p&gt;
&lt;p&gt;The series will cover:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Database storage&lt;/li&gt;
&lt;li&gt;Indexes&lt;/li&gt;
&lt;li&gt;Join algorithms&lt;/li&gt;
&lt;li&gt;Query execution and processing&lt;/li&gt;
&lt;li&gt;Query optimization&lt;/li&gt;
&lt;li&gt;Query scheduling and coordination&lt;/li&gt;
&lt;li&gt;Concurrency control&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="olap-database-management-system-components"&gt;OLAP database management system components&lt;/h2&gt;
&lt;p&gt;The series will primarily focus on the components of OLAP database management systems (DBMS). A recent trend of the last decade is the breakout of OLAP DBMS components into standalone services and libraries for:&lt;/p&gt;</description></item><item><title>Hierarchical Regression With Missing Data</title><link>https://gstechschulte.github.io/posts/hierarchical-regression-missing-data/</link><pubDate>Tue, 10 Sep 2024 00:00:00 +0000</pubDate><guid>https://gstechschulte.github.io/posts/hierarchical-regression-missing-data/</guid><description>&lt;!--eofm--&gt;
&lt;p&gt;Hierarchical regression, also known as multilevel modeling, is a powerful modeling technique that allows one to analyze data with a nested structure. This approach is particularly useful when dealing with data that has natural groupings, such as students within schools, patients within hospitals, or in the example below, product configurations within manufacturing processes. One of the key advantages of hierarchical regression lies in its ability to handle missing data in groups, i.e., when one group may not share the same covariates as another group or some groups may contain missong observations.&lt;/p&gt;</description></item><item><title>Stateful Joins in SQL</title><link>https://gstechschulte.github.io/posts/sql-stateful-joins/</link><pubDate>Thu, 22 Aug 2024 00:00:00 +0000</pubDate><guid>https://gstechschulte.github.io/posts/sql-stateful-joins/</guid><description>&lt;h2 id="introduction"&gt;Introduction&lt;/h2&gt;
&lt;p&gt;In some scenarios, one needs to enrich an event stream with data from another source that holds &amp;ldquo;state&amp;rdquo;. This state provides additional context to the event stream.&lt;/p&gt;
&lt;p&gt;For example, in manufacturing, a machine may use a set of machine process parameters (pressure, speed, force, etc.) when producing an item. The process parameters represent the &amp;ldquo;state&amp;rdquo; of the machine at production time $t$. However, the software services that publishes messages on what is being produced and the machine process parameters currently used are separate. Furthermore, to avoid the duplication of data, the service that publishes process parameters only publishes a message when there is a change in state, e.g when an operator changes one of process parameters.&lt;/p&gt;</description></item><item><title>Alternative Samplers to NUTS in Bambi</title><link>https://gstechschulte.github.io/posts/bambi-alternative-samplers/</link><pubDate>Fri, 29 Mar 2024 00:00:00 +0000</pubDate><guid>https://gstechschulte.github.io/posts/bambi-alternative-samplers/</guid><description>&lt;!--eofm--&gt;
&lt;h1 id="alternative-sampling-backends"&gt;Alternative sampling backends&lt;/h1&gt;
&lt;p&gt;This blog post is a copy of the alternative samplers documentation I wrote for &lt;a href="https://bambinos.github.io/bambi/"&gt;Bambi&lt;/a&gt;. The original post can be found &lt;a href="https://bambinos.github.io/bambi/notebooks/"&gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;In Bambi, the sampler used is automatically selected given the type of variables used in the model. For inference, Bambi supports both MCMC and variational inference. By default, Bambi uses PyMC&amp;rsquo;s implementation of the adaptive Hamiltonian Monte Carlo (HMC) algorithm for sampling. Also known as the No-U-Turn Sampler (NUTS). This sampler is a good choice for many models. However, it is not the only sampling method, nor is PyMC the only library implementing NUTS.&lt;/p&gt;</description></item><item><title>Advanced Interpret Usage in Bambi</title><link>https://gstechschulte.github.io/posts/bambi-advanced-marginal-effects/</link><pubDate>Sat, 09 Dec 2023 00:00:00 +0000</pubDate><guid>https://gstechschulte.github.io/posts/bambi-advanced-marginal-effects/</guid><description>&lt;!--eofm--&gt;
&lt;h1 id="interpret-advanced-usage"&gt;Interpret Advanced Usage&lt;/h1&gt;
&lt;p&gt;The &lt;code&gt;interpret&lt;/code&gt; module is inspired by the R package &lt;a href="https://marginaleffects.com"&gt;marginaleffects&lt;/a&gt; and ports the core functionality of {marginaleffects} to Bambi. To close the gap of non-supported functionality in Bambi, &lt;code&gt;interpret&lt;/code&gt; now provides a set of helper functions to aid the user in more advanced and complex analysis not covered within the &lt;code&gt;comparisons&lt;/code&gt;, &lt;code&gt;predictions&lt;/code&gt;, and &lt;code&gt;slopes&lt;/code&gt; functions.&lt;/p&gt;
&lt;p&gt;These helper functions are &lt;code&gt;data_grid&lt;/code&gt; and &lt;code&gt;select_draws&lt;/code&gt;. The &lt;code&gt;data_grid&lt;/code&gt; can be used to create a pairwise grid of data points for the user to pass to &lt;code&gt;model.predict&lt;/code&gt;. Subsequently, &lt;code&gt;select_draws&lt;/code&gt; is used to select the draws from the posterior (or posterior predictive) group of the InferenceData object returned by the predict method that correspond to the data points that &amp;ldquo;produced&amp;rdquo; that draw.&lt;/p&gt;</description></item><item><title>Outcome Constraints in Bayesian Optimization</title><link>https://gstechschulte.github.io/posts/constrained-bayesian-optimization/</link><pubDate>Tue, 28 Nov 2023 00:00:00 +0000</pubDate><guid>https://gstechschulte.github.io/posts/constrained-bayesian-optimization/</guid><description>&lt;!--eofm--&gt;
&lt;div class="code-block"&gt;
 &lt;div class="code-block-header"&gt;
 &lt;span class="code-block-lang"&gt;python&lt;/span&gt;
 &lt;button type="button" class="code-copy" aria-label="Copy code"&gt;
 &lt;span class="code-copy-icon"&gt;&lt;svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"&gt;&lt;rect x="9" y="9" width="13" height="13" rx="2" ry="2"/&gt;&lt;path d="M5 15H4a2 2 0 01-2-2V4a2 2 0 012-2h9a2 2 0 012 2v1"/&gt;&lt;/svg&gt;
&lt;/span&gt;
 &lt;span class="code-copy-icon code-copy-icon-check"&gt;&lt;svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"&gt;&lt;polyline points="20 6 9 17 4 12"/&gt;&lt;/svg&gt;
&lt;/span&gt;
 &lt;span class="code-copy-label"&gt;Copy&lt;/span&gt;
 &lt;/button&gt;
 &lt;/div&gt;
 &lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-python" data-lang="python"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;#| code-fold: true&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;matplotlib.pyplot&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="nn"&gt;plt&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;torch&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;numpy&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="nn"&gt;np&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="nn"&gt;botorch.acquisition&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;qLogExpectedImprovement&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="nn"&gt;botorch.fit&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;fit_gpytorch_model&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="nn"&gt;botorch.models&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;SingleTaskGP&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="nn"&gt;botorch.optim&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;optimize_acqf&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="nn"&gt;gpytorch.mlls&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;ExactMarginalLogLikelihood&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="nn"&gt;torch.distributions&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;Normal&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;plt&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;style&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;use&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;https://raw.githubusercontent.com/GStechschulte/filterjax/main/docs/styles.mplstyle&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;h1 id="outcome-constraints"&gt;Outcome constraints&lt;/h1&gt;
&lt;p&gt;In optimization, it is often the goal that we need to optimize an objective function while satisfying some constraints. For example, we may want to minimize the scrap rate by finding the optimal process parameters of an manufacturing machine. However, we know the scrap rate cannot be below 0. In another setting, we may want to maximize the throughput of a machine, but we know that the throughput cannot exceed the maximum belt speed of the machine. Thus, we need to find regions in the search space that both yield high objective values and satisfy these constraints. In this blog, we will focus on inequality &lt;em&gt;outcome constraints&lt;/em&gt;. That is, the domain of the objective function is&lt;/p&gt;</description></item><item><title>Survival Models in Bambi</title><link>https://gstechschulte.github.io/posts/bambi-survival-models/</link><pubDate>Wed, 25 Oct 2023 00:00:00 +0000</pubDate><guid>https://gstechschulte.github.io/posts/bambi-survival-models/</guid><description>&lt;!--eofm--&gt;
&lt;h1 id="survival-models"&gt;Survival Models&lt;/h1&gt;
&lt;p&gt;Survival models, also known as time-to-event models, are specialized statistical methods designed to analyze the time until the occurrence of an event of interest. In this notebook, a review of survival analysis (using non-parametric and parametric methods) and censored data is provided, followed by a survival model implementation in Bambi.&lt;/p&gt;
&lt;p&gt;This blog post is a copy of the survival models documentation I wrote for &lt;a href="https://bambinos.github.io/bambi/"&gt;Bambi&lt;/a&gt;. The original post can be found &lt;a href="https://bambinos.github.io/bambi/notebooks/"&gt;here&lt;/a&gt;.&lt;/p&gt;</description></item><item><title>Predict New Groups with Hierarchical Models in Bambi</title><link>https://gstechschulte.github.io/posts/bambi-predict-new-groups/</link><pubDate>Tue, 10 Oct 2023 00:00:00 +0000</pubDate><guid>https://gstechschulte.github.io/posts/bambi-predict-new-groups/</guid><description>&lt;!--eofm--&gt;
&lt;h1 id="predict-new-groups"&gt;Predict New Groups&lt;/h1&gt;
&lt;p&gt;In Bambi, it is possible to perform predictions on new, unseen, groups of data that were not in the observed data used to fit the model with the argument &lt;code&gt;sample_new_groups&lt;/code&gt; in the &lt;code&gt;model.predict()&lt;/code&gt; method. This is useful in the context of hierarchical modeling, where groups are assumed to be a sample from a larger group.&lt;/p&gt;
&lt;p&gt;This blog post is a copy of the zero inflated models documentation I wrote for &lt;a href="https://bambinos.github.io/bambi/"&gt;Bambi&lt;/a&gt;. The original post can be found &lt;a href="https://bambinos.github.io/bambi/notebooks/predict_new_groups.html"&gt;here&lt;/a&gt;.&lt;/p&gt;</description></item><item><title>Ordinal Models in Bambi</title><link>https://gstechschulte.github.io/posts/bambi-ordinal-models/</link><pubDate>Fri, 29 Sep 2023 00:00:00 +0000</pubDate><guid>https://gstechschulte.github.io/posts/bambi-ordinal-models/</guid><description>&lt;!--eofm--&gt;
&lt;div class="code-block"&gt;
 &lt;div class="code-block-header"&gt;
 &lt;span class="code-block-lang"&gt;python&lt;/span&gt;
 &lt;button type="button" class="code-copy" aria-label="Copy code"&gt;
 &lt;span class="code-copy-icon"&gt;&lt;svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"&gt;&lt;rect x="9" y="9" width="13" height="13" rx="2" ry="2"/&gt;&lt;path d="M5 15H4a2 2 0 01-2-2V4a2 2 0 012-2h9a2 2 0 012 2v1"/&gt;&lt;/svg&gt;
&lt;/span&gt;
 &lt;span class="code-copy-icon code-copy-icon-check"&gt;&lt;svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"&gt;&lt;polyline points="20 6 9 17 4 12"/&gt;&lt;/svg&gt;
&lt;/span&gt;
 &lt;span class="code-copy-label"&gt;Copy&lt;/span&gt;
 &lt;/button&gt;
 &lt;/div&gt;
 &lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-python" data-lang="python"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;#| code-fold: true&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;arviz&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="nn"&gt;az&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;matplotlib.pyplot&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="nn"&gt;plt&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="nn"&gt;matplotlib.lines&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;Line2D&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;numpy&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="nn"&gt;np&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;pandas&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="nn"&gt;pd&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;warnings&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;bambi&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="nn"&gt;bmb&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;warnings&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;filterwarnings&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;ignore&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;category&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="ne"&gt;FutureWarning&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;pre&gt;&lt;code&gt;WARNING (pytensor.tensor.blas): Using NumPy C-API based implementation for BLAS functions.
&lt;/code&gt;&lt;/pre&gt;
&lt;h1 id="ordinal-regression"&gt;Ordinal Regression&lt;/h1&gt;
&lt;p&gt;This blog post is a copy of the ordinal models documentation I wrote for &lt;a href="https://bambinos.github.io/bambi/"&gt;Bambi&lt;/a&gt;. The original post can be found &lt;a href="https://bambinos.github.io/bambi/notebooks/"&gt;here&lt;/a&gt;.&lt;/p&gt;</description></item><item><title>Zero Inflated Models in Bambi</title><link>https://gstechschulte.github.io/posts/bambi-zip-models/</link><pubDate>Fri, 29 Sep 2023 00:00:00 +0000</pubDate><guid>https://gstechschulte.github.io/posts/bambi-zip-models/</guid><description>&lt;!--eofm--&gt;
&lt;div class="code-block"&gt;
 &lt;div class="code-block-header"&gt;
 &lt;span class="code-block-lang"&gt;python&lt;/span&gt;
 &lt;button type="button" class="code-copy" aria-label="Copy code"&gt;
 &lt;span class="code-copy-icon"&gt;&lt;svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"&gt;&lt;rect x="9" y="9" width="13" height="13" rx="2" ry="2"/&gt;&lt;path d="M5 15H4a2 2 0 01-2-2V4a2 2 0 012-2h9a2 2 0 012 2v1"/&gt;&lt;/svg&gt;
&lt;/span&gt;
 &lt;span class="code-copy-icon code-copy-icon-check"&gt;&lt;svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"&gt;&lt;polyline points="20 6 9 17 4 12"/&gt;&lt;/svg&gt;
&lt;/span&gt;
 &lt;span class="code-copy-label"&gt;Copy&lt;/span&gt;
 &lt;/button&gt;
 &lt;/div&gt;
 &lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-python" data-lang="python"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;#| code-fold: true&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;arviz&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="nn"&gt;az&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;matplotlib.pyplot&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="nn"&gt;plt&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="nn"&gt;matplotlib.lines&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;Line2D&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;numpy&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="nn"&gt;np&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;pandas&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="nn"&gt;pd&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;scipy.stats&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="nn"&gt;stats&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;seaborn&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="nn"&gt;sns&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;warnings&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;bambi&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="nn"&gt;bmb&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;warnings&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;simplefilter&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;action&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;ignore&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;category&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="ne"&gt;FutureWarning&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;pre&gt;&lt;code&gt;WARNING (pytensor.tensor.blas): Using NumPy C-API based implementation for BLAS functions.
&lt;/code&gt;&lt;/pre&gt;
&lt;h1 id="zero-inflated-models"&gt;Zero inflated models&lt;/h1&gt;
&lt;p&gt;This blog post is a copy of the zero inflated models documentation I wrote for &lt;a href="https://bambinos.github.io/bambi/"&gt;Bambi&lt;/a&gt;. The original post can be found &lt;a href="https://bambinos.github.io/bambi/notebooks/"&gt;here&lt;/a&gt;.&lt;/p&gt;</description></item><item><title>Google Summer of Code - Final Report</title><link>https://gstechschulte.github.io/posts/gsoc-final-report/</link><pubDate>Thu, 10 Aug 2023 18:43:46 +0200</pubDate><guid>https://gstechschulte.github.io/posts/gsoc-final-report/</guid><description>&lt;p&gt;&lt;img src="bambi-logo.png" alt="alt"&gt;&lt;/p&gt;
&lt;p&gt;My project &amp;ldquo;Better tools to interpret complex Bambi regression models&amp;rdquo; was completed under the organization of NumFOCUS, and mentors Tomás Capretto and Osvaldo Martin. Before I describe the project, objectives, and work completed, I would like to thank my mentors Tomás and Osvaldo for their precious time and support throughout the summer. They were always available and timely in communicating over Slack and GitHub, and provided valuable feedback during code reviews. Additionally, I would like to thank NumFOCUS and the Google Summer of Code (GSoC) program for providing the opportunity to work on such an open source project over the summer. It has been an invaluable experience, and I look forward to contributing to open source projects in the future.&lt;/p&gt;</description></item><item><title>Google Summer of Code - Average Predictive Slopes</title><link>https://gstechschulte.github.io/posts/bambi-slopes/</link><pubDate>Tue, 01 Aug 2023 00:00:00 +0000</pubDate><guid>https://gstechschulte.github.io/posts/bambi-slopes/</guid><description>&lt;!--eofm--&gt;
&lt;p&gt;It is currently the beginning of week ten of Google Summer of Code 2023. According to the original deliverables table outlined in my proposal, the goal was to have opened a draft PR for the basic functionality of the &lt;code&gt;plot_slopes&lt;/code&gt;. Subsequently, week 11 was reserved to further develop the &lt;code&gt;plot_slopes&lt;/code&gt; function, and to write tests and a notebook for the documentation, respectively.&lt;/p&gt;
&lt;p&gt;However, at the beginning of week ten, I have a &lt;a href="https://github.com/bambinos/bambi/pull/699"&gt;PR&lt;/a&gt; open with the majority of the functionality that &lt;a href="https://vincentarelbundock.github.io/marginaleffects/"&gt;marginaleffects&lt;/a&gt; has for &lt;code&gt;slopes&lt;/code&gt;. In addition, I also exposed the &lt;code&gt;slopes&lt;/code&gt; function, added tests, and have a &lt;a href="https://github.com/bambinos/bambi/pull/701"&gt;PR&lt;/a&gt; open for the documentation.&lt;/p&gt;</description></item><item><title>Google Summer of Code - Average Predictive Comparisons</title><link>https://gstechschulte.github.io/posts/bambi-comparisons/</link><pubDate>Fri, 30 Jun 2023 00:00:00 +0000</pubDate><guid>https://gstechschulte.github.io/posts/bambi-comparisons/</guid><description>&lt;!--eofm--&gt;
&lt;p&gt;It is currently the end of week five of Google Summer of Code 2023. According to the original deliverables table outlined in my proposal, the goal was to have opened a draft PR for the core functionality of the &lt;code&gt;plot_comparisons&lt;/code&gt;. Subsequently, week six and seven were to be spent further developing the &lt;code&gt;plot_comparisons&lt;/code&gt; function, and writing tests and a demo notebook for the documentation, respectively. However, at the end of week five, I have a PR open with the majority of the functionality that &lt;a href="https://vincentarelbundock.github.io/marginaleffects/"&gt;marginaleffects&lt;/a&gt; has. In addition, I also exposed the &lt;code&gt;comparisons&lt;/code&gt; function, added tests (which can and will be improved), and have started on documentation.&lt;/p&gt;</description></item><item><title>Gibbs Sampler From Scratch</title><link>https://gstechschulte.github.io/posts/gibbs-sampler/</link><pubDate>Wed, 12 Oct 2022 00:00:00 +0000</pubDate><guid>https://gstechschulte.github.io/posts/gibbs-sampler/</guid><description>&lt;!--eofm--&gt;
&lt;p&gt;A variant of the Metropolis-Hastings (MH) algorithm that uses clever proposals and is therefore more efficient (you can get a good approximate of the posterior with far fewer samples) is Gibbs sampling. A problem with MH is the need to choose the proposal distribution, and the fact that the acceptance rate may be low.&lt;/p&gt;
&lt;p&gt;The improvement arises from adaptive proposals in which the distribution of proposed parameter values adjusts itself intelligently, &lt;strong&gt;depending upon the parameter values at the moment&lt;/strong&gt;. This dependence upon the parameters at that moment is an exploitation of conditional independence properties of a graphical model to automatically create a good proposal, with acceptance probability equal to one.&lt;/p&gt;</description></item><item><title>Metropolis Hastings Sampler From Scratch</title><link>https://gstechschulte.github.io/posts/metropolis-hastings-sampler/</link><pubDate>Sat, 08 Oct 2022 00:00:00 +0000</pubDate><guid>https://gstechschulte.github.io/posts/metropolis-hastings-sampler/</guid><description>&lt;!--eofm--&gt;
&lt;h3 id="main-idea"&gt;Main Idea&lt;/h3&gt;
&lt;p&gt;Metropolis-Hastings (MH) is one of the simplest kinds of MCMC algorithms. The idea with MH is that at each step, we propose to move from the current state $x$ to a new state $x&amp;rsquo;$ with probability $q(x&amp;rsquo;|x)$, where $q$ is the &lt;strong&gt;proposal distribution&lt;/strong&gt;. The user is free to choose the proposal distribution and the choice of the proposal is dependent on the form of the target distribution. Once a proposal has been made to move to $x&amp;rsquo;$, we then decide whether to &lt;strong&gt;accept&lt;/strong&gt; or &lt;strong&gt;reject&lt;/strong&gt; the proposal according to some rule. If the proposal is accepted, the new state is $x&amp;rsquo;$, else the new state is the same as the current state $x$.&lt;/p&gt;</description></item><item><title>Monte Carlo Approximation</title><link>https://gstechschulte.github.io/posts/monte-carlo-approximation/</link><pubDate>Fri, 07 Oct 2022 00:00:00 +0000</pubDate><guid>https://gstechschulte.github.io/posts/monte-carlo-approximation/</guid><description>&lt;!--eofm--&gt;
&lt;h2 id="inference"&gt;Inference&lt;/h2&gt;
&lt;p&gt;In the probabilistic approach to machine learning, all unknown quantities—predictions about the future, hidden states of a system, or parameters of a model—are treated as random variables, and endowed with probability distributions. The process of inference corresponds to computing the posterior distribution over these quantities, conditioning on whatever data is available. Given that the posterior is a probability distribution, we can draw samples from it. The samples in this case are parameter values. The Bayesian formalism treats parameter distributions as the degrees of relative plausibility, i.e., if this parameter is chosen, how likely is the data to have arisen? We use Bayes&amp;rsquo; rule for this process of inference. Let $h$ represent the uknown variables and $D$ the known variables, i.e., the data. Given a likelihood $p(D|h)$ and a prior $p(h)$, we can compute the posterior $p(h|D)$ using Bayes&amp;rsquo; rule:&lt;/p&gt;</description></item><item><title>Variational Inference - Evidence Lower Bound</title><link>https://gstechschulte.github.io/posts/variational-inference/</link><pubDate>Fri, 03 Jun 2022 18:43:46 +0200</pubDate><guid>https://gstechschulte.github.io/posts/variational-inference/</guid><description>&lt;p&gt;We don&amp;rsquo;t know the real posterior so we are going to choose a distribution $Q(\theta)$ from a family of distributions $Q^*$ that are &lt;strong&gt;easy to work with&lt;/strong&gt; and parameterized by $\theta$. The approximate distribution should be &lt;em&gt;as close as possible&lt;/em&gt; to the true posterior. This closeness is measured using KL-Divergence. If we have the joint $p(x, z)$ where $x$ is some observed data, the goal is to perform inference: given what we have observed, what can we infer about the latent states?, i.e , we want the posterior.&lt;/p&gt;</description></item><item><title>No Code, Dependency, and Building Technology</title><link>https://gstechschulte.github.io/posts/no-code-building-technology/2021-08-10-no-code-dependency-and-building-technology/</link><pubDate>Tue, 10 Aug 2021 00:00:00 +0000</pubDate><guid>https://gstechschulte.github.io/posts/no-code-building-technology/2021-08-10-no-code-dependency-and-building-technology/</guid><description>&lt;h2 id="modernity-and-abstraction"&gt;Modernity and Abstraction&lt;/h2&gt;
&lt;p&gt;&amp;lsquo;Programmers&amp;rsquo;, loosely speaking, in some form or another have always been developing software to automate tedious and repetitive tasks. Rightly so, as this is one of the tasks computers are designed to perform. As science and technology progresses, and gets more technological, there is a growing seperation between the maker and the user. This is one of the negative externalities of modernism - we enjoy the benefits of a more advanced and technologically adept society, but fewer and fewer people understand the inner workings. Andrej Karpathy has a jokingly short paragraph in his &lt;a href="https://karpathy.github.io/2019/04/25/recipe/"&gt;blog&lt;/a&gt; on the matter, &amp;ldquo;A courageous developer has taken the burden of understanding query strings, urls, GET/POST requests, HTTP connections, and so on from you and largely hidden the complexity behind a few lines of code. This is what we are now familiar with and expect&amp;rdquo;.&lt;/p&gt;</description></item></channel></rss>