Some codes for AR(1) approximation using discrete markov chains