8

The most direct way of simulating a random variable from a distribution with cdf $F$ is to first simulate a Uniform variate $U\sim\mathcal{U}(0,1)$ and second return the inverse cdf transform $F^{-1}(U)$. When the inverse $F^{-1}$ is not available in closed form, a numerical inversion can be used. Numerical inversion may however be costly, especially in the ...


8

The confusion stems from a misunderstanding of the notation $$V \sim f_V$$ which means both (a) $V$ is a random variable with density $f_V$ and (b) $V$ is created by a PRNG algorithm that reproduces a generation of a random variable with density $f_V$. Each time a generation $V_i\sim f_V$ occurs in the algorithm from Casella and Berger, a new ...


5

I have puzzled over this question but never came with a satisfying solution. One property that is of possible use is that, if a density writes $$f(x)=\frac{g(x)-\omega h(x)}{1-\omega}\qquad \omega>0$$ where $g$ is a density such that $g(x)\ge \omega h(x)$, simulating from $g$ and rejecting these simulations with probability $\omega h(x)/g(x)$ delivers ...


3

If a Metropolis-Hastings algorithm uses a truncated Normal as proposal$${\cal N}^+(\mu_{t-1},\sigma^2)$$the associated Metropolis-Hastings acceptance ratio is $$\dfrac{\pi(\mu')}{\pi(\mu_{t-1})}\times \dfrac{\varphi(\{\mu_{t-1}-\mu'\}/\sigma)}{\varphi(\{\mu'-\mu_{t-1}\}/\sigma)}\times\dfrac{\Phi(\mu_{t-1}/\sigma)}{\Phi(\mu'/\sigma)}$$when $\mu'\sim{\cal N}^+(...


3

What do you mean by "find?" I can tell you $\pi(\theta \mid x)$ is proportional to $$ f(x \mid \theta) \pi(\theta) \propto \exp\left[-\frac{(\theta - x)^2}{2} - \log(1 + \theta^2) \right], $$ but I don't recognize this density. You can use this fact in a number of techniques to sample from the posterior (e.g. accept-reject, importance sampling with ...


3

I'll construct a proof of a simpler proposition which should make it clear how the more general one is done. Let $z \sim \text{U}(0,1)$. Then the density $p(z) = 1$ and the cumulative distribution $P(z) = z$. Now let us find the conditional distribution of $z | z < c$, i.e., $z \in (0,c)$. Using the definition of conditional probability, $p(z|z<c)...


2

I stumbled over this via googling. Rejection sampling is not needed. Instead, it is sufficient to flip the sign if the sample would be rejected! This is because we can use that $\Phi(-ax)+\Phi(ax)=1$ and thus $(f(x)+f(-x))/2= \phi(x) \Phi(ax)+ \phi(-x) \Phi(-ax)= \phi(x)$ Therefore, we can sample a skew-normal random variable by first sampling a standard ...


2

The simplest way is to use the cumulative distribution function like in the title of your question. As pointed by Jim B., the CDF is: $$F(x)=1-e^{-\frac{x^2}{10}}$$ The method is explained here: wikipedia or here: How does the inverse transform method work? The Aceptance-rejection method is more complex, usually slower, and should not be the first choice. ...


2

The paper is available from ResearchGate through Google. The validation of the delayed rejection algorithm is that, when starting with a realisation of the variable $X_t\sim\pi(x)$, the outcome of the Markov move to $X_{t+1}$ still remains distributed as $X_{t+1}\sim\pi(x)$. If the first step leads to an acceptance, the validation is the same as with the ...


2

The answer by Taylor is excellent, and already correctly gives the posterior kernel, which gives an intractable integral. If your goal is to find the posterior density (as opposed to sampling from the posterior distribution) then you are effectively just looking for the constant-of-integration: $$H(x) \equiv \frac{1}{\pi} \int \limits_{-\infty}^\infty \...


1

When you write the Metropolis-Hastings density [wrt a dominating measure that is the sum of a measure $\text{d}\lambda$ that is absolutely continuous against the target and of a Dirac measure at $x$] as$$K(x, x') = \displaystyle \alpha(x, x')q(x \mid x')$$it should be $$K(x, x') = \displaystyle \alpha(x, x')q(x' \mid x)+ \int (1-\alpha(x, x'))q(x' \mid x)\...


1

I hope this answers your questions: Since your hypothesis test is being performed at the $0.01$ significance level, $K = 8,9,10$ is the set of $x$ values for which you can reject $H_{0}$ at that significance level. In other words, those three $x$ values produce a $p$-value that is lower than your pre-determined significance level. You can see that those ...


1

I have the draft of an idea that could work. It is not exact, but hopefully asymptotically exact. To turn it into a really rigorous method, where the approximation is controlled, or something about it can be proven, there's probably a lot of work needed. First, as mentioned by Xi'an you can group the positive weights on one hand and the negative weights on ...


1

If you really want to do accept-reject I'd suggest that a $\chi^2_4$ density would be a considerably better choice as a proposal than a $\chi^2_1$. A $c$ of just under 1.5 will do (I'd just use 1.5, the difference is miniscule). [With care, a well chosen gamma density would let you push it some way below 1.5. Probably not worth the effort though; you may ...


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