Posts tagged pymc3.Deterministic
Using shared variables (Data container adaptation)
- 16 December 2021
- Category: beginner
The pymc.Data
container class wraps the theano shared variable class and lets the model be aware of its inputs and outputs. This allows one to change the value of an observed variable to predict or refit on new data. All variables of this class must be declared inside a model context and specify a name for them.
GLM: Robust Regression using Custom Likelihood for Outlier Classification
- 17 November 2021
- Category: intermediate
Using PyMC3 for Robust Regression with Outlier Detection using the Hogg 2010 Signal vs Noise method.
Hierarchical Binomial Model: Rat Tumor Example
- 11 November 2021
- Category: intermediate
This short tutorial demonstrates how to use PyMC3 to do inference for the rat tumour example found in chapter 5 of Bayesian Data Analysis 3rd Edition [Gelman et al., 2013]. Readers should already be familliar with the PyMC3 API.
A Primer on Bayesian Methods for Multilevel Modeling
- 09 November 2021
- Category: intermediate
Hierarchical or multilevel modeling is a generalization of regression modeling. Multilevel models are regression models in which the constituent model parameters are given probability models. This implies that model parameters are allowed to vary by group. Observational units are often naturally clustered. Clustering induces dependence between observations, despite random sampling of clusters and random sampling within clusters.
Estimating parameters of a distribution from awkwardly binned data
- 23 October 2021
- Category: intermediate
Let us say that we are interested in inferring the properties of a population. This could be anything from the distribution of age, or income, or body mass index, or a whole range of different possible measures. In completing this task, we might often come across the situation where we have multiple datasets, each of which can inform our beliefs about the overall population.
Splines in PyMC3
- 08 October 2021
- Category: beginner
Often, the model we want to fit is not a perfect line between some \(x\) and \(y\). Instead, the parameters of the model are expected to vary over \(x\). There are multiple ways to handle this situation, one of which is to fit a spline. The spline is effectively multiple individual lines, each fit to a different section of \(x\), that are tied together at their boundaries, often called knots. Below is an exmaple of how to fit a spline using the Bayesian framework PyMC3.
Hierarchical Partial Pooling
- 07 October 2021
- Category: intermediate
Suppose you are tasked with estimating baseball batting skills for several players. One such performance metric is batting average. Since players play a different number of games and bat in different positions in the order, each player has a different number of at-bats. However, you want to estimate the skill of all players, including those with a relatively small number of batting opportunities.
Dirichlet process mixtures for density estimation
- 16 September 2021
- Category: advanced
The Dirichlet process is a flexible probability distribution over the space of distributions. Most generally, a probability distribution, \(P\), on a set \(\Omega\) is a [measure](https://en.wikipedia.org/wiki/Measure_(mathematics%29) that assigns measure one to the entire space (\(P(\Omega) = 1\)). A Dirichlet process \(P \sim \textrm{DP}(\alpha, P_0)\) is a measure that has the property that, for every finite disjoint partition \(S_1, \ldots, S_n\) of \(\Omega\),
A Hierarchical model for Rugby prediction
- 30 August 2021
- Category: intermediate
Based on the following blog post: Daniel Weitzenfeld’s, which based on the work of Baio and Blangiardo.