
    M/Ph?                        d dl mZ d dlmZmZmZmZ ddgZg dZg dZ	eddd	d
dgZ
g dZg dZg dZg dZg dZg dZg dZg dZg dZe
eeedZe	eeedZeeeedZ eg d          Zg dg dg dg dg dg dgZ ee          ez  Zg dg dg dg d g d!g d"gZ ee          ez  Zg d#g d$g d%g d&g d'g d(gZ ee          ez  Zg d)g d*g d+g d,g d-g d.gZ ee          ez  ZeeeedZ eg d/          Zg d0g d1g d2g d3g d4g d5gZ ee          ez  Zg d6g d7g d8g d9g d:g d;gZ ee          ez  Zg d<g d=g d>g d?g d@g dAgZ  ee           ez  Z g dBg dCg dDg dEg dFg dGgZ! ee!          ez  Z!eee e!dZ"g dHZ#g dIZ$g dJZ%g dKZ& eg dLg dMg dNg dOg dPg dQg          Z' eg dRg dSg dTg dUg dVg dWg          Z( eg dXg dYg dZg d[g d\g d]g          Z) eg d^g d_g d`g dag dbg dcg          Z* eg dd          Z+ eg deg dfg dgg dhg dig djg          Z,e,e+z  Z, eg dkg dlg dmg dng dog dpg          Z-e-e+z  Z- eg dqg drg dsg dtg dug dvg          Z.e.e+z  Z. eg dwg dxg dyg dzg d{g d|g          Z/e/e+z  Z/ddZ0g dg dg dggZ1 ee1          Z1g dg dg dgg dg dg dgg dg dg dgg dg dg dgg dg dg dgg dg dg dgg dg dg dgg dg dg dgg dg dg dgg dg dg dgg dg dg dgg dg dg dggZ2 ee2          Z2g dg dg dgg dg dg dgg dg dg dgg dg dg dgg dg dg dgg dg dg dgg dg dg dgg dg dg dgg dg dg d¢gg dâg dĢg dŢgg dƢg dǢg dȢgg dɢg dʢg dˢggZ3 ee3          Z3g d̢g d͢g d΢gg dϢg dТg dѢgg dҢg dӢg dԢgg dբg d֢g dעgg dآg d٢g dڢgg dۢg dܢg dݢgg dޢg dߢg dgg dg dg dgg dg dg dgg dg dg dgg dg dg dgg dg dg dggZ4 ee4          Z4e1e2e3e4dZ5d~d}efdZ6dS )    )norm)arraypolyvalinfasarray
mackinnonpmackinnoncrit)gp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?)gȘ@g7@g3?g{Gz?gE?)gx$(~@gsF@g9EGr?gpΈ?gɳ?)g[잼@g[ Ac@gi o?gH}8?g1%?)g47B@g(~k@g_vO?g-1?gNbX9?)gh|?5@gL
F%@gͪ?gԚ?gc]F?)gS@gL	@gJ4?gQ?glV}?)gK7A`@gH@g9v?gyX5;?ggs?)g?d@g=yX(@gn?g@a+?gݓ?r   r   Nc                 b   t           |         }t          |         }t          |         }| ||dz
           k    rdS | ||dz
           k     rdS | ||dz
           k    rt          |         |dz
           }nt          |         |dz
           }t          j        t          |ddd         |                     S )a  
    Returns MacKinnon's approximate p-value for teststat.

    Parameters
    ----------
    teststat : float
        "T-value" from an Augmented Dickey-Fuller regression.
    regression : str {"c", "n", "ct", "ctt"}
        This is the method of regression that was used.  Following MacKinnon's
        notation, this can be "c" for constant, "n" for no constant, "ct" for
        constant and trend, and "ctt" for constant, trend, and trend-squared.
    N : int
        The number of series believed to be I(1).  For (Augmented) Dickey-
        Fuller N = 1.

    Returns
    -------
    p-value : float
        The p-value for the ADF statistic estimated using MacKinnon 1994.

    References
    ----------
    .. [*] MacKinnon, J.G. 1994  "Approximate Asymptotic Distribution Functions
        for Unit-Root and Cointegration Tests." Journal of Business & Economics
        Statistics, 12.2, 167-76.

    Notes
    -----
    For (A)DF
    H_0: AR coefficient = 1
    H_a: AR coefficient < 1
    r         ?g        N)	_tau_maxs	_tau_mins
_tau_stars_tau_smallps_tau_largepsr   cdfr   )teststat
regressionNlagsmaxstatminstatstarstattau_coefs           Y/var/www/html/test/jupyter/venv/lib/python3.11/site-packages/statsmodels/tsa/adfvalues.pyr   r      s    B 
#G
#G*%H'!A#,s	GAaCL	 	 s8AaC=  
+AaC0  
+AaC08GHTTrTNH55666    )gOpg,Cgjtr   )guVg(0ѿgQ
g+9?@)gL~gSt$?gʡEgw/]9@)g6>W[qgcZB>(gK70gʡES)gaog=UgV-gQD)gԲgQIgFxr   )g$+go_%g~jt@r   )gƢd
g(pgnJr   )g%u[gI.!g(\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yI8g^I+!gn<e@)gR\UgǘGgjt4^g$@)gC9Ѯgz6@gvBg/$u@)gV/gׁsF4;g^I+gZd;O5f@)glIFg?6IgCl`gh|?@)gMtg^I;Bgsh|Bg/u@)gvZgPn3>gxgA`Jj@)gV`Vg	[Kgyag^I@)gX>gQCg BgA``y@)gL7A`%gz@gClg#~js@)gB	|g(-'gFAgnt)g#gog{G(gV-])gz1mgfc]Fgy&1,gd;OO)ghbg
h"lx:4gA`:Pgjt8V@)gWgo*gxf<gCl/R@)g鲘gvOj$g rh1gy&1P@)gG|gJY7gB`";Sg/$g@)gU]gΈ/g r(@gQ^@)g{gz6>W(gx1g
ףp=T@)gy):gF%uH;g/$SgZd;;a@)g!Yg$(~{2g     ?g?5^I[@)g6Xgǘp-gMb1g{GzY@)g#0g3>g(\WgPno@)g{g#~j<5gHzBg-Fh@)gxgE1gK72g/$a@)g*g\g}?5^YAg{Zg`"۟x@)gJigV/78g$Cg7A`m@)gLg^K=3gS2g rhe@)gTt<gQI^CgQ&[gSv@)gPgrhL;g9vCgL7A`n@)g%̴g\mB6g)\1g+j@)gD
gz):[Eg+]gQVz@)g	K<g9vo>gfffff&FgHzu@)g6>W[gj+8g㥛 3gZd'q@)gR8g~k	aGg'1agףp=
[@)g:gN@@g+WEgMbu@)g6Tg/$;g(\+g33333m@)gW2đg48}IgX9.bgҁ@)g2YxgI+Bgy&1\HgGz}@)g<Nё\^gV>gK7A-gjts@)g?Yg[잤KgFcgV-Ĉ@)g6~AglV}FDg bGg)\r~@)gc&(g(\@gX9v>"gvq@)gTގpg0L
FMgdgy&1@)g28J^g3
Fg"Gg'1@)g^}tgݵ|{Bg#~j%gv&z@c                     |}|dvrt          d|z            t          |         }|t          u r|| dz
  dddf         S || dz
  dddddf         }t          |j        d|z            S )a0  
    Returns the critical values for cointegrating and the ADF test.

    In 2010 MacKinnon updated the values of his 1994 paper with critical values
    for the augmented Dickey-Fuller tests.  These new values are to be
    preferred and are used here.

    Parameters
    ----------
    N : int
        The number of series of I(1) series for which the null of
        non-cointegration is being tested.  For N > 12, the critical values
        are linearly interpolated (not yet implemented).  For the ADF test,
        N = 1.
    reg : str {'c', 'tc', 'ctt', 'n'}
        Following MacKinnon (1996), these stand for the type of regression run.
        'c' for constant and no trend, 'tc' for constant with a linear trend,
        'ctt' for constant with a linear and quadratic trend, and 'n' for
        no constant.  The values for the no constant case are taken from the
        1996 paper, as they were not updated for 2010 due to the unrealistic
        assumptions that would underlie such a case.
    nobs : int or np.inf
        This is the sample size.  If the sample size is numpy.inf, then the
        asymptotic critical values are returned.

    References
    ----------
    .. [*] MacKinnon, J.G. 1994  "Approximate Asymptotic Distribution Functions
        for Unit-Root and Cointegration Tests." Journal of Business & Economics
        Statistics, 12.2, 167-76.
    .. [*] MacKinnon, J.G. 2010.  "Critical Values for Cointegration Tests."
        Queen's University, Dept of Economics Working Papers 1227.
        http://ideas.repec.org/p/qed/wpaper/1227.html
    )r   r   r   r   z$regression keyword %s not understoodr   Nr   r   r   )
