# Posts by Year

## When the Spider-Man meme is relevant to multilevel models

For a while, I’ve wondered about the different approches for multilevel modeling, also known as mixed effects modeling. My initial understanding is with a Ba...

## LKJCorr and LKJCov in pymc

While continuing to deep dive on covariance priors following my prior post, I investigated implementations in pymc. I played around with the LKJcorr and LKJc...

## Weird ways that covariance matrices are made

Covariance priors for multivariate normal models are an important tool for the implementation of varying effects. By representing more than one parameter wit...

## Escaping the Devil’s Funnel

Multi-level models are great for improving our estimates. However, the intuitive way these kinds of models are specified (which goes by the unhelpful name “c...

## Correlated data, different DAGs

One of the lessons from Statistical Rethinking that really hit home for me was the importance of considering the data generation process. Different datasets ...

## Running models forwards and backwards

The value of simulations is highighted by Dr. McElreath throughout his textbook and by van de Schoot and colleagues. I didn’t entirely appreciate its value u...

## Exploring modeling failure

In my last post, I gave an example of a multilevel model using a binomial generalized linear model (GLM). The varying intercept model helped illustrate pa...

## Multilevel modeling with binomial GLM

I’ve been on a journey learning multilevel models and Bayesian inference through Richard McElreath’s Statistical Rethinking book. The concepts of shrinkage a...

## Working with PyTorch’s Dataset and Dataloader classes (part 1)

Recently, I built a simple NLP algorithm for a work project, following the template described in this tutorial. As I looked to increase my model’s complexity...

## Extending the chain

Last month, I wrote about how I aimed to make daily contributions towards my goals, no matter how small. Not surprisingly, it has been challenging. Neverthel...

## Vectorization with np.dot and broadcasting

Vectorization and broadcasting are tricks I have used sparingly and absent-mindedly if at all. However, it is a critical skill for algorithmic code to run ef...

## The chain

Yesterday morning, I continued my habit of reading a chapter from the book Atomic Habits by James Clear. The chapter described the importance of showing up a...

## PyMC linear regression part 4: predicting actual height

At last, we have come to the end. This is the final post in a series of linear regression posts using PyMC3, from my reading of Statistical Rethinking. Part ...

## PyMC linear regression part 3: predicting average height

This is the next post in a series of linear regression posts using PyMC3. This series has been inspired by my reading of Statistical Rethinking. Part 1 was d...

## PyMC linear regression part 2: understanding the posterior distribution

In a previous post, I wrote about my inital experience using PyMC3. The point was to take a dive deep into some of the package’s objects using a linear regre...

## PyMC linear regression part 1: PyMC objects

I previously wrote about my discovery of Statistical Rethinking. The book’s title could not be more spot-on–it’s helped me look at statistics in a different ...

## Doing easy

I’ve struggled to write consistently. Part of the reason for this is because I’m prone to self-censorship. Even as I type this, my mind is talking to itself....

## 14 years

This site is about my data science journey but various posts indicate my love for baseball. It starts with my GitHub handle: benslack19. Let’s break it down....

## Rethinking Bayes

A few weeks ago, I learned about the wonderful Statistical Rethinking lecture series and book by Richard McElreath. It’s made me think about some of the Baye...

## Looking back and looking ahead

A year ago, I was anxious and excited about a planned life change. I had put in my notice and would start a data science program on January 13, 2020. I had b...

## Bayes-ball part 3: the credible interval and doing the math

In the last post, we learned about the beta distribution and why it would be a more realistic prior in the context of our problem. We also selected appropria...

## Bayes-ball part 2: a more realistic prior

I meant to post this some time ago, but I have been busy. But with the baseball example I am using, it is only fitting that I post this now, just after this ...

## Bayes-ball part 1: determining a true talent level

In my previous post, we saw how Bayes’ theorem was applied to a relatively simple problem with Bertrand’s box paradox. Here I’ll talk about another applicati...

## Approaching Bertrand’s box paradox, including with Bayes’ theorem

Bayes’ theorem is one of the most useful applications in statistics. But sometimes it is not always easy to recognize when and how to apply it. I was doing s...

## Histograms and recursion in SQL

A few weeks ago, while making a histogram in a SQL query, I discovered that some solutions out there do not include bins with 0 counts. This bugged me so I f...

## Responses to “School and community features associated with low income student success”

I recently posted my project School and community features associated with low income student success. It was important to me to get reactions from educator...

## F-in statistics!

I recently read this passage in the section on multiple linear regression from the fantastic book Introduction to Statistical Learning:

## Working productively towards my data science goals

With the current days of COVID and working from home, I initially felt my data science learning and productivity slow down as my routine was disrupted. But i...

## Using CASE in the WHERE statement of SQL

Problem statement

## PostgreSQL and Jupyter notebooks

PostgreSQL is one of the most popular variants of SQL. It is common to use PostgreSQL with pgadmin but I am not a big fan of their UI. By contrast, interacti...

## Improving my writing

Introduction I have identified writing well as a skill I will prioritize. This improved skill will benefit both smaller forms I have taken for granted (like...

## Iterators in Python

One of the things about Python that I haven’t fully appreciated are the use of iterators. I’ll go over some iterators that are a part of base Python and then...

Seems like every statistics class starts off with a coin toss. It’s simple enough for me. Some fancy teachers might start right off the bat and get into the ...

## Applying logistic regression in Python

…from lessons learned from Andrew Ng’s ML course. Like other assignments of the course, the logistic regression assignment used MATLAB. Here, I translate MAT...

## The probability of making your Friday night party

My wife and I have enjoyed living in the Bay Area where we’ve been able to satisfy our love of outdoor activities while being near a cool city. While we’re f...

## A neuro-educational approach to taking Andrew Ng’s Machine Learning Course

I recently finished Andrew Ng’s fantastic and well-known Machine Learning course through Coursera. As I progress into my data science journey, I felt that ta...

## A ggplot-inspired scatterplot function for Python

I coded for a couple of years in R but switched over to Python almost a year ago. I have to say that I miss R’s ggplot2. Like a lot.