# Tag Info

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 ...

7

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 ...

6

Are you sure the joint density$$f(x_1,x_2)=\left(\dfrac{x_1}{x_2}\right)\left(\dfrac{\alpha}{x_2}\right)^{x_1-1}\exp\left\{-\left(\dfrac{\alpha}{x_2}\right)^{x_1} \right\}\mathbb{I}_{\mathbb{R}^*_+}(x_1,x_2)$$ is integrable? When I consider the conditional$$f(x_2|x_1)=\dfrac{1}{{x_2}^{x_1}}\exp\left\{-\dfrac{\gamma}{{x_2}^{x_1}} \right\}$$ it should be a ...

6

The slice sampler does not "sample from the log-density". It can, however, use the log density in the calculations to obtain a dependent sequence of observations from the density. The basic idea of a slice sampler is in terms of the density itself, but for various reasons (computational accuracy, primarily) it's usually more convenient to work with the ...

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

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 # ...

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.

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 ...

4

Well, if you are looking "for any pointers"... The (scaled)(inverse)Wishart distribution is often used because it is conjugate to the multivariate likelihood function and thus simplifies Gibbs sampling. In Stan, which uses Hamiltonian Monte Carlo sampling, there is no restriction for multivariate priors. The recommended approach is the separation strategy ...

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 ...

3

You do not need the $\alpha$ since it is a parameter. The change of variables formula applies to the variable with respect to which you are "integrating". It is $x$ in your case. So MH is right to demand that you remove the excess factor. So what you really have is: $$p(X|\alpha) = \frac{\exp(-\exp(\alpha))\exp(\alpha x)}{x!}$$ had you applied some ...

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 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 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 ... 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 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 ... 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 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 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 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 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 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 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

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.

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