Let's consider the Markov chain $X_n$ defined on $\mathbf{X} = \{0,1,2...,n \}$, generated according to Metropolis algorithm. Let $X_0 := 0$ be a starting state. The accepting rule is as follows:
if $X_n = x$, then:
$\text{ }$ let $y := \min(x+1, n)$ with probability $1/2$ or $y := \max(x-1, 0)$ with probability $1/2$
$\text{ }$ if $y \le x$ then: $X_{n+1} := y$
$\text{ }$ if $y > x$ then: $X_{n+1} := y$ with probability $q$ and $X_{n+1} := x$ with probability $1-q$
where $0<q<1$.
We want to find the limiting probability distribution $$ \pi(x) = \lim_{n \to \infty} P(X_n = x). $$
Therefore, as far as I understand we have to find the target distribution of this algorithm. Let's denote it $\pi(x)$.
Here are my attemps.
Given proposal value $y$ and the previous value $x$, we accept $y$ with probability $$P(y \le x) + P(y> x) \frac{1}{2} = \frac{1}{2} + \frac{1}{2}q$$ and reject with probability $$\frac{1}{2}(1-q) $$.
In general acceptance ratio is equal to: $$ \min(1, \frac{\pi(y)}{\pi(x)}). $$ Therefore we know that $$ \frac{\pi(y)}{\pi(x)} = \frac{1}{2} + \frac{1}{2}q. $$
I got stuck and I do not know how to proceed. Any help much appreciated.
I implemented the algorithm in R for n=10. But I have no idea what probability distribution it is.
N<-2000
res <- numeric(N)
res[1] <- 0
n <- 10
q <- 0.8
for(i in 2:N){
x <- res[i-1]
y <- sample( c(min(x+1, n), max(x-1,0)), prob=c(0.5,0.5), size=1 )
if (y <= x) res[i] <- y else{
u <- runif(1)
res[i] <- ifelse(u<q, y, x)
}
}
hist(res[100:2000])