Expand Multilevel Logistic Regression Model to include Individual Covariates

For the coords line, you can check out this tutorial on named dimensions in PyMC.

The math part X_i \beta, is an inner product between the i-th row of a matrix X and a coefficient vector \beta. The line you boxed in code, beta.dot(X.T), is doing the full matrix-vector product to get all the rows in one shot. There are lots of resources for linear algebra if it’s new to you, I like the Gilbert Strang MIT OpenCourseware lectures.