{"id":1569,"date":"2023-07-25T20:22:51","date_gmt":"2023-07-25T20:22:51","guid":{"rendered":"https:\/\/statorials.org\/nl\/logaritmische-regressiepython\/"},"modified":"2023-07-25T20:22:51","modified_gmt":"2023-07-25T20:22:51","slug":"logaritmische-regressiepython","status":"publish","type":"post","link":"https:\/\/statorials.org\/nl\/logaritmische-regressiepython\/","title":{"rendered":"Logaritmische regressie in python (stap voor stap)"},"content":{"rendered":"<p><\/p>\n<hr>\n<p><span style=\"color: #000000;\"><strong>Logaritmische regressie<\/strong> is een soort regressie die wordt gebruikt om situaties te modelleren waarin de groei of achteruitgang eerst snel versnelt en vervolgens in de loop van de tijd vertraagt.<\/span><\/p>\n<p> <span style=\"color: #000000;\">De volgende grafiek toont bijvoorbeeld een voorbeeld van logaritmisch verval:<\/span> <\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter wp-image-14289 \" src=\"https:\/\/statorials.org\/wp-content\/uploads\/2023\/08\/expregexcel2.png\" alt=\"\" width=\"375\" height=\"284\" srcset=\"\" sizes=\"auto, \"><\/p>\n<p> <span style=\"color: #000000;\">Voor dit soort situaties zou de relatie tussen een voorspellende variabele en een<a href=\"https:\/\/statorials.org\/nl\/variabelen-verklarende-reacties\/\" target=\"_blank\" rel=\"noopener\">responsvariabele<\/a> goed kunnen worden gemodelleerd met behulp van logaritmische regressie.<\/span><\/p>\n<p> <span style=\"color: #000000;\">De vergelijking voor een logaritmisch regressiemodel heeft de volgende vorm:<\/span><\/p>\n<p> <span style=\"color: #000000;\"><strong>y = a + b*ln(x)<\/strong><\/span><\/p>\n<p> <span style=\"color: #000000;\">Goud:<\/span><\/p>\n<ul>\n<li> <span style=\"color: #000000;\"><strong>y:<\/strong> de responsvariabele<\/span><\/li>\n<li> <span style=\"color: #000000;\"><strong>x:<\/strong> de voorspellende variabele<\/span><\/li>\n<li> <span style=\"color: #000000;\"><strong>a, b:<\/strong> de regressieco\u00ebffici\u00ebnten die de relatie tussen <em>x<\/em> en <em>y<\/em> beschrijven<\/span><\/li>\n<\/ul>\n<p> <span style=\"color: #000000;\">Het volgende stapsgewijze voorbeeld laat zien hoe u logaritmische regressie in Python uitvoert.<\/span><\/p>\n<h3> <span style=\"color: #000000;\"><strong>Stap 1: Cre\u00eber de gegevens<\/strong><\/span><\/h3>\n<p> <span style=\"color: #000000;\">Laten we eerst valse gegevens maken voor twee variabelen: <em>x<\/em> en <em>y<\/em> :<\/span><\/p>\n<pre style=\"background-color: #ececec; font-size: 15px;\"> <strong><span style=\"color: #008000;\">import<\/span> numpy <span style=\"color: #008000;\">as<\/span> np\nx = np. <span style=\"color: #3366ff;\">arange<\/span> (1, 16, 1)\ny = np. <span style=\"color: #3366ff;\">array<\/span> ([59, 50, 44, 38, 33, 28, 23, 20, 17, 15, 13, 12, 11, 10, 9.5])\n<\/strong><\/pre>\n<h3> <strong>Stap 2: Visualiseer de gegevens<\/strong><\/h3>\n<p> <span style=\"color: #000000;\">Laten we vervolgens een snelle spreidingsdiagram maken om de relatie tussen <em>x<\/em> en <em>y<\/em> 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;\">scatter<\/span> (x,y)\nplt. <span style=\"color: #3366ff;\">show<\/span> ()<\/strong> <\/pre>\n<p><img decoding=\"async\" loading=\"lazy\" class=\" wp-image-15561 aligncenter\" src=\"https:\/\/statorials.org\/wp-content\/uploads\/2023\/08\/logpython1.png\" alt=\"\" width=\"393\" height=\"268\" srcset=\"\" sizes=\"auto, \"><\/p>\n<p> <span style=\"color: #000000;\">Uit de grafiek kunnen we zien dat er een logaritmisch vervalpatroon bestaat tussen de twee variabelen. De waarde van de responsvariabele <em>y<\/em> neemt eerst snel af en vertraagt vervolgens in de loop van de tijd.<\/span><\/p>\n<p> <span style=\"color: #000000;\">Het lijkt daarom verstandig om een logaritmische regressievergelijking toe te passen om de relatie tussen de variabelen te beschrijven.<\/span><\/p>\n<h3> <span style=\"color: #000000;\"><strong>Stap 3: Pas het logaritmische regressiemodel aan<\/strong><\/span><\/h3>\n<p> <span style=\"color: #000000;\">Vervolgens zullen we de functie <strong>polyfit()<\/strong> gebruiken om een logaritmisch regressiemodel te fitten, waarbij we de natuurlijke logaritme van <em>x<\/em> als voorspellende variabele en <em>y<\/em> als responsvariabele gebruiken:<\/span><\/p>\n<pre style=\"background-color: #ececec; font-size: 15px;\"> <strong><span style=\"color: #008080;\">#fit the model<\/span>\nfit = np. <span style=\"color: #3366ff;\">polyfit<\/span> (np. <span style=\"color: #3366ff;\">log<\/span> (x), y, 1)\n<\/strong><strong>\n<span style=\"color: #008080;\">#view the output of the model<\/span>\nprint(fit)\n\n[-20.19869943 63.06859979]\n<\/strong><\/pre>\n<p> <span style=\"color: #000000;\">We kunnen de co\u00ebffici\u00ebnten uit het resultaat gebruiken om de volgende aangepaste logaritmische regressievergelijking te schrijven:<\/span><\/p>\n<p> <span style=\"color: #000000;\"><strong>y = 63,0686 \u2013 20,1987 * ln(x)<\/strong><\/span><\/p>\n<p> <span style=\"color: #000000;\">We kunnen deze vergelijking gebruiken om de responsvariabele, <em>y<\/em> , te voorspellen op basis van de waarde van de voorspellende variabele, <em>x<\/em> . Als <em>x<\/em> = 12, dan voorspellen we bijvoorbeeld dat <em>y<\/em> <strong>12,87<\/strong> zou zijn:<\/span><\/p>\n<p> <span style=\"color: #000000;\">y = 63,0686 \u2013 20,1987 * ln(12) = <strong>12,87<\/strong><\/span><\/p>\n<p> <span style=\"color: #000000;\"><strong>Bonus:<\/strong> voel je vrij om deze online logaritmische regressiecalculator te gebruiken om automatisch de logaritmische regressievergelijking voor een bepaalde voorspeller en responsvariabele te berekenen.<\/span><\/p>\n<h3> <span style=\"color: #000000;\"><strong>Aanvullende bronnen<\/strong><\/span><\/h3>\n<p> <a href=\"https:\/\/statorials.org\/nl\/lineaire-regressiepython\/\" target=\"_blank\" rel=\"noopener\">Een complete gids voor lineaire regressie in Python<\/a><br \/> <a href=\"https:\/\/statorials.org\/nl\/exponentiele-regressiepython\/\" target=\"_blank\" rel=\"noopener\">Exponenti\u00eble regressie uitvoeren in Python<\/a><br \/> <a href=\"https:\/\/statorials.org\/nl\/logistische-regressiepython\/\" target=\"_blank\" rel=\"noopener\">Hoe logistieke regressie uit te voeren in Python<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Logaritmische regressie is een soort regressie die wordt gebruikt om situaties te modelleren waarin de groei of achteruitgang eerst snel versnelt en vervolgens in de loop van de tijd vertraagt. De volgende grafiek toont bijvoorbeeld een voorbeeld van logaritmisch verval: Voor dit soort situaties zou de relatie tussen een voorspellende variabele en eenresponsvariabele goed kunnen [&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-1569","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>Logaritmische regressie in Python (stap voor stap) - Statorials<\/title>\n<meta name=\"description\" content=\"In deze tutorial wordt uitgelegd hoe u logaritmische regressie 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\/logaritmische-regressiepython\/\" \/>\n<meta property=\"og:locale\" content=\"de_DE\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Logaritmische regressie in Python (stap voor stap) - Statorials\" \/>\n<meta property=\"og:description\" content=\"In deze tutorial wordt uitgelegd hoe u logaritmische regressie in Python uitvoert, inclusief een stapsgewijs voorbeeld.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/statorials.org\/nl\/logaritmische-regressiepython\/\" \/>\n<meta property=\"og:site_name\" content=\"Statorials\" \/>\n<meta property=\"article:published_time\" content=\"2023-07-25T20:22:51+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/statorials.org\/wp-content\/uploads\/2023\/08\/expregexcel2.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\/logaritmische-regressiepython\/\",\"url\":\"https:\/\/statorials.org\/nl\/logaritmische-regressiepython\/\",\"name\":\"Logaritmische regressie in Python (stap voor stap) - Statorials\",\"isPartOf\":{\"@id\":\"https:\/\/statorials.org\/nl\/#website\"},\"datePublished\":\"2023-07-25T20:22:51+00:00\",\"dateModified\":\"2023-07-25T20:22:51+00:00\",\"author\":{\"@id\":\"https:\/\/statorials.org\/nl\/#\/schema\/person\/d4b8842173cca1bb62cdec41860e4219\"},\"description\":\"In deze tutorial wordt uitgelegd hoe u logaritmische regressie in Python uitvoert, inclusief een stapsgewijs voorbeeld.\",\"breadcrumb\":{\"@id\":\"https:\/\/statorials.org\/nl\/logaritmische-regressiepython\/#breadcrumb\"},\"inLanguage\":\"de\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/statorials.org\/nl\/logaritmische-regressiepython\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/statorials.org\/nl\/logaritmische-regressiepython\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Thuis\",\"item\":\"https:\/\/statorials.org\/nl\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Logaritmische regressie in python (stap voor stap)\"}]},{\"@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":"Logaritmische regressie in Python (stap voor stap) - Statorials","description":"In deze tutorial wordt uitgelegd hoe u logaritmische regressie 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\/logaritmische-regressiepython\/","og_locale":"de_DE","og_type":"article","og_title":"Logaritmische regressie in Python (stap voor stap) - Statorials","og_description":"In deze tutorial wordt uitgelegd hoe u logaritmische regressie in Python uitvoert, inclusief een stapsgewijs voorbeeld.","og_url":"https:\/\/statorials.org\/nl\/logaritmische-regressiepython\/","og_site_name":"Statorials","article_published_time":"2023-07-25T20:22:51+00:00","og_image":[{"url":"https:\/\/statorials.org\/wp-content\/uploads\/2023\/08\/expregexcel2.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\/logaritmische-regressiepython\/","url":"https:\/\/statorials.org\/nl\/logaritmische-regressiepython\/","name":"Logaritmische regressie in Python (stap voor stap) - Statorials","isPartOf":{"@id":"https:\/\/statorials.org\/nl\/#website"},"datePublished":"2023-07-25T20:22:51+00:00","dateModified":"2023-07-25T20:22:51+00:00","author":{"@id":"https:\/\/statorials.org\/nl\/#\/schema\/person\/d4b8842173cca1bb62cdec41860e4219"},"description":"In deze tutorial wordt uitgelegd hoe u logaritmische regressie in Python uitvoert, inclusief een stapsgewijs voorbeeld.","breadcrumb":{"@id":"https:\/\/statorials.org\/nl\/logaritmische-regressiepython\/#breadcrumb"},"inLanguage":"de","potentialAction":[{"@type":"ReadAction","target":["https:\/\/statorials.org\/nl\/logaritmische-regressiepython\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/statorials.org\/nl\/logaritmische-regressiepython\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Thuis","item":"https:\/\/statorials.org\/nl\/"},{"@type":"ListItem","position":2,"name":"Logaritmische regressie in python (stap voor stap)"}]},{"@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\/1569","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=1569"}],"version-history":[{"count":0,"href":"https:\/\/statorials.org\/nl\/wp-json\/wp\/v2\/posts\/1569\/revisions"}],"wp:attachment":[{"href":"https:\/\/statorials.org\/nl\/wp-json\/wp\/v2\/media?parent=1569"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/statorials.org\/nl\/wp-json\/wp\/v2\/categories?post=1569"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/statorials.org\/nl\/wp-json\/wp\/v2\/tags?post=1569"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}