{"id":1112,"date":"2023-07-27T15:08:14","date_gmt":"2023-07-27T15:08:14","guid":{"rendered":"https:\/\/statorials.org\/de\/autokorrelation-in-r\/"},"modified":"2023-07-27T15:08:14","modified_gmt":"2023-07-27T15:08:14","slug":"autokorrelation-in-r","status":"publish","type":"post","link":"https:\/\/statorials.org\/de\/autokorrelation-in-r\/","title":{"rendered":"So berechnen sie die autokorrelation in r"},"content":{"rendered":"<p><\/p>\n<hr>\n<p><span style=\"color: #000000;\"><strong>Die Autokorrelation<\/strong> misst den Grad der \u00c4hnlichkeit zwischen einer Zeitreihe und einer verz\u00f6gerten Version ihrer selbst \u00fcber aufeinanderfolgende Zeitintervalle.<\/span><\/p>\n<p> <span style=\"color: #000000;\">Sie wird manchmal auch als \u201eserielle Korrelation\u201c oder \u201everz\u00f6gerte Korrelation\u201c bezeichnet, da sie die Beziehung zwischen den aktuellen Werten einer Variablen und ihren historischen Werten misst.<\/span><\/p>\n<p> <span style=\"color: #000000;\">Wenn die Autokorrelation in einer Zeitreihe hoch ist, ist es einfach, zuk\u00fcnftige Werte vorherzusagen, indem einfach auf vergangene Werte verwiesen wird.<\/span><\/p>\n<h3> <strong>So berechnen Sie die Autokorrelation in R<\/strong><\/h3>\n<p> <span style=\"color: #000000;\">Angenommen, wir haben die folgende Zeitreihe in R, die den Wert einer bestimmten Variablen f\u00fcr 15 verschiedene Zeitr\u00e4ume zeigt:<\/span><\/p>\n<pre style=\"background-color: #ececec; font-size: 15px;\"> <strong><span style=\"color: #008080;\">#define data<\/span>\nx &lt;- c(22, 24, 25, 25, 28, 29, 34, 37, 40, 44, 51, 48, 47, 50, 51)\n<\/strong><\/pre>\n<p> <span style=\"color: #000000;\">Wir k\u00f6nnen die Autokorrelation f\u00fcr jede Verz\u00f6gerung in der Zeitreihe mithilfe der Funktion <strong>acf()<\/strong> aus der <strong>tseries-<\/strong> Bibliothek berechnen:<\/span><\/p>\n<pre style=\"background-color: #ececec; font-size: 15px;\"> <strong><span style=\"color: #000000;\"><span style=\"color: #107d3f;\"><span style=\"color: #993300;\">library<\/span> <span style=\"color: #000000;\">(tseries)<\/span>\n<\/span><\/span>\n<span style=\"color: #008080;\">#calculate autocorrelations<\/span>\nacf(x, pl= <span style=\"color: #008000;\">FALSE<\/span> )\n\n     0 1 2 3 4 5 6 7 8 9 10 \n 1.000 0.832 0.656 0.491 0.279 0.031 -0.165 -0.304 -0.401 -0.458 -0.450 \n    11 \n-0.369 \n<\/strong><\/pre>\n<p> <span style=\"color: #000000;\">Das Ergebnis l\u00e4sst sich wie folgt interpretieren:<\/span><\/p>\n<ul>\n<li> <span style=\"color: #000000;\">Die Autokorrelation bei Verz\u00f6gerung 0 ist <strong>1<\/strong> .<\/span><\/li>\n<li> <span style=\"color: #000000;\">Die Autokorrelation bei Verz\u00f6gerung 1 betr\u00e4gt <strong>0,832<\/strong> .<\/span><\/li>\n<li> <span style=\"color: #000000;\">Die Autokorrelation bei Verz\u00f6gerung 2 betr\u00e4gt <strong>0,656<\/strong> .<\/span><\/li>\n<li> <span style=\"color: #000000;\">Die Autokorrelation bei Verz\u00f6gerung 3 betr\u00e4gt <strong>0,491<\/strong> .<\/span><\/li>\n<\/ul>\n<p> <span style=\"color: #000000;\">Und so weiter.<\/span><\/p>\n<p> <span style=\"color: #000000;\">Mit dem Argument <strong>lag<\/strong> k\u00f6nnen wir auch die Anzahl der anzuzeigenden Verz\u00f6gerungen angeben:<\/span><\/p>\n<pre style=\"background-color: #ececec; font-size: 15px;\"> <strong><span style=\"color: #008080;\">#calculate autocorrelations up to lag=5<\/span>\nacf(x, lag=5, pl= <span style=\"color: #008000;\">FALSE<\/span> )\n\nAutocorrelations of series 'x', by lag\n\n    0 1 2 3 4 5 \n1.000 0.832 0.656 0.491 0.279 0.031<\/strong><\/pre>\n<h3> <strong>So zeichnen Sie die Autokorrelationsfunktion in R auf<\/strong><\/h3>\n<p> <span style=\"color: #000000;\">Wir k\u00f6nnen die Autokorrelationsfunktion f\u00fcr eine Zeitreihe in R darstellen, indem wir einfach das Argument <strong>pl=FALSE<\/strong> nicht verwenden:<\/span> <\/p>\n<pre style=\"background-color: #ececec; font-size: 15px;\"> <strong><span style=\"color: #008080;\">#plot autocorrelation function\n<\/span>acf(x)\n<\/strong><\/pre>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter wp-image-11307 \" src=\"https:\/\/statorials.org\/wp-content\/uploads\/2023\/08\/autocorrelationr1.png\" alt=\"Autokorrelation in R\" width=\"428\" height=\"435\" srcset=\"\" sizes=\"\"><\/p>\n<p> <span style=\"color: #000000;\">Die x-Achse zeigt die Anzahl der Verz\u00f6gerungen und die y-Achse zeigt die Autokorrelation bei dieser Anzahl von Verz\u00f6gerungen an. Standardm\u00e4\u00dfig beginnt die Darstellung bei Lag = 0 und die Autokorrelation ist bei Lag = 0 immer <strong>1<\/strong> .<\/span><\/p>\n<p> <span style=\"color: #000000;\">Sie k\u00f6nnen auch einen anderen Titel f\u00fcr die Handlung angeben, indem Sie das <strong>Hauptargument<\/strong> verwenden:<\/span> <\/p>\n<pre style=\"background-color: #ececec; font-size: 15px;\"> <strong><span style=\"color: #008080;\">#plot autocorrelation function with custom title\n<\/span>acf(x, main=' <span style=\"color: #008000;\">Autocorrelation by Lag<\/span> ')<\/strong> <\/pre>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter wp-image-11309 \" src=\"https:\/\/statorials.org\/wp-content\/uploads\/2023\/08\/autocorrelationr2.png\" alt=\"Autokorrelationsdiagramm in R\" width=\"437\" height=\"430\" srcset=\"\" sizes=\"\"><\/p>\n<h3> <span style=\"color: #000000;\"><strong>Zus\u00e4tzliche Ressourcen<\/strong><\/span><\/h3>\n<p> <a href=\"https:\/\/statorials.org\/de\/autokorrelations-python\/\" target=\"_blank\" rel=\"noopener noreferrer\">So berechnen Sie die Autokorrelation in Python<\/a><br \/> <a href=\"https:\/\/statorials.org\/de\/excel-autokorrelation\/\" target=\"_blank\" rel=\"noopener noreferrer\">So berechnen Sie die Autokorrelation in Excel<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Die Autokorrelation misst den Grad der \u00c4hnlichkeit zwischen einer Zeitreihe und einer verz\u00f6gerten Version ihrer selbst \u00fcber aufeinanderfolgende Zeitintervalle. Sie wird manchmal auch als \u201eserielle Korrelation\u201c oder \u201everz\u00f6gerte Korrelation\u201c bezeichnet, da sie die Beziehung zwischen den aktuellen Werten einer Variablen und ihren historischen Werten misst. Wenn die Autokorrelation in einer Zeitreihe hoch ist, ist es [&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":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v21.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>So berechnen Sie die Autokorrelation in der R-Statorials<\/title>\n<meta name=\"description\" content=\"In diesem Tutorial wird anhand eines Beispiels erl\u00e4utert, wie die Autokorrelation in R berechnet wird.\" \/>\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\/de\/autokorrelation-in-r\/\" \/>\n<meta property=\"og:locale\" content=\"de_DE\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"So berechnen Sie die Autokorrelation in der R-Statorials\" \/>\n<meta property=\"og:description\" content=\"In diesem Tutorial wird anhand eines Beispiels erl\u00e4utert, wie die Autokorrelation in R berechnet wird.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/statorials.org\/de\/autokorrelation-in-r\/\" \/>\n<meta property=\"og:site_name\" content=\"Statorials\" \/>\n<meta property=\"article:published_time\" content=\"2023-07-27T15:08:14+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/statorials.org\/wp-content\/uploads\/2023\/08\/autocorrelationr1.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 Minuten\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/statorials.org\/de\/autokorrelation-in-r\/\",\"url\":\"https:\/\/statorials.org\/de\/autokorrelation-in-r\/\",\"name\":\"So berechnen Sie die Autokorrelation in der R-Statorials\",\"isPartOf\":{\"@id\":\"https:\/\/statorials.org\/de\/#website\"},\"datePublished\":\"2023-07-27T15:08:14+00:00\",\"dateModified\":\"2023-07-27T15:08:14+00:00\",\"author\":{\"@id\":\"https:\/\/statorials.org\/de\/#\/schema\/person\/ec75c4d6365f2708f8a0ad3a42121aa0\"},\"description\":\"In diesem Tutorial wird anhand eines Beispiels erl\u00e4utert, wie die Autokorrelation in R berechnet wird.\",\"breadcrumb\":{\"@id\":\"https:\/\/statorials.org\/de\/autokorrelation-in-r\/#breadcrumb\"},\"inLanguage\":\"de-DE\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/statorials.org\/de\/autokorrelation-in-r\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/statorials.org\/de\/autokorrelation-in-r\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Heim\",\"item\":\"https:\/\/statorials.org\/de\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"So berechnen sie die autokorrelation in r\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/statorials.org\/de\/#website\",\"url\":\"https:\/\/statorials.org\/de\/\",\"name\":\"Statorials\",\"description\":\"Ihr Leitfaden f\u00fcr statistische Kompetenz !\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/statorials.org\/de\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"de-DE\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/statorials.org\/de\/#\/schema\/person\/ec75c4d6365f2708f8a0ad3a42121aa0\",\"name\":\"Dr. Benjamin Anderson\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"de-DE\",\"@id\":\"https:\/\/statorials.org\/de\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/statorials.org\/de\/wp-content\/uploads\/2023\/11\/Benjamin-Anderson-96x96.jpg\",\"contentUrl\":\"https:\/\/statorials.org\/de\/wp-content\/uploads\/2023\/11\/Benjamin-Anderson-96x96.jpg\",\"caption\":\"Dr. Benjamin Anderson\"},\"description\":\"Hallo, ich bin Benjamin, ein pensionierter Statistikprofessor, der sich zum engagierten Statorials-Lehrer entwickelt hat. Mit umfassender Erfahrung und Fachwissen auf dem Gebiet der Statistik bin ich bestrebt, mein Wissen zu teilen, um Studenten durch Statorials zu bef\u00e4higen. Mehr wissen\",\"sameAs\":[\"https:\/\/statorials.org\/de\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"So berechnen Sie die Autokorrelation in der R-Statorials","description":"In diesem Tutorial wird anhand eines Beispiels erl\u00e4utert, wie die Autokorrelation in R berechnet wird.","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\/de\/autokorrelation-in-r\/","og_locale":"de_DE","og_type":"article","og_title":"So berechnen Sie die Autokorrelation in der R-Statorials","og_description":"In diesem Tutorial wird anhand eines Beispiels erl\u00e4utert, wie die Autokorrelation in R berechnet wird.","og_url":"https:\/\/statorials.org\/de\/autokorrelation-in-r\/","og_site_name":"Statorials","article_published_time":"2023-07-27T15:08:14+00:00","og_image":[{"url":"https:\/\/statorials.org\/wp-content\/uploads\/2023\/08\/autocorrelationr1.png"}],"author":"Dr. Benjamin Anderson","twitter_card":"summary_large_image","twitter_misc":{"Verfasst von":"Dr. Benjamin Anderson","Gesch\u00e4tzte Lesezeit":"2 Minuten"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/statorials.org\/de\/autokorrelation-in-r\/","url":"https:\/\/statorials.org\/de\/autokorrelation-in-r\/","name":"So berechnen Sie die Autokorrelation in der R-Statorials","isPartOf":{"@id":"https:\/\/statorials.org\/de\/#website"},"datePublished":"2023-07-27T15:08:14+00:00","dateModified":"2023-07-27T15:08:14+00:00","author":{"@id":"https:\/\/statorials.org\/de\/#\/schema\/person\/ec75c4d6365f2708f8a0ad3a42121aa0"},"description":"In diesem Tutorial wird anhand eines Beispiels erl\u00e4utert, wie die Autokorrelation in R berechnet wird.","breadcrumb":{"@id":"https:\/\/statorials.org\/de\/autokorrelation-in-r\/#breadcrumb"},"inLanguage":"de-DE","potentialAction":[{"@type":"ReadAction","target":["https:\/\/statorials.org\/de\/autokorrelation-in-r\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/statorials.org\/de\/autokorrelation-in-r\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Heim","item":"https:\/\/statorials.org\/de\/"},{"@type":"ListItem","position":2,"name":"So berechnen sie die autokorrelation in r"}]},{"@type":"WebSite","@id":"https:\/\/statorials.org\/de\/#website","url":"https:\/\/statorials.org\/de\/","name":"Statorials","description":"Ihr Leitfaden f\u00fcr statistische Kompetenz !","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/statorials.org\/de\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"de-DE"},{"@type":"Person","@id":"https:\/\/statorials.org\/de\/#\/schema\/person\/ec75c4d6365f2708f8a0ad3a42121aa0","name":"Dr. Benjamin Anderson","image":{"@type":"ImageObject","inLanguage":"de-DE","@id":"https:\/\/statorials.org\/de\/#\/schema\/person\/image\/","url":"https:\/\/statorials.org\/de\/wp-content\/uploads\/2023\/11\/Benjamin-Anderson-96x96.jpg","contentUrl":"https:\/\/statorials.org\/de\/wp-content\/uploads\/2023\/11\/Benjamin-Anderson-96x96.jpg","caption":"Dr. Benjamin Anderson"},"description":"Hallo, ich bin Benjamin, ein pensionierter Statistikprofessor, der sich zum engagierten Statorials-Lehrer entwickelt hat. Mit umfassender Erfahrung und Fachwissen auf dem Gebiet der Statistik bin ich bestrebt, mein Wissen zu teilen, um Studenten durch Statorials zu bef\u00e4higen. Mehr wissen","sameAs":["https:\/\/statorials.org\/de"]}]}},"yoast_meta":{"yoast_wpseo_title":"","yoast_wpseo_metadesc":"","yoast_wpseo_canonical":""},"_links":{"self":[{"href":"https:\/\/statorials.org\/de\/wp-json\/wp\/v2\/posts\/1112"}],"collection":[{"href":"https:\/\/statorials.org\/de\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/statorials.org\/de\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/statorials.org\/de\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/statorials.org\/de\/wp-json\/wp\/v2\/comments?post=1112"}],"version-history":[{"count":0,"href":"https:\/\/statorials.org\/de\/wp-json\/wp\/v2\/posts\/1112\/revisions"}],"wp:attachment":[{"href":"https:\/\/statorials.org\/de\/wp-json\/wp\/v2\/media?parent=1112"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/statorials.org\/de\/wp-json\/wp\/v2\/categories?post=1112"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/statorials.org\/de\/wp-json\/wp\/v2\/tags?post=1112"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}