I am new to random number generation in Python.
I understand the concept of a Markov Chain, but I am unable to convert it into a useful code:
Markov Chain - P(X_m+1 = j|X_m = i, X_m-1 = x_m-1,.....,X_0 = i_0) = P(X_m+1 = j |X_m = i)
For example how could I use Python to generate a Markov chain of real numbers distributed according to the exponential distribution :
P(x) = Ne^{−|x|}
where N is a normalization factor?
I think what you are looking for is
where N is the inverse of the scaling factor and t is the number of random numbers you want to generate. You'll have to compute the parameters in advance, according to the order of the chain (in your case, 1).