Probably some sort of blogProbably some sort of blog
https://jeffpollock9.github.io/
Bayesian workflow with TFP and arviz
Table of Contents 1. Setup 2. Model 3. Data 4. Prior predictive check 5. Inference 6. Posterior analysis 7. Predicting on new data 8. Conclusion This post hopefully contains an end-to-end example of a Bayesian workflow for a simple model on some simulated data using TFP and arviz. For a...
Tue, 05 Jan 2021 00:00:00 -0500
https://jeffpollock9.github.io/bayesian-workflow-with-tfp-and-arviz/
https://jeffpollock9.github.io/bayesian-workflow-with-tfp-and-arviz/almost always auto (batched)
Table of Contents 1. Data 2. Model 3. Two ways to write the model in code 4. Do we get the same log-probabilities? 5. Do we get the same speeds? 6. Conclusion In this post I have a look at the JointDistributionCoroutineAutoBatched class in TensorFlow Probability. The title is based...
Wed, 21 Oct 2020 00:00:00 -0400
https://jeffpollock9.github.io/almost-always-auto-batched/
https://jeffpollock9.github.io/almost-always-auto-batched/sample all the distributions
Table of Contents 1. Setup 2. Model definition 3. Sampling the prior predictive distribution 4. Run MCMC 5. Sampling the posterior predictive distribution Thanks to this thread I recently learned about the JointDistribution.sampledistributions member function and it's something I've really wanted for a while. My workflow used to be as...
Wed, 22 Apr 2020 00:00:00 -0400
https://jeffpollock9.github.io/sample_distributions/
https://jeffpollock9.github.io/sample_distributions/The ordered logistic distribution
Table of Contents 1. Setup 2. Data 3. TFP 4. Stan 5. Posterior predictive check 6. Conclusion I was very pleased to wake up the other day to find that some code I wrote for the ordered logistic distribution had been accepted into TensorFlow Probability (TFP)! However when writing this...
Thu, 27 Feb 2020 00:00:00 -0500
https://jeffpollock9.github.io/the-ordered-logistic-distribution/
https://jeffpollock9.github.io/the-ordered-logistic-distribution/Maximum likelihood estimation with tensorflow probability and stan take 2
After a previous post there has been some discussion on the stan forums so I thought I would have another bash at seeing how fast I can make tensorflow and stan find maximum likelihood estimates for a fairly large problem. I'm using specialised functions for fitting GLMs, namely bernoullilogitglm in...
Wed, 24 Jul 2019 00:00:00 -0400
https://jeffpollock9.github.io/maximum-likelihood-estimation-with-tensorflow-probability-and-stan-take-2/
https://jeffpollock9.github.io/maximum-likelihood-estimation-with-tensorflow-probability-and-stan-take-2/1,000 Rosenbrock functions
One thing I've always wanted to do was find the global minimum of 1,000 Rosenbrock functions using BFGS really quickly - and now I can do it easily! import tensorflow as tf import tensorflow_probability as tfp import time as tm def rosenbrock(x, a, b): x0 = x[..., 0] x1 =...
Fri, 19 Apr 2019 00:00:00 -0400
https://jeffpollock9.github.io/1000-rosenbrocks/
https://jeffpollock9.github.io/1000-rosenbrocks/Maximum likelihood estimation with tensorflow probability and pystan (and now rstan too)
I've made some edits to this post based on comments on the stan forums and from Bob Carpenter below (many thanks to all): y ~ bernoulli_logit(alpha + x * beta); -> y ~ bernoulli_logit_glm(x, alpha, beta); in the stan code (actually nvm this doesn't work with the currently released pystan...
Sat, 23 Mar 2019 00:00:00 -0400
https://jeffpollock9.github.io/maximum-likelihood-estimation-with-tensorflow-probability-and-pystan/
https://jeffpollock9.github.io/maximum-likelihood-estimation-with-tensorflow-probability-and-pystan/Helpful command line tools
If you spend a lot of time at the command prompt then a few tools can really help your productivity, here are some which I like to use: tilix is a terminal emulator which is very easy to setup and customise. bash-powerline adds some git information to the command line...
Sat, 16 Feb 2019 00:00:00 -0500
https://jeffpollock9.github.io/helpful-command-line-tools/
https://jeffpollock9.github.io/helpful-command-line-tools/Variational inference with pyro
In going NUTS with pyro and pystan I mentioned that I would like to try variational inference algorithms in pyro, so here is that attempt. A disclaimer: I am not very familiar with pyro or variational inference. I'm using the same simple data and model from the NUTS post, and...
Sat, 26 Jan 2019 00:00:00 -0500
https://jeffpollock9.github.io/variational-inference-in-pyro/
https://jeffpollock9.github.io/variational-inference-in-pyro/Variational inference basics
Table of Contents 1. Basic maths 2. Variational families 2.1. Mean-field Gaussian 2.2. Full-rank Gaussian 2.3. Recommendations 3. Conclusions I mentioned in a previous post that I would take a look at variational inference, so here we go. 1 Basic maths Variational inference (VI) is a method for approximate Bayesian...
Fri, 18 Jan 2019 00:00:00 -0500
https://jeffpollock9.github.io/variational-inference-basics/
https://jeffpollock9.github.io/variational-inference-basics/Checking soccer models with PPC
As far as I can think right now (not very far), there are two things you typically want to do once you have a model and done some inference: Model comparison Model checking The former allows you to evaluate the relative strengths of models and answer questions like "should I...
Mon, 07 Jan 2019 00:00:00 -0500
https://jeffpollock9.github.io/checking-soccer-models-with-PPC/
https://jeffpollock9.github.io/checking-soccer-models-with-PPC/Multivariate normal covariance matrices and the cholesky decomposition
This post is mainly some notes about linear algebra, the cholesky decomposition, and a way of parametrising the multivariate normal which might be more efficient in some cases. In general it is best to use existing implementations of stuff like this - this post is just a learning exercise. The...
Thu, 03 Jan 2019 00:00:00 -0500
https://jeffpollock9.github.io/multivariate-normal-cholesky/
https://jeffpollock9.github.io/multivariate-normal-cholesky/Exploration with arviz
In a previous post I had a look at using pyro but found myself writing a lot more code just to have a look at the inference than to actually perform it. Fortunately, one of the arviz developers commented on the post and let me know that arviz would have...
Wed, 02 Jan 2019 00:00:00 -0500
https://jeffpollock9.github.io/exploration-with-arviz/
https://jeffpollock9.github.io/exploration-with-arviz/Going NUTS with pyro and pystan
Table of Contents 1. pyro 2. pystan 3. Conclusions Uber's pyro as described in Pyro: Deep Universal Probabilistic Programming sounds pretty cool so I thought I'd give it a whirl. They seem to have focussed their efforts on the variational inference algorithms but still have an implementations of NUTS. In...
Mon, 24 Dec 2018 00:00:00 -0500
https://jeffpollock9.github.io/going-NUTS-with-pyro-and-pystan/
https://jeffpollock9.github.io/going-NUTS-with-pyro-and-pystan/Blogging with Emacs, Org, and GitHub Pages
This post is for experimenting. Many thanks to Carl Lieberman and Dean Attali for providing the main tools for this blog. Here is a table with a formula for the sum: Table 1: Witty table caption. foo bar baz sum 1 2 3 6 42 42 41 125 Here is...
Sat, 01 Dec 2018 00:00:00 -0500
https://jeffpollock9.github.io/first-post/
https://jeffpollock9.github.io/first-post/