{"id":1760,"date":"2023-07-25T02:36:28","date_gmt":"2023-07-25T02:36:28","guid":{"rendered":"https:\/\/statorials.org\/nl\/dickey-volledigere-testpython\/"},"modified":"2023-07-25T02:36:28","modified_gmt":"2023-07-25T02:36:28","slug":"dickey-volledigere-testpython","status":"publish","type":"post","link":"https:\/\/statorials.org\/nl\/dickey-volledigere-testpython\/","title":{"rendered":"Augmented dickey-fuller-test in python (met voorbeeld)"},"content":{"rendered":"<p><\/p>\n<hr>\n<p><span style=\"color: #000000;\">Van een tijdreeks wordt gezegd dat deze \u2018stationair\u2019 is als deze geen trend vertoont, een constante variantie in de tijd vertoont en een constante autocorrelatiestructuur in de loop van de tijd heeft.<\/span><\/p>\n<p> <span style=\"color: #000000;\">Een manier om te testen of een tijdreeks stationair is, is door een <strong>augmented Dickey-Fuller-test<\/strong> uit te voeren, waarbij de volgende nul- en alternatieve hypothesen worden gebruikt:<\/span><\/p>\n<p> <span style=\"color: #000000;\"><strong>H <sub>0<\/sub> :<\/strong> De tijdreeks is niet-stationair. Met andere woorden, de structuur ervan is afhankelijk van de tijd en de variatie ervan is niet constant in de tijd.<\/span><\/p>\n<p> <span style=\"color: #000000;\"><strong>H <sub>A<\/sub> :<\/strong> De tijdreeks is stationair.<\/span><\/p>\n<p> <span style=\"color: #000000;\">Als de <a href=\"https:\/\/statorials.org\/nl\/p-waarden-statistische-significantie\/\" target=\"_blank\" rel=\"noopener\">p-waarde<\/a> van de test onder een bepaald significantieniveau ligt (bijvoorbeeld \u03b1 = 0,05), kunnen we de nulhypothese verwerpen en concluderen dat de tijdreeks stationair is.<\/span><\/p>\n<p> <span style=\"color: #000000;\">Het volgende stapsgewijze voorbeeld laat zien hoe u een uitgebreide Dickey-Fuller-test in Python kunt uitvoeren voor een bepaalde tijdreeks.<\/span><\/p>\n<h3> <span style=\"color: #000000;\"><strong>Voorbeeld: uitgebreide Dickey-Fuller-test in Python<\/strong><\/span><\/h3>\n<p> <span style=\"color: #000000;\">Stel dat we de volgende tijdreeksgegevens in Python hebben:<\/span><\/p>\n<pre style=\"background-color: #ececec; font-size: 15px;\"> <strong>data = [3, 4, 4, 5, 6, 7, 6, 6, 7, 8, 9, 12, 10]<\/strong><\/pre>\n<p> <span style=\"color: #000000;\">Voordat we een uitgebreide Dickey-Fuller-test op de gegevens uitvoeren, kunnen we een snelle plot maken om de gegevens te visualiseren:<\/span> <\/p>\n<pre style=\"background-color: #ececec; font-size: 15px;\"> <strong><span style=\"color: #008000;\">import<\/span> matplotlib. <span style=\"color: #3366ff;\">pyplot<\/span> <span style=\"color: #008000;\">as<\/span> plt\n\nplt. <span style=\"color: #3366ff;\">plot<\/span> (data)<\/strong> <\/pre>\n<p><img decoding=\"async\" loading=\"lazy\" class=\" wp-image-17233 aligncenter\" src=\"https:\/\/statorials.org\/wp-content\/uploads\/2023\/08\/adf1.png\" alt=\"\" width=\"400\" height=\"275\" srcset=\"\" sizes=\"auto, \"><\/p>\n<p> <span style=\"color: #000000;\">Om een uitgebreide Dickey-Fuller-test uit te voeren, kunnen we de functie <a href=\"https:\/\/www.statsmodels.org\/stable\/generated\/statsmodels.tsa.stattools.adfuller.html\" target=\"_blank\" rel=\"noopener\">adfuller()<\/a> uit de <strong>statsmodels-<\/strong> bibliotheek gebruiken. Eerst moeten we statsmodels installeren:<\/span><\/p>\n<pre style=\"background-color: #ececec; font-size: 15px;\"> <strong>pip install statsmodels\n<\/strong><\/pre>\n<p> <span style=\"color: #000000;\">Vervolgens kunnen we de volgende code gebruiken om de augmented Dickey-Fuller-test uit te voeren:<\/span><\/p>\n<pre style=\"background-color: #ececec; font-size: 15px;\"> <strong><span style=\"color: #008000;\">from<\/span> statsmodels. <span style=\"color: #3366ff;\">tsa<\/span> . <span style=\"color: #3366ff;\">stattools<\/span> <span style=\"color: #008000;\">import<\/span> adfuller\n\n<span style=\"color: #008080;\">#perform augmented Dickey-Fuller test<\/span>\nadfuller(data)\n\n(-0.9753836234744063,\n 0.7621363564361013,\n 0,\n 12,\n {'1%': -4.137829282407408,\n  '5%': -3.1549724074074077,\n  '10%': -2.7144769444444443},\n 31.2466098872313)\n<\/strong><\/pre>\n<p> <span style=\"color: #000000;\">Zo interpreteert u de belangrijkste waarden van het resultaat:<\/span><\/p>\n<ul>\n<li> <span style=\"color: #000000;\">Teststatistiek: <strong>-0,97538<\/strong><\/span><\/li>\n<li> <span style=\"color: #000000;\">P-waarde: <strong>0,7621<\/strong><\/span><\/li>\n<\/ul>\n<p> <span style=\"color: #000000;\">Omdat de p-waarde niet kleiner is dan 0,05, slagen we er niet in de nulhypothese te verwerpen.<\/span><\/p>\n<p> <span style=\"color: #000000;\">Dit betekent dat de tijdreeks niet stationair is. Met andere woorden, de structuur ervan is afhankelijk van de tijd en de variatie ervan is niet constant in de tijd.<\/span><\/p>\n<h3> <span style=\"color: #000000;\"><strong>Aanvullende bronnen<\/strong><\/span><\/h3>\n<p> <a href=\"https:\/\/statorials.org\/nl\/matplotlib-tijdreeks\/\" target=\"_blank\" rel=\"noopener\">Hoe een tijdreeks in Matplotlib te plotten<\/a><br \/> <a href=\"https:\/\/statorials.org\/nl\/pandas-meerdere-plotseries\/\" target=\"_blank\" rel=\"noopener\">Hoe meerdere series uit een Pandas DataFrame te plotten<\/a><br \/> <a href=\"https:\/\/statorials.org\/nl\/mann-kendall-test-python\/\" target=\"_blank\" rel=\"noopener\">Hoe u een Mann-Kendall-trendtest uitvoert in Python<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Van een tijdreeks wordt gezegd dat deze \u2018stationair\u2019 is als deze geen trend vertoont, een constante variantie in de tijd vertoont en een constante autocorrelatiestructuur in de loop van de tijd heeft. Een manier om te testen of een tijdreeks stationair is, is door een augmented Dickey-Fuller-test uit te voeren, waarbij de volgende nul- en [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[11],"tags":[],"class_list":["post-1760","post","type-post","status-publish","format-standard","hentry","category-gids"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v21.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Augmented Dickey-Fuller-test in Python (met voorbeeld)<\/title>\n<meta name=\"description\" content=\"In deze tutorial wordt uitgelegd hoe u een uitgebreide Dickey-Fuller-test in Python uitvoert, inclusief een stapsgewijs voorbeeld.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/statorials.org\/nl\/dickey-volledigere-testpython\/\" \/>\n<meta property=\"og:locale\" content=\"de_DE\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Augmented Dickey-Fuller-test in Python (met voorbeeld)\" \/>\n<meta property=\"og:description\" content=\"In deze tutorial wordt uitgelegd hoe u een uitgebreide Dickey-Fuller-test in Python uitvoert, inclusief een stapsgewijs voorbeeld.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/statorials.org\/nl\/dickey-volledigere-testpython\/\" \/>\n<meta property=\"og:site_name\" content=\"Statorials\" \/>\n<meta property=\"article:published_time\" content=\"2023-07-25T02:36:28+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/statorials.org\/wp-content\/uploads\/2023\/08\/adf1.png\" \/>\n<meta name=\"author\" content=\"Dr.benjamin anderson\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Verfasst von\" \/>\n\t<meta name=\"twitter:data1\" content=\"Dr.benjamin anderson\" \/>\n\t<meta name=\"twitter:label2\" content=\"Gesch\u00e4tzte Lesezeit\" \/>\n\t<meta name=\"twitter:data2\" content=\"2\u00a0Minuten\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/statorials.org\/nl\/dickey-volledigere-testpython\/\",\"url\":\"https:\/\/statorials.org\/nl\/dickey-volledigere-testpython\/\",\"name\":\"Augmented Dickey-Fuller-test in Python (met voorbeeld)\",\"isPartOf\":{\"@id\":\"https:\/\/statorials.org\/nl\/#website\"},\"datePublished\":\"2023-07-25T02:36:28+00:00\",\"dateModified\":\"2023-07-25T02:36:28+00:00\",\"author\":{\"@id\":\"https:\/\/statorials.org\/nl\/#\/schema\/person\/d4b8842173cca1bb62cdec41860e4219\"},\"description\":\"In deze tutorial wordt uitgelegd hoe u een uitgebreide Dickey-Fuller-test in Python uitvoert, inclusief een stapsgewijs voorbeeld.\",\"breadcrumb\":{\"@id\":\"https:\/\/statorials.org\/nl\/dickey-volledigere-testpython\/#breadcrumb\"},\"inLanguage\":\"de\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/statorials.org\/nl\/dickey-volledigere-testpython\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/statorials.org\/nl\/dickey-volledigere-testpython\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Thuis\",\"item\":\"https:\/\/statorials.org\/nl\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Augmented dickey-fuller-test in python (met voorbeeld)\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/statorials.org\/nl\/#website\",\"url\":\"https:\/\/statorials.org\/nl\/\",\"name\":\"Statorials\",\"description\":\"Uw gids voor statistische competentie\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/statorials.org\/nl\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"de\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/statorials.org\/nl\/#\/schema\/person\/d4b8842173cca1bb62cdec41860e4219\",\"name\":\"Dr.benjamin anderson\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"de\",\"@id\":\"https:\/\/statorials.org\/nl\/#\/schema\/person\/image\/\",\"url\":\"http:\/\/statorials.org\/nl\/wp-content\/uploads\/2023\/10\/Dr.-Benjamin-Anderson-96x96.jpg\",\"contentUrl\":\"http:\/\/statorials.org\/nl\/wp-content\/uploads\/2023\/10\/Dr.-Benjamin-Anderson-96x96.jpg\",\"caption\":\"Dr.benjamin anderson\"},\"description\":\"Ik ben Benjamin, een gepensioneerde hoogleraar statistiek die nu een toegewijde Statorials-lesgever is. Ik heb uitgebreide ervaring en expertise op het gebied van statistiek en ik ben vastbesloten om mijn kennis te delen met studenten via Statorials. Lees verder\",\"sameAs\":[\"http:\/\/statorials.org\/nl\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Augmented Dickey-Fuller-test in Python (met voorbeeld)","description":"In deze tutorial wordt uitgelegd hoe u een uitgebreide Dickey-Fuller-test in Python uitvoert, inclusief een stapsgewijs voorbeeld.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/statorials.org\/nl\/dickey-volledigere-testpython\/","og_locale":"de_DE","og_type":"article","og_title":"Augmented Dickey-Fuller-test in Python (met voorbeeld)","og_description":"In deze tutorial wordt uitgelegd hoe u een uitgebreide Dickey-Fuller-test in Python uitvoert, inclusief een stapsgewijs voorbeeld.","og_url":"https:\/\/statorials.org\/nl\/dickey-volledigere-testpython\/","og_site_name":"Statorials","article_published_time":"2023-07-25T02:36:28+00:00","og_image":[{"url":"https:\/\/statorials.org\/wp-content\/uploads\/2023\/08\/adf1.png"}],"author":"Dr.benjamin anderson","twitter_card":"summary_large_image","twitter_misc":{"Verfasst von":"Dr.benjamin anderson","Gesch\u00e4tzte Lesezeit":"2\u00a0Minuten"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/statorials.org\/nl\/dickey-volledigere-testpython\/","url":"https:\/\/statorials.org\/nl\/dickey-volledigere-testpython\/","name":"Augmented Dickey-Fuller-test in Python (met voorbeeld)","isPartOf":{"@id":"https:\/\/statorials.org\/nl\/#website"},"datePublished":"2023-07-25T02:36:28+00:00","dateModified":"2023-07-25T02:36:28+00:00","author":{"@id":"https:\/\/statorials.org\/nl\/#\/schema\/person\/d4b8842173cca1bb62cdec41860e4219"},"description":"In deze tutorial wordt uitgelegd hoe u een uitgebreide Dickey-Fuller-test in Python uitvoert, inclusief een stapsgewijs voorbeeld.","breadcrumb":{"@id":"https:\/\/statorials.org\/nl\/dickey-volledigere-testpython\/#breadcrumb"},"inLanguage":"de","potentialAction":[{"@type":"ReadAction","target":["https:\/\/statorials.org\/nl\/dickey-volledigere-testpython\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/statorials.org\/nl\/dickey-volledigere-testpython\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Thuis","item":"https:\/\/statorials.org\/nl\/"},{"@type":"ListItem","position":2,"name":"Augmented dickey-fuller-test in python (met voorbeeld)"}]},{"@type":"WebSite","@id":"https:\/\/statorials.org\/nl\/#website","url":"https:\/\/statorials.org\/nl\/","name":"Statorials","description":"Uw gids voor statistische competentie","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/statorials.org\/nl\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"de"},{"@type":"Person","@id":"https:\/\/statorials.org\/nl\/#\/schema\/person\/d4b8842173cca1bb62cdec41860e4219","name":"Dr.benjamin anderson","image":{"@type":"ImageObject","inLanguage":"de","@id":"https:\/\/statorials.org\/nl\/#\/schema\/person\/image\/","url":"http:\/\/statorials.org\/nl\/wp-content\/uploads\/2023\/10\/Dr.-Benjamin-Anderson-96x96.jpg","contentUrl":"http:\/\/statorials.org\/nl\/wp-content\/uploads\/2023\/10\/Dr.-Benjamin-Anderson-96x96.jpg","caption":"Dr.benjamin anderson"},"description":"Ik ben Benjamin, een gepensioneerde hoogleraar statistiek die nu een toegewijde Statorials-lesgever is. Ik heb uitgebreide ervaring en expertise op het gebied van statistiek en ik ben vastbesloten om mijn kennis te delen met studenten via Statorials. Lees verder","sameAs":["http:\/\/statorials.org\/nl"]}]}},"yoast_meta":{"yoast_wpseo_title":"","yoast_wpseo_metadesc":"","yoast_wpseo_canonical":""},"_links":{"self":[{"href":"https:\/\/statorials.org\/nl\/wp-json\/wp\/v2\/posts\/1760","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/statorials.org\/nl\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/statorials.org\/nl\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/statorials.org\/nl\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/statorials.org\/nl\/wp-json\/wp\/v2\/comments?post=1760"}],"version-history":[{"count":0,"href":"https:\/\/statorials.org\/nl\/wp-json\/wp\/v2\/posts\/1760\/revisions"}],"wp:attachment":[{"href":"https:\/\/statorials.org\/nl\/wp-json\/wp\/v2\/media?parent=1760"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/statorials.org\/nl\/wp-json\/wp\/v2\/categories?post=1760"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/statorials.org\/nl\/wp-json\/wp\/v2\/tags?post=1760"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}