In stochastic analysis, for an Ito diffusion $X\_t$ such that $dX\_t=\mu(X\_t)dt+\sigma(X\_t)dB\_t$, we can exlpicitly compute a "natural scale function"
$$S(x)=\int^x\exp\left(-\int^y\frac{2\mu(z)}{\sigma^2(z)}dz\right)dy$$
with suitable conditions on $\mu$ and $\sigma$, making $S(X\_t)$ a martingale(or at least a local martingale).


**My question is: can we do something similar in more general processes, such as discrete time Markov processes?**


One example is the asymmetric simple random walk on $\mathbb{Z}$. Let $\xi\_i$ be i.i.d. taking value $1$ with probability $p\not=\frac 12$, and value $(-1)$ with probability $q=1-p$. The random walk is then $X\_n=\sum\_{i=1}^n\xi\_i$. Then we know the function $S(x)=(q/p)^x$ is a natural scale function since $S(X\_n)$ is a martingale.


**Is there a systematic way to compute this function out, like in the Ito diffusion case?**


This question is also posted on MSE [here](https://math.stackexchange.com/questions/4115501/how-to-find-the-natural-scale-function-of-more-general-type-of-stochastic-proc).



How to find the "natural scale function" for more general stochastic processes?
Just figured this out with the help of @Nawaf Bou-Rabee. Thank you!


The idea is to calculate the infinitesimal generator $L$ for the markov process $X\_n$ or $X\_t$, and a function $f$ making $f(X\_n)$ or $f(X\_t)$ a martingale(or local martingale for continuous time) if and only if $Lf=0$. See reference [here](https://wt.iam.uni-bonn.de/fileadmin/WT/Inhalt/people/Anton_Bovier/lecture-notes/markov.pdf).


This is the key step, and this actually gives the explicit expression of S(x) in the case of Ito diffusion:


now the generator is $L=\mu\frac{d}{dx}+\frac{\sigma^2}{2}\frac{d^2}{dx^2}$, and the natural scale function mentioned above is just the solution of the ODE: $$\mu S'+\frac{\sigma^2}{2}S''=0.$$


For the asymmetric simple random walk, the generator by definition is $$Lf(x)=\mathbb{E}^x[f(X\_1)]-f(x)=pf(x+1)+qf(x-1)-f(x).$$


And solving this difference equation we get that function $S(x)=(q/p)^x$ above as well.