ValueError	tau_2010sr   r   T)r"   r!   nobsregtauvals         r(   r	   r	     s    F C
)))?#EFFF
C.Cs{{1Q319~!A#qqq$$B$,subg&&&r)   )r   r   N)7scipy.statsr   numpyr   r   r   r   __all__tau_star_nc
tau_min_nc
tau_max_nc
tau_star_c	tau_min_c	tau_max_ctau_star_ct
tau_min_ct
tau_max_cttau_star_ctttau_min_ctttau_max_cttr   r   r   small_scalingtau_nc_smallptau_c_smallptau_ct_smallptau_ctt_smallpr   large_scalingtau_nc_largeptau_c_largeptau_ct_largeptau_ctt_largepr   	z_star_ncz_star_c	z_star_ct
z_star_cttz_nc_smallp
z_c_smallpz_ct_smallpz_ctt_smallpz_large_scalingz_nc_largep
z_c_largepz_ct_largepz_ctt_largepr   tau_nc_2010
tau_c_2010tau_ct_2010tau_ctt_2010r.   r	    r)   r(   <module>r_      s         . . . . . . . . . . . .
)
 988===
4tT40
777
<<<	---	888===
000
999===222 
	
	 	 
	
	 	 
	
	 
 lll## &&}4  w|$$]2  &&}4  ((6 
	
	  +++,,%%%$$$&&&&&&&&&%%%' &&}4 '&&&&&&&&&&&&&&%%%' w|$$]2 '&&###$$$%%%%%%&&&( &&}4 '&&%%%&&&&&&%%%&&&( ((6 
	
	  544	444666	777
 e   &&&&&&'''   " # # U&&&'''      (((* + +
 e&&&%%%!!!!!!   (((* + + u""""""!!!"""""")))+ , , %33344e''',,,,,,,,,,,,+++- . .  U&&&+++)))+++,,,,,,. / /
 o 
e))),,,,,,+++***,,,. / /  u,,,,,,+++,,,***,,,. / /  -7 -7 -7 -7l #""'''&&&( ) gk"" +**)))###% &%%######% +**)))###% &%%%%%###% &%%%%%$$$& +*****)))+ ,+++++)))+ ,+++++)))+ ,+++++***, ,+++++***, -,,+++***, -,,+++***,E$-
J WZ  
 ,++))))))+ &%%$$$(((* ,++***(((* +*****)))+ +********, ,++***)))+ ,++++++++- +**++++++- -,,+++***, -,,+++***, -,,+++***, -,,+++***,E$-J gk"" -,,+++)))+ +********, ,+++++***, ,+++++***, ,++++++++- -,,++++++- -,,++++++- -,,***+++- ,++++++++- -,,***+++- -,,+++***, -,,++++++-E$.J w|$$ 
	
	 	 #C +' +' +' +' +' +'r)   