Source code for naginterfaces.​library.​examples.​tsa.​uni_dickey_fuller_unit_ex

#!/usr/bin/env python
"``naginterface.library.tsa.uni_dickey_fuller_unit`` Python Example."

# NAG Copyright 2017-2019.

# pylint: disable=invalid-name

from naginterfaces.library import tsa

[docs]def main(): """ Example for :func:`naginterfaces.library.tsa.uni_dickey_fuller_unit`. (Augmented) Dickey--Fuller unit root test statistic. >>> main() naginterfaces.library.tsa.uni_dickey_fuller_unit Python Example Results. Dickey--Fuller unit root test. Dickey--Fuller test statistic = -2.538 """ print( 'naginterfaces.library.tsa.uni_dickey_fuller_unit ' 'Python Example Results.' ) print('Dickey--Fuller unit root test.') # The unit-test type: test_type = 1 # The AR degree: p = 1 # The time series: y = [ -217., -177., -166., -136., -110., -95., -64., -37., -14., -25., -52., -62., -73., -88., -113., -120., -83., -33., -19., 21., 17., 44., 44., 78., 88., 122., 126., 114., 85., 64., ] print( 'Dickey--Fuller test statistic = {:.3f}'.format( tsa.uni_dickey_fuller_unit(test_type, p, y) ) )
if __name__ == '__main__': import doctest import sys sys.exit( doctest.testmod( None, verbose=True, report=False, optionflags=doctest.REPORT_NDIFF, ).failed )