Beispiel #1
0
def unitroot_adf(x, maxlag=None, trendorder=0, autolag='AIC', store=False):
    return adfuller(x,
                    maxlag=maxlag,
                    regression=trendorder,
                    autolag=autolag,
                    store=store,
                    regresults=False)
Beispiel #2
0
 def __init__(self):
     self.res1 = adfuller(self.x, regression="nc", autolag=None, maxlag=4)
     self.teststat = 3.5227498
     self.pvalue = .99999  # Stata does not return a p-value for noconstant.
     # Tau^max in MacKinnon (1994) is missing, so it is
     # assumed that its right-tail is well-behaved
     self.critvalues = [-2.587, -1.950, -1.617]
 def __init__(self):
     self.res1 = adfuller(self.y, regression="nc", autolag=None,
             maxlag=1)
     self.teststat = -2.4511596
     self.pvalue = 0.013747 # Stata does not return a p-value for noconstant
                            # this value is just taken from our results
     self.critvalues = [-2.587,-1.950,-1.617]
 def __init__(self):
     self.res1 = adfuller(self.x, regression="nc", autolag=None,
             maxlag=4)
     self.teststat = 3.5227498
     self.pvalue = .99999 # Stata does not return a p-value for noconstant.
                     # Tau^max in MacKinnon (1994) is missing, so it is
                     # assumed that its right-tail is well-behaved
     self.critvalues = [-2.587, -1.950, -1.617]
Beispiel #5
0
 def __init__(self):
     self.res1 = adfuller(self.y, regression="ct", autolag=None, maxlag=1)
     self.teststat = -4.425093
     self.pvalue = .00199633
     self.critvalues = [-4.006, -3.437, -3.137]
Beispiel #6
0
 def __init__(self):
     self.res1 = adfuller(self.y, regression="c", autolag=None, maxlag=1)
     self.teststat = -4.3346988
     self.pvalue = .00038661
     self.critvalues = [-3.476, -2.883, -2.573]
Beispiel #7
0
 def __init__(self):
     self.res1 = adfuller(self.x, regression="ct", autolag=None, maxlag=4)
     self.teststat = -1.8566374
     self.pvalue = .67682968
     self.critvalues = [-4.007, -3.437, -3.137]
Beispiel #8
0
 def __init__(self):
     self.res1 = adfuller(self.x, regression="c", autolag=None, maxlag=4)
     self.teststat = .97505319
     self.pvalue = .99399563
     self.critvalues = [-3.476, -2.883, -2.573]
Beispiel #9
0
 def __init__(self):
     self.res1 = adfuller(self.y, regression="nc", autolag=None, maxlag=1)
     self.teststat = -2.4511596
     self.pvalue = 0.013747  # Stata does not return a p-value for noconstant
     # this value is just taken from our results
     self.critvalues = [-2.587, -1.950, -1.617]
 def __init__(self):
     self.res1 = adfuller(self.y, regression="ct", autolag=None,
             maxlag=1)
     self.teststat = -4.425093
     self.pvalue = .00199633
     self.critvalues = [-4.006, -3.437, -3.137]
 def __init__(self):
     self.res1 = adfuller(self.y, regression="c", autolag=None,
             maxlag=1)
     self.teststat = -4.3346988
     self.pvalue = .00038661
     self.critvalues = [-3.476, -2.883, -2.573]
 def __init__(self):
     self.res1 = adfuller(self.x, regression="ct", autolag=None,
             maxlag=4)
     self.teststat = -1.8566374
     self.pvalue = .67682968
     self.critvalues = [-4.007, -3.437, -3.137]
 def __init__(self):
     self.res1 = adfuller(self.x, regression="c", autolag=None,
             maxlag=4)
     self.teststat = .97505319
     self.pvalue = .99399563
     self.critvalues = [-3.476, -2.883, -2.573]
def unitroot_adf(x, maxlag=None, trendorder=0, autolag='AIC', store=False):
    return adfuller(x, maxlag=maxlag, regression=trendorder, autolag=autolag,
                    store=store, regresults=False)
        regrRet = ols(y=formationRet1, x=formationRet2)

        residualsPrc = regrPrc.resid
        residualsRet = regrRet.resid
        beta = regrPrc.beta[0]
        intercept = regrPrc.beta[1]

        # if pair[0]=='EWP' and pair[1]=='EWL': #residual JUMPS
        # 	pdb.set_trace()

        # print "residuals length = " + str(len(residuals))
        # print "running dickey fuller..."
        # do dickey fuller to see if residuals are even cointegrated
        x = np.array(residualsRet)  # residuals of Ret of Prc?
        # x = np.array(residualsPrc) #residuals of Ret of Prc?
        result = ts.adfuller(x)

        pval = result[1]
        # print "pval = " + str(pval)

        if pval < 0.05:
            try:
                u = residualsPrc[119]  # in terms of price
            except:
                pdb.set_trace()

                # debug
                # if (pair[0]=='EWP' and pair[1]=='EWC'):
                # 	print "before setting resids for EWP,EWC"
                # pdb.set_trace()