{"id":3195,"date":"2023-07-18T18:01:40","date_gmt":"2023-07-18T18:01:40","guid":{"rendered":"https:\/\/statorials.org\/de\/bootstrap-in-python\/"},"modified":"2023-07-18T18:01:40","modified_gmt":"2023-07-18T18:01:40","slug":"bootstrap-in-python","status":"publish","type":"post","link":"https:\/\/statorials.org\/de\/bootstrap-in-python\/","title":{"rendered":"So f\u00fchren sie bootstrapping in python durch (mit beispiel)"},"content":{"rendered":"<p><\/p>\n<hr>\n<p><span style=\"color: #000000;\"><strong>Bootstrapping<\/strong> ist eine Methode, mit der ein Konfidenzintervall f\u00fcr eine <a href=\"https:\/\/statorials.org\/de\/statistik-vs.-parameter\/\" target=\"_blank\" rel=\"noopener\">Statistik<\/a> erstellt werden kann, wenn die Stichprobengr\u00f6\u00dfe klein und die zugrunde liegende Verteilung unbekannt ist.<\/span><\/p>\n<p> <span style=\"color: #000000;\">Der grundlegende Prozess f\u00fcr das Bootstrapping ist wie folgt:<\/span><\/p>\n<ul>\n<li> <span style=\"color: #000000;\">Nehmen Sie <em>k<\/em> Replikatproben mit Ersetzung aus einem bestimmten Datensatz.<\/span><\/li>\n<li> <span style=\"color: #000000;\">Berechnen Sie f\u00fcr jede Stichprobe die interessierende Statistik.<\/span><\/li>\n<li> <span style=\"color: #000000;\">Dies ergibt <em>k<\/em> verschiedene Sch\u00e4tzungen f\u00fcr eine bestimmte Statistik, die Sie dann zur Berechnung eines Konfidenzintervalls f\u00fcr die Statistik verwenden k\u00f6nnen.<\/span><\/li>\n<\/ul>\n<p> <span style=\"color: #000000;\">Der einfachste Weg zum Bootstrap in Python ist die Verwendung der <a href=\"https:\/\/docs.scipy.org\/doc\/scipy\/reference\/generated\/scipy.stats.bootstrap.html\" target=\"_blank\" rel=\"noopener\">Bootstrap-<\/a> Funktion aus der <strong>SciPy-<\/strong> Bibliothek.<\/span><\/p>\n<p> <span style=\"color: #000000;\">Das folgende Beispiel zeigt, wie Sie diese Funktion in der Praxis nutzen k\u00f6nnen.<\/span><\/p>\n<h3> <span style=\"color: #000000;\"><strong>Beispiel: Bootstrapping in Python durchf\u00fchren<\/strong><\/span><\/h3>\n<p> <span style=\"color: #000000;\">Angenommen, wir erstellen in Python einen Datensatz mit 15 Werten:<\/span><\/p>\n<pre style=\"background-color: #ececec; font-size: 15px;\"> <span style=\"color: #008080;\"><strong>#define array of data values\n<span style=\"color: #000000;\">data = [7, 9, 10, 10, 12, 14, 15, 16, 16, 17, 19, 20, 21, 21, 23]<\/span><\/strong><\/span><\/pre>\n<p> <span style=\"color: #000000;\">Mit dem folgenden Code k\u00f6nnen wir ein 95-prozentiges Bootstrap-Konfidenzintervall f\u00fcr den Medianwert berechnen:<\/span><\/p>\n<pre style=\"background-color: #ececec; font-size: 15px;\"> <span style=\"color: #008080;\"><strong><span style=\"color: #000000;\"><span style=\"color: #008000;\">from<\/span> scipy. <span style=\"color: #3366ff;\">stats<\/span> <span style=\"color: #008000;\">import<\/span> bootstrap\n<span style=\"color: #008000;\">import<\/span> numpy <span style=\"color: #008000;\">as<\/span> np\n\n<span style=\"color: #008080;\">#convert array to sequence\n<\/span>data = (data,)\n\n<span style=\"color: #008080;\">#calculate 95% bootstrapped confidence interval for median\n<\/span>bootstrap_ci = bootstrap(data, np. <span style=\"color: #3366ff;\">median<\/span> , confidence_level= <span style=\"color: #008000;\">0.95<\/span> ,\n                         random_state= <span style=\"color: #008000;\">1<\/span> , method=' <span style=\"color: #ff0000;\">percentile<\/span> ')\n\n<span style=\"color: #008080;\">#view 95% boostrapped confidence interval\n<\/span><span style=\"color: #008000;\">print<\/span> ( <span style=\"color: #3366ff;\">bootstrap_ci.confidence_interval<\/span> )\n\nConfidenceInterval(low=10.0, high=20.0)\n<\/span><\/strong><\/span><\/pre>\n<p> <span style=\"color: #000000;\">Das 95 %-Bootstrap-Konfidenzintervall f\u00fcr den Median betr\u00e4gt <strong>[10,0, 20,0]<\/strong> .<\/span><\/p>\n<p> <span style=\"color: #000000;\">Folgendes hat die <strong>boostrap()<\/strong> -Funktion tats\u00e4chlich unter der Haube getan:<\/span><\/p>\n<ul>\n<li> <span style=\"color: #000000;\">Die <strong>Bootstrap()-<\/strong> Funktion generierte 9.999 Samples mit Ersetzung. (Der Standardwert ist 9999, Sie k\u00f6nnen diese Zahl jedoch mit dem Argument <strong>n_resamples<\/strong> \u00e4ndern.)<\/span><\/li>\n<li> <span style=\"color: #000000;\">F\u00fcr jede Bootstrap-Stichprobe wurde der Median berechnet.<\/span><\/li>\n<li> <span style=\"color: #000000;\">Der Medianwert jeder Stichprobe wurde vom kleinsten zum gr\u00f6\u00dften geordnet und der Medianwert beim 2,5 %-Perzentil und beim 97,5 %-Perzentil wurde verwendet, um die Unter- und Obergrenze des 95 %-Konfidenzintervalls zu ermitteln. %.<\/span><\/li>\n<\/ul>\n<p> <span style=\"color: #000000;\">Beachten Sie, dass Sie f\u00fcr praktisch jede Statistik ein Bootstrap-Konfidenzintervall berechnen k\u00f6nnen.<\/span><\/p>\n<p> <span style=\"color: #000000;\">Beispielsweise k\u00f6nnen wir in der <strong>Bootstrap()<\/strong> -Funktion <strong>np.median<\/strong> durch <strong>np.std<\/strong> ersetzen, um stattdessen ein 95 %-Konfidenzintervall f\u00fcr die Standardabweichung zu berechnen:<\/span><\/p>\n<pre style=\"background-color: #ececec; font-size: 15px;\"> <span style=\"color: #008080;\"><strong><span style=\"color: #000000;\"><span style=\"color: #008000;\">from<\/span> scipy. <span style=\"color: #3366ff;\">stats<\/span> <span style=\"color: #008000;\">import<\/span> bootstrap\n<span style=\"color: #008000;\">import<\/span> numpy <span style=\"color: #008000;\">as<\/span> np\n\n<span style=\"color: #008080;\">#convert array to sequence\n<\/span>data = (data,)\n\n<span style=\"color: #008080;\">#calculate 95% bootstrapped confidence interval for median\n<\/span>bootstrap_ci = bootstrap(data, np. <span style=\"color: #3366ff;\">std<\/span> , confidence_level= <span style=\"color: #008000;\">0.95<\/span> ,\n                         random_state= <span style=\"color: #008000;\">1<\/span> , method=' <span style=\"color: #ff0000;\">percentile<\/span> ')\n\n<span style=\"color: #008080;\">#view 95% boostrapped confidence interval\n<\/span><span style=\"color: #008000;\">print<\/span> ( <span style=\"color: #3366ff;\">bootstrap_ci.confidence_interval<\/span> )\n\nConfidenceInterval(low=3.3199732261303283, high=5.66478399066117)\n<\/span><\/strong><\/span><\/pre>\n<p> <span style=\"color: #000000;\">Das 95 %-Bootstrap-Konfidenzintervall f\u00fcr die Standardabweichung betr\u00e4gt <strong>[3,32, 5,67]<\/strong> .<\/span><\/p>\n<p> <span style=\"color: #000000;\"><strong>Hinweis<\/strong> : F\u00fcr diese Beispiele w\u00e4hlen wir die Erstellung von 95 %-Konfidenzintervallen, aber Sie k\u00f6nnen den Wert des Arguments <strong>\u201etrust_level\u201c<\/strong> \u00e4ndern, um ein Konfidenzintervall mit einer anderen Gr\u00f6\u00dfe zu erstellen.<\/span><\/p>\n<h3> <span style=\"color: #000000;\"><strong>Zus\u00e4tzliche Ressourcen<\/strong><\/span><\/h3>\n<p> <span style=\"color: #000000;\">Die folgenden Tutorials erkl\u00e4ren, wie man in anderer Statistiksoftware einen Bootstrap durchf\u00fchrt:<\/span><\/p>\n<p> <a href=\"https:\/\/statorials.org\/de\/bootstrap-in-r\/\" target=\"_blank\" rel=\"noopener\">So booten Sie in R<\/a><br \/> <a href=\"https:\/\/statorials.org\/de\/beginnen-sie-mit-excel\/\" target=\"_blank\" rel=\"noopener\">So f\u00fchren Sie einen Bootstrap in Excel durch<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Bootstrapping ist eine Methode, mit der ein Konfidenzintervall f\u00fcr eine Statistik erstellt werden kann, wenn die Stichprobengr\u00f6\u00dfe klein und die zugrunde liegende Verteilung unbekannt ist. Der grundlegende Prozess f\u00fcr das Bootstrapping ist wie folgt: Nehmen Sie k Replikatproben mit Ersetzung aus einem bestimmten Datensatz. Berechnen Sie f\u00fcr jede Stichprobe die interessierende Statistik. Dies ergibt k [&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 f\u00fchren Sie Bootstrapping in Python durch (mit Beispiel) \u2013 Statorials<\/title>\n<meta name=\"description\" content=\"In diesem Tutorial wird anhand mehrerer Beispiele erl\u00e4utert, wie das Bootstrapping in Python durchgef\u00fchrt 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\/bootstrap-in-python\/\" \/>\n<meta property=\"og:locale\" content=\"de_DE\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"So f\u00fchren Sie Bootstrapping in Python durch (mit Beispiel) \u2013 Statorials\" \/>\n<meta property=\"og:description\" content=\"In diesem Tutorial wird anhand mehrerer Beispiele erl\u00e4utert, wie das Bootstrapping in Python durchgef\u00fchrt wird.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/statorials.org\/de\/bootstrap-in-python\/\" \/>\n<meta property=\"og:site_name\" content=\"Statorials\" \/>\n<meta property=\"article:published_time\" content=\"2023-07-18T18:01:40+00:00\" \/>\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\/bootstrap-in-python\/\",\"url\":\"https:\/\/statorials.org\/de\/bootstrap-in-python\/\",\"name\":\"So f\u00fchren Sie Bootstrapping in Python durch (mit Beispiel) \u2013 Statorials\",\"isPartOf\":{\"@id\":\"https:\/\/statorials.org\/de\/#website\"},\"datePublished\":\"2023-07-18T18:01:40+00:00\",\"dateModified\":\"2023-07-18T18:01:40+00:00\",\"author\":{\"@id\":\"https:\/\/statorials.org\/de\/#\/schema\/person\/ec75c4d6365f2708f8a0ad3a42121aa0\"},\"description\":\"In diesem Tutorial wird anhand mehrerer Beispiele erl\u00e4utert, wie das Bootstrapping in Python durchgef\u00fchrt wird.\",\"breadcrumb\":{\"@id\":\"https:\/\/statorials.org\/de\/bootstrap-in-python\/#breadcrumb\"},\"inLanguage\":\"de-DE\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/statorials.org\/de\/bootstrap-in-python\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/statorials.org\/de\/bootstrap-in-python\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Heim\",\"item\":\"https:\/\/statorials.org\/de\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"So f\u00fchren sie bootstrapping in python durch (mit beispiel)\"}]},{\"@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 f\u00fchren Sie Bootstrapping in Python durch (mit Beispiel) \u2013 Statorials","description":"In diesem Tutorial wird anhand mehrerer Beispiele erl\u00e4utert, wie das Bootstrapping in Python durchgef\u00fchrt 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\/bootstrap-in-python\/","og_locale":"de_DE","og_type":"article","og_title":"So f\u00fchren Sie Bootstrapping in Python durch (mit Beispiel) \u2013 Statorials","og_description":"In diesem Tutorial wird anhand mehrerer Beispiele erl\u00e4utert, wie das Bootstrapping in Python durchgef\u00fchrt wird.","og_url":"https:\/\/statorials.org\/de\/bootstrap-in-python\/","og_site_name":"Statorials","article_published_time":"2023-07-18T18:01:40+00:00","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\/bootstrap-in-python\/","url":"https:\/\/statorials.org\/de\/bootstrap-in-python\/","name":"So f\u00fchren Sie Bootstrapping in Python durch (mit Beispiel) \u2013 Statorials","isPartOf":{"@id":"https:\/\/statorials.org\/de\/#website"},"datePublished":"2023-07-18T18:01:40+00:00","dateModified":"2023-07-18T18:01:40+00:00","author":{"@id":"https:\/\/statorials.org\/de\/#\/schema\/person\/ec75c4d6365f2708f8a0ad3a42121aa0"},"description":"In diesem Tutorial wird anhand mehrerer Beispiele erl\u00e4utert, wie das Bootstrapping in Python durchgef\u00fchrt wird.","breadcrumb":{"@id":"https:\/\/statorials.org\/de\/bootstrap-in-python\/#breadcrumb"},"inLanguage":"de-DE","potentialAction":[{"@type":"ReadAction","target":["https:\/\/statorials.org\/de\/bootstrap-in-python\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/statorials.org\/de\/bootstrap-in-python\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Heim","item":"https:\/\/statorials.org\/de\/"},{"@type":"ListItem","position":2,"name":"So f\u00fchren sie bootstrapping in python durch (mit beispiel)"}]},{"@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\/3195"}],"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=3195"}],"version-history":[{"count":0,"href":"https:\/\/statorials.org\/de\/wp-json\/wp\/v2\/posts\/3195\/revisions"}],"wp:attachment":[{"href":"https:\/\/statorials.org\/de\/wp-json\/wp\/v2\/media?parent=3195"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/statorials.org\/de\/wp-json\/wp\/v2\/categories?post=3195"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/statorials.org\/de\/wp-json\/wp\/v2\/tags?post=3195"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}