Podcast #128: We chat with Kent C Dodds about why he loves React and discuss what life was like in the dark days before Git. Listen now.

Tag Info

Hot answers tagged probabilistic-programming

23

Hamiltonian Monte Carlo performs well with continuous target distributions with "weird" shapes. It requires the target distribution to be differentiable as it basically uses the slope of the target distribution to know where to go. The perfect example is a banana shaped function. Here is a standard Metropolis Hastings in a Banana function: Acceptance rate ...

14

It's generally true in my personal experience as a professional data scientist. It's true in my personal experience because it's what I observe most of the time. If you're asking why it happens this way, it's for a few reasons: Many traditional ML algorithms are nowadays available "off the shelf", including sophisticated ensemble methods, neural networks, ...

9

A similar problem is discussed in Gelman, Bayesian Data Analysis, (2nd ed, p. 128; 3rd edition p. 110). Gelman suggests a prior $p(a,b)\propto (a+b)^{-5/2}$, which effectively constrains the "prior sample size" $a+b$, and therefore the beta hyperprior is not likely to be highly informative on its own. (As the quantity $a+b$ grows, the variance of the beta ...

5

In practice, the reliability of both methods will depend on the situation. But, here are a few points to consider: MCMC must sample the space in a way that's representative of the distribution. This can require a large number of points, particularly in high dimensions. In contrast, SGD doesn't care about the overall structure of the objective function; it ...

5

Autocorrelation dictates the amount of time you have to wait for convergence. If autocorrelation is high, you will have to use a longer burn-in, and you will have to draw more samples after the burn-in to get a good estimate of the posterior distribution. Low autocorrelation means good exploration. Exploration and convergence are essentially the same ...

4

I think your question is overly broad since it indicates "probabilistic inference", but I'll answer the question relative to Markov chain Monte Carlo (MCMC). Parallelism in MCMC is hard because MCMC is inherently a serial algorithm. That is, given a current value $\theta^{(t)}$ in a Markov chain, an MCMC algorithm determines a set of steps to obtain the ...

4

I did two things to fix your code. One was to initialize the model away from zero, the other one was to use a non-gradient based optimizer: import pymc3 as pm import numpy as np import pandas as pd import theano import scipy as sp data = pd.read_csv('jester-dense-subset-100x20.csv') n, m = data.shape test_size = m / 10 train_size = m - test_size train ...

4

Similar questions have been asked on X validated. Assuming they pass statistical tests of randomness, a main issue with RNGs in Monte Carlo simulation is their use in parallel computation, where special libraries must be used to prevent correlations between the threads. There are aso a few studies in the literature about the impact of dependencies in the ...

3

To combat ShadowTalker above's point about probabilistic ML being not quite up to snuff yet, is definitely true as-is, but there have been some really exciting advances in scalability and complexity because of variational inference which is definitely still cutting-edge research. I think it remains an interesting question of whether, if probabilistic ML ...

2

Probabilities cannot exceed 1, but probability densities can. If you're dealing with a continuous random variable (it seems like you are although I have a hard time following what's going on in your code) the density may well take values greater than 1. In order for it to be a well-defined probability density it is only necessary that: The area under the ...

2

They are first-order models in the sense that you can use variables (not random variables!) and predicates to declare your model. This is basically the same as template models (such as dynamic Bayesian networks, but more general). These languages are basically just model description languages, and their semantics are grounded in ordinary propositional PGMs. ...

2

It is important to be cognizant of the assumptions underlying ADVI. At the core, it is a mean-field approximation (at least how it's implemented in PyMC3) which means that correlations in the posterior are ignored. This is fine for some models but the stochastic volatility model has a highly correlated posterior. The intuition is that s_t ~ N(s_{t-1}, sd^2) ...

2

If reasonable, one can make the assumption that the data is missing at random or missing completely at random. If so, then for example Expectation Maximization or Variational Bayes can be used to maximize the likelihood and assess parameters. There is great collection of literature on Mike Tipping's website on the topic of sparse Bayesian modeling and the "...

2

The sample space is the set of all possible outcomes of the experiment, corresponding to the Cartesian product of the set of $365$ possible birth dates (after hedging for pertinent caveats as to the possibility of leap years, seasonality in births, etc) with itself as many times as the number of individuals in the room. This will produce $365^n$ ordered ...

2

If you ask about software, among the most popular probabilistic programming frameworks are BUGS, Jags, Stan, PyMC, INLA, and Edward. If you ask about success stories, it has been used for many years by mediacal researchers, as described by Spiegelhalter et al in Bayesian Approaches to Clinical Trials and Health‐Care Evaluation, Andrew Gelman advocates their ...

2

The survival function $S_{t}$ is a quantity of interest in many (most?) kinds of event history analysis. It is commonly estimated, and 'survival curves' depicting $S_{t}$ versus time are often used to compare the cumulative probability of events among different groups. Statistical comparisons are often facilitated by inference—things like hypothesis test and ...

2

According to the comment by @colcarroll, the updated example with plate models is indeed given in: https://docs.pymc.io/notebooks/multilevel_modeling.html This corresponds to the PyMC3 model: with pm.Model() as hierarchical_model: # Hyperpriors mu_a = pm.Normal('mu_alpha', mu=0., sd=1) sigma_a = pm.HalfCauchy('sigma_alpha', beta=1) mu_b = ...

2

In fairRandom we have $\begin{cases} P(r_1=0, r_2=0) & (1-p)^2 \\ P(r_1=0, r_2=1) & p-p^2 \\ P(r_1=1, r_2=0) & p-p^2 \\ P(r_1=1, r_2=1) & p^2 \end{cases}$ since we only return for $P(r_1=0, r_2=1)$ and $P(r_1=1, r_2=0)$ and they have the same probability, it should be obvious $p=0.5$. For b) note that the probabilities of $P(r_1=0, r_2=... 2 I think there's a bit of a misunderstanding as to what we're doing in Bayesian neural networks. We know there's a real posterior distribution over the weights given the data but that the distribution is intractable or too computationally expensive to compute. To solve this we're approximating this posterior distribution with some variational distribution ... 1 Note: I’m not sure if you would like a full answer (ie for someone to solve the entire problem for you) or hints for you to arrive at the solution. I will begin with a strong hint and if you want more I’ll add an edit. The optimal solution does not require ML/DL/ PP and is actually a realization of a very well known statistical/probability problem. What you ... 1 You can check out the archives of StanCon - there's a lot of great applied Bayesian work with source code (obviously using the Stan language). There is for example: Modelling demand for gas or resonance ultrasound spectroscopy. 1 On the paper "Outline of forecast theoryusing generalized cost functions" 1 Clive Granger (a nobel prize winner no less!) gives the following properties of a loss function$L(x)$:$L(0) = 0$(no error, no loss).$\min L(x) = 0$, so$L(x)\geq 0$.$L(x)$is monotonically non-decreasing as$x$moves away from zero. (similar to your first requirement) You ... 1 I cannot think about a small MRF with a practical use. Typically they are just toy examples to help understand the definitions such as in this document (Section 2). Two points to answer your follow up questions: -If you have a very small number of variables, you are likely to have a much better understanding of the relations between them. Then you might ... 1 The result of a stochastic dynamic programming exercise (basically what you're describing) is a policy. The policy maps states to optimal actions. You can think of this as a contingency plan, similar to how I plan my morning commute; if, when I reach the freeway, the traffic looks really bad, I take the frontage road two entrances down and get on there; ... 1 As indicated by the name, burn-in is there to stabilise the chain towards its stationary regime, so the burn-in step should not be considered for performance evaluations like acceptance rate goals. However I want to warn you about the notion that 10⁴ simulations is large or poor in a generic sense. It will all depend on the type of target$f\$ and the type ...

1

See Probabilistic Programming and Bayesian Methods for Hackers. It is an interactive book that explores probabilistic programming in Python.

Only top voted, non community-wiki answers of a minimum length are eligible