Tag Info

Hot answers tagged

12

I'm not an expert in any of these, but I thought I'd put them out there anyway to see what the community thought. Corrections are welcome. One increasingly popular method, which is not terribly straightforward to implement, is called Hamiltonian Monte Carlo (or sometimes Hybrid Monte Carlo). It uses a physical model with potential and kinetic energy to ...


7

There seem to be some misconceptions about what the Metropolis-Hastings (MH) algorithm is in your description of the algorithm. First of all, one has to understand that MH is a sampling algorithm. As stated in wikipedia In statistics and in statistical physics, the Metropolis–Hastings algorithm is a Markov chain Monte Carlo (MCMC) method for obtaining a ...


6

The bibliography states that if q is a symmetric distribution the ratio q(x|y)/q(y|x) becomes 1 and the algorithm is called Metropolis. Is that correct? Yes, this is correct. The Metropolis algorithm is a special case of the MH algorithm. What about "Random Walk" Metropolis(-Hastings)? How does it differ from the other two? In a random walk, the ...


6

In order to get this, and to simplify the matters, I always think first in just one parameter with uniform (long-range) a-priori distribution, so that in this case, the MAP estimate of the parameter is the same as the MLE. However, assume that your likelihood function is complicated enough to have several local maxima. What MCMC does in this example in 1-D ...


5

I think that this paper from Heikki Haario et al. will give you the answer you need. The markovianity of the chain is affected by the adaptation of the proposal density, because then a new proposed value depends not only of the previous one but on the whole chain. But it seems that the sequence has still the good properties if great care is taken.


5

Here you go - three examples. I've made the code much less efficient than it would be in a real application in order to make the logic clearer (I hope.) # We'll assume estimation of a Poisson mean as a function of x x <- runif(100) y <- rpois(100,5*x) # beta = 5 where mean(y[i]) = beta*x[i] # Prior distribution on log(beta): t(5) with mean 2 # ...


5

1. The problem is not about ergodicity No, this is not related to ergodicity. In the chain without cycling around, one can still move from any island to any other island, and (provided that there are differences in the populations!) the chain is not periodic (because one sometimes stays put), so the chain is ergodic, hence it has a unique stationary ...


4

There are two basic assumptions that lead to this relationship: The stationary distribution $\pi(\cdot)$ doesn't change too quickly (i.e. it has a bounded first derivative). Most of the probability mass of $\pi(\cdot)$ is concentrated in a relatively small subset of the domain (the distribution is "peaky"). Let's consider the "small $\sigma^2$" case ...


3

I don't have references on hand, unfortunately, but generally the more dependence there is between $X$ and $Y$, the more efficient it will be to update them jointly. In your example $X$ and $Y$ are independent; if, for example, $X$ and $Y$ were still jointly Gaussian but had a correlation of .99, updating them separately would be much worse. Updating them ...


3

You are rather looking for a simulated annealing, which is easier to understand when formulated in the original, physics way: Having $x$ is a state of the system $f(x)$ is an energy of the system; energy is defined up to addition of a constant, so there is no problem with it being negative or positive -- the only constraint is the-lower-the-better $T$ is a ...


3

I think the order is correct, but the labels assigned to p(x) and p(y|x) were wrong. The original problem states p(y|x) is log-normal and p(x) is Singh-Maddala. So, it's Generate an X from a Singh-Maddala, and generate a Y from a log-normal having a mean which is a fraction of the generated X.


3

The scheme you propose is strictly ascending the probability gradient. Think what would happen: you would end up at $x$ such that $P(x)$ is maximal and you would stay there for ever. In the end, the sample you generate would consist mostly of $x$, whatever the size of the sample, so the distribution of that sample would not be close to $P$. Also bear in ...


3

I don't have a great example off the top of my head, but MH is easy compared to direct sampling whenever the parameter's prior is not conjugate with that parameter's likelihood. In fact this is the only reason I have ever seen MH preferred. A toy example is that $p \sim \text{Beta}(\alpha, \beta)$, and you wanted to have (independent) priors $\alpha, \beta ...


3

When doing M-H it's a good idea to propose from a distribution that is "similar" to the target distribution. Hence, you may try to use the generated samples from a previous simulation as proposals for the simulation of a new posterior that you consider to be "close / similar" to the previous one. You may sample with replacement the previous parameters ...


2

The approaches suggested by users wok and robertsy cover the most commonly cited examples of what you're looking for that I know of. Just to expand on those answers, Haario and Mira wrote a paper in 2006 that combines the two approaches, an approach they call DRAM (delayed rejection adaptive Metropolis). Andrieu has a nice treatment of various different ...


2

You always need some form of a likelihood. Usually knowledge of the science leads to the likelihood, things like: will the data be discrete or continuous? what is the valid range of the data? what is the likely range of the data? What are reasonable shapes for the data? will contribute to choosing a likelihood function. The likelihood function only need ...


2

In fact, you should not do MCMC, since your problem is so much simpler. Try this algorithm: Step 1: Generate a X from Log Normal Step 2: Keeping this X fixed, generate a Y from the Singh Maddala. Voila! Sample Ready!!!


2

You could push the MCMC machinery one step further by simulating the $\mathbf{c}_i$'s conditional on $x_i$ and $w$. Indeed, your equation $$f(x_i|w)=\int_{\Delta(xi)}f(\mathbf{c}_i|w)d\mathbf{c}_i$$ states that $x_i$ is obtained by marginalisation over the $\mathbf{c}_i$'s. In statistical terms, the $\mathbf{c}_i$'s are latent variables: they are not ...


2

First of all, for you model to be hierarchical, you need hyperpriors for $\alpha$ and $\beta$ (as already explained by Procrastinator). For the sake of simplicity, lets assume uniform priors on the positive part of the real axis. So that have a hierarchical model as follows: $$y_{i}| \lambda_{i}\sim Poisson(\lambda_{i})$$ $$\lambda_{i}|\alpha, \beta \sim ...


2

You can improve the acceptance rate using delayed rejection as described in Tierney, Mira (1999). It is based on a second proposal function and a second acceptance probability, which guarantees the Markov chain is still reversible with the same invariant distribution: you have to be cautious since "it is easy to construct adaptive methods that might seem to ...


2

MH sampling is used when it's difficult to sample from the target distribution (e.g., when the prior isn't conjugate to the likelihood). So you use a proposal distribution to generate samples and accept/reject them based on the acceptance probability. The Gibbs sampling algorithm is a particular instance of MH where the proposals are always accepted. Gibbs ...


2

Hybrid Monte Carlo is the standard algorithm used for neural networks. Gibbs sampling for Gaussian process classification (when not using a deterministic approximation instead).


2

If you want to find the global minimum of a function, simulated annealing would be the algorithm to look at, in which case there is no need to view the function as an unnormalised density of any kind and no need to transform the function.


2

From your question: It is possible that the transition function can suggest a move to an invalid part of the state space, and the jump should be obviously rejected. The jump should not be rejected This is a great article on the problem with immediately rejecting an errant jump. As a consequence, your problem vanishes.


2

We don't use MCMC to calculate the $p(\theta | y)$ for each value (or many values) of $\theta$. What MCMC (or the special case of Gibbs sampling) does is generate a (large) random sample from $p(\theta | y)$. Note that $p(\theta | y)$ is not being calculated; you have to do something with that vector (or matrix) of random numbers to estimate $p(\theta)$. ...


2

MCMC is a strategy for generating samples $x(i)$ while exploring the state space $X $using a Markov chain mechanism. These are irreducible and aperiodic Markov chains that have $P_{target}(\theta)$ as the invariant distribution. This mechanism is constructed so that the chain spends more time in the most important regions. In particular, it is constructed ...


2

1) You could think about this method as a random walk approach. When the proposal distribution $x \mid x^t \sim N( x^t, \sigma^2)$, it is commonly referred to as the Metropolis Algorithm. If $\sigma^2$ is too small, you will have a high acceptance rate and very slowly explore the target distribution. In fact, if $\sigma^2$ is too small and the ...


2

The multivariate normal is symmetric insofar as it applies to being a proposal distribution. One can just examine the ratio of PDFs: $$ \begin{eqnarray} \frac{\mathcal{N}(X \mid Y, \Sigma)}{\mathcal{N}(Y \mid X, \Sigma)} &=& \frac{(2\pi)^{-p/2} |\Sigma|^{-1/2} \exp\left( -\frac{1}{2} (X - Y)'\Sigma^{-1}(X-Y) \right)}{(2\pi)^{-p/2} |\Sigma|^{-1/2} ...



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