Tauchen approx sigma explanation

Hello and thank you for this tool.

I am confused with sigma parameters in tauchen func:
tauchen(n, rho, sigma, mu=0., n_std=3):

I have no difference in transition matrix P with different value of sigma
do you have an explanation ?

Thanks in advance

Hi @egos,

From the docstrings we have:

Computes a Markov chain associated with a discretized version of
the linear Gaussian AR(1) process

       $$ y_t = \mu + \rho y_{t-1} + \epsilon_t $$

    using Tauchen's method.

    Parameters
    ----------

    n : scalar(int)
        The number of states to use in the approximation
    rho : scalar(float)
        The autocorrelation coefficient, Persistence parameter in AR(1) process
    sigma : scalar(float)
        The standard deviation of the random process
    mu : scalar(float), optional(default=0.0)
        The value :math:`\mu` in the process.  Note that the mean of this
        AR(1) process, :math:`y`, is simply :math:`\mu/(1 - \rho)`
    n_std : scalar(int), optional(default=3)
        The number of standard deviations to approximate out to

Here, sigma is actually the standard deviation involved in computing the state space. It does have a role in computing the P matrix, but while computing P, it involves standard normal cdf which uses erfc. Now since erfc shows a noticeable deviation in the range [-2, 2] and very negligible outside that range, it becomes hard to find such sigma values that will show differences in P. But changing sigma will surely produce a noticeable change in the state_values. See:

>>> n = 5
>>> sigma = 2
>>> rho = 0.3
>>> mc = qe.tauchen(n, rho, sigma)
>>> sigma = 3
>>> mc2 = qe.tauchen(n, rho, sigma)
>>> np.allclose(mc.P, mc2.P)
True
>>> np.allclose(mc.state_values, mc2.state_values)
False

Thank you very much for your answer, you opened my eyes.
sorry my message was not very detailed
I had already looked at the doc but my confusion actually comes from my subject and I think I found the right forum to talk about it

I’m working on Arrelano’s original work: https://www.aeaweb.org/articles?id=10.1257/aer.98.3.690

and especially its source code: > Replication data for: Default Risk and Income Fluctuations in Emerging Economies

I don’t have a very good level of stats my specialty is algorithms, I redid the source code in python / numpy
it uses a normal AR(1) process log, and I still have trouble understanding the normal log here (I already watched the tutorial on the AR process), I guess it’s to work in percentage …?

the source code uses a P matrix identical to that obtained via the tauchen func and I begin to understand that the shock state data already includes the sigma y = [-2,2] and therefore a shock = [-exp(-2),exp(2)] since he says in his publication that he used data from argentina to determine the state of normal shocks
so if I want to adjust sigma for other use case I have to take into account the change of state value in the resolution
What do you think of my reasoning?

in a second step:
I included in the AR process normal log a probability ph of having an extreme mu shock
to do this I transformed the transition matrix into a composition of P normal and P shock extreme

P = (1-ph) * tauchen(n, rho, sigma) + ph * tauchen(mu, n, rho, sigma)

The results are consistent but given my difficulties with the tauchen method I still have doubts
if you can tell me what you think?

thank you again for your help I’m really happy to have found all these resources