{"id":134079,"date":"2022-04-18T11:29:00","date_gmt":"2022-04-18T15:29:00","guid":{"rendered":"https:\/\/ibkrcampus.com\/?p=134079"},"modified":"2024-05-17T14:24:04","modified_gmt":"2024-05-17T18:24:04","slug":"linear-regression-assumptions-and-limitations-part-i","status":"publish","type":"post","link":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/linear-regression-assumptions-and-limitations-part-i\/","title":{"rendered":"Linear Regression: Assumptions and Limitations &#8211; Part I"},"content":{"rendered":"\n<p>In this blog, we take a critical look at the assumptions of a linear regression model, how to detect and fix them, and how much water they hold in the real world. We will check some of these assumptions and tests in Python, which will provide a blueprint for other cases using well-known libraries. We will also examine its shortcomings and how its assumptions limit its use.<\/p>\n\n\n\n<p>In the&nbsp;<a href=\"https:\/\/blog.quantinsti.com\/linear-regression\/\">first blog<\/a>&nbsp;of this series, we deconstructed the linear regression model, its various aliases and types. In the second&nbsp;<a href=\"https:\/\/blog.quantinsti.com\/linear-regression-market-data-python-r\/\">installment<\/a>, we looked at the application of linear regression on market data in Python and R.<\/p>\n\n\n\n<p>Our coverage proceeds on the following lines:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>What is linear regression? A brief recap<\/li><li>Assumptions of linear regression<ul><li>Linear relationship<\/li><li>No Multicollinearity<\/li><li>Gaussian distribution of the error terms<\/li><li>No Autocorrelation of the error terms<\/li><li>Homoskedasticity of the error terms<\/li><li>Zero conditional mean of the error terms<\/li><\/ul><\/li><li>Limitations of linear regression<ul><li>Simplistic in some cases<\/li><li>Sensitivity to outliers<\/li><li>Prone to underfitting<\/li><li>Overfitting of complex models<\/li><\/ul><\/li><li>References<\/li><\/ul>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"what-is-linear-regression-a-brief-recap\">What is Linear Regression? A brief recap<\/h2>\n\n\n\n<p>Linear regression models the linear relationship between a response (or dependent) variable (Y) and one or more explanatory (independent) variables (X).<\/p>\n\n\n\n<p>We can express it in the form of the following equation:<\/p>\n\n\n\n<p>Y<sub>i<\/sub> = \u03b2<sub>0<\/sub> + \u03b2<sub>1<\/sub>X<sub>i<\/sub> + \u03f5<sub>i<\/sub><\/p>\n\n\n\n<p>In the case of a single explanatory variable, it is called simple linear regression, and if there is more than one explanatory variable, it is multiple linear regression.<\/p>\n\n\n\n<p>In regression analysis, we aim to draw inferences about the population at large by finding the relationships between the dependent and independent variables for the sample. Usually, the OLS (Ordinary Least Squares) method is used to estimate the regression coefficients. OLS finds the best coefficients by minimizing the sum of the squares of the errors.<\/p>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"gauss-markov-theorem\"><strong>Gauss-Markov theorem<\/strong><\/h2>\n\n\n\n<p>The Gauss-Markov theorem states that&nbsp;<em>under certain conditions<\/em>, the Ordinary Least Squares (OLS) estimators are the Best Linear Unbiased Estimators (BLUE). This means that when those conditions are met in the dataset, the variance of the OLS model is the smallest out of all the estimators that are linear and unbiased.<\/p>\n\n\n\n<p>Let\u2019s examine the terms \u2018linear\u2019 and \u2018unbiased\u2019.<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><strong>Linear&nbsp;<\/strong>&#8211; Linear estimators imply that they have a linear relationship with the dependent variable. This makes them easier to understand and implement.<\/li><li><strong>Unbiased&nbsp;<\/strong>&#8211; Unbiased estimators imply that when applying a model repeatedly, on average, the estimators will attain their true value.<\/li><\/ul>\n\n\n\n<p>We now look at the \u201cunder certain conditions\u201d (i.e. the assumptions) mentioned earlier that form the core of the Gauss-Markov theorem.<\/p>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"assumptions-of-linear-regression\">Assumptions of Linear Regression<\/h2>\n\n\n\n<p>We can divide the basic assumptions of linear regression into two categories based on whether the assumptions are about the explanatory variables (i.e. features) or the residuals.<\/p>\n\n\n\n<p>Assumptions about the explanatory variables (features):<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Linearity<\/li><li>No multicollinearity<\/li><\/ul>\n\n\n\n<p>Assumptions about the error terms (residuals):<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Gaussian distribution<\/li><li>Homoskedasticity<\/li><li>No autocorrelation<\/li><li>Zero conditional mean<\/li><\/ul>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"linearity\">Linearity<\/h2>\n\n\n\n<p>The basic assumption of the linear regression model, as the name suggests, is that of a linear relationship between the dependent and independent variables. Here the linearity is only with respect to the parameters. Oddly enough, there\u2019s no such restriction on the degree or form of the explanatory variables themselves.<\/p>\n\n\n\n<p>So both the following equations represent linear regression:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"670\" height=\"43\" data-src=\"\/campus\/wp-content\/uploads\/sites\/2\/2022\/04\/QuantInsti-lindear-regression-1.png\" alt=\"\" class=\"wp-image-134128 lazyload\" data-srcset=\"https:\/\/ibkrcampus.com\/campus\/wp-content\/uploads\/sites\/2\/2022\/04\/QuantInsti-lindear-regression-1.png 670w, https:\/\/ibkrcampus.com\/campus\/wp-content\/uploads\/sites\/2\/2022\/04\/QuantInsti-lindear-regression-1-300x19.png 300w\" data-sizes=\"(max-width: 670px) 100vw, 670px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 670px; aspect-ratio: 670\/43;\" \/><\/figure>\n\n\n\n<p>Here, the model is linear in parameters as well as linear in the explanatory variable(s).<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"688\" height=\"42\" data-src=\"\/campus\/wp-content\/uploads\/sites\/2\/2022\/04\/QuantInsti-lindear-regression-2.png\" alt=\"\" class=\"wp-image-134125 lazyload\" data-srcset=\"https:\/\/ibkrcampus.com\/campus\/wp-content\/uploads\/sites\/2\/2022\/04\/QuantInsti-lindear-regression-2.png 688w, https:\/\/ibkrcampus.com\/campus\/wp-content\/uploads\/sites\/2\/2022\/04\/QuantInsti-lindear-regression-2-300x18.png 300w\" data-sizes=\"(max-width: 688px) 100vw, 688px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 688px; aspect-ratio: 688\/42;\" \/><\/figure>\n\n\n\n<p>This model is linear in parameters and non-linear in the explanatory variable(s).<\/p>\n\n\n\n<p>The explanatory variables can be exponentiated, quadratic, cubic, etc. and it can still be framed as a linear regression problem.<\/p>\n\n\n\n<p>The following equation is NOT linear regression:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"721\" height=\"49\" data-src=\"\/campus\/wp-content\/uploads\/sites\/2\/2022\/04\/QuantInsti-lindear-regression-3.png\" alt=\"\" class=\"wp-image-134130 lazyload\" data-srcset=\"https:\/\/ibkrcampus.com\/campus\/wp-content\/uploads\/sites\/2\/2022\/04\/QuantInsti-lindear-regression-3.png 721w, https:\/\/ibkrcampus.com\/campus\/wp-content\/uploads\/sites\/2\/2022\/04\/QuantInsti-lindear-regression-3-700x48.png 700w, https:\/\/ibkrcampus.com\/campus\/wp-content\/uploads\/sites\/2\/2022\/04\/QuantInsti-lindear-regression-3-300x20.png 300w\" data-sizes=\"(max-width: 721px) 100vw, 721px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 721px; aspect-ratio: 721\/49;\" \/><\/figure>\n\n\n\n<p>Linear regression minimizes the error (mean-squared error) to estimate the unknown betas by solving a set of linear equations.<\/p>\n\n\n\n<p>When betas take non-linear forms, things get harder and we cannot use the methods we\u2019d mentioned (but not derived!) earlier. Hence, we cannot use linear regression in the case of equation 3. Hence, the linearity (of parameters) assumption is important.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"how-to-detect-linearity\">How to detect linearity?<\/h3>\n\n\n\n<p>A residual plot helps us identify poor or incorrect curve fitting between the data and the regression model. It is probably the simplest way to check for linearity or lack thereof. A nice even spread is indicative of linearity.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"how-to-fix-linearity\">How to fix linearity?<\/h3>\n\n\n\n<p>The tricky part now is to get the functional form of the equation right.<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>We can try reframing it by applying a non-linear transformation on the independent and\/or the dependent term(s). We can transform messy data by normalizing them, taking logs of the original values, etc. This would make the data linear.<\/li><li>We can also try adding another independent variable to the equation (like&nbsp;X<sup>2<\/sup>).<\/li><\/ul>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"no-multicollinearity\">No Multicollinearity<\/h2>\n\n\n\n<p>Another assumption is that the independent variables are not correlated with each other. If there is a linear relationship between one or more explanatory variables, it adds to the complexity of the model without being able to delineate the impact of each explanatory variable on the response variable.<\/p>\n\n\n\n<p>If we were to model the salaries of a group of professionals based on their ages and years of experience.<br><br>salary<sub>i<\/sub> = \u03b2<sub>0<\/sub> + \u03b2<sub>1<\/sub>(years of experience)<sub>i<\/sub> + \u03b2<sub>2<\/sub>(age in years)<sub>i<\/sub> + \u03f5<sub>i<\/sub><\/p>\n\n\n\n<p>Linear regression studies the effect of each of the independent variables (X) on the dependent variable (Y). But when the independent variables are correlated, as in this case, it is difficult to isolate the impact of a single factor on the dependent variable. If you increase the&nbsp;<em>years of experience<\/em>, the&nbsp;<em>age<\/em>&nbsp;also will increase.<\/p>\n\n\n\n<p><em>So did the salary increase due to the experience or the age?<\/em><br>This will affect the accuracy of the coefficients and also the standard errors.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"how-to-detect-multicollinearity\">How to detect multicollinearity?<\/h3>\n\n\n\n<ul class=\"wp-block-list\"><li>Check the correlation among the independent variables.<\/li><li><a href=\"https:\/\/www.statsmodels.org\/v0.12.1\/generated\/statsmodels.stats.outliers_influence.variance_inflation_factor.html#:~:text=statsmodels.stats.outliers_influence.variance_inflation_factor%28exog%2C%20exog_idx%29%5Bsource%5D%20%C2%B6.%20variance%20inflation%20factor%2C%20VIF%2C%20for,by%20exog_idx%20is%20added%20to%20the%20linear%20regression.\" target=\"_blank\" rel=\"noreferrer noopener\">Variance Inflation Factor<\/a><\/li><\/ul>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"how-to-fix-multicollinearity\">How to fix multicollinearity?<\/h3>\n\n\n\n<p>One way to deal with multicollinearity among the independent variables is to do dimensionality reduction using techniques like PCA to create uncorrelated features with the maximum variance.<\/p>\n\n\n\n<p><em>Visit QuantInsti to read the full article: <a href=\"https:\/\/blog.quantinsti.com\/linear-regression-assumptions-limitations\/\">https:\/\/blog.quantinsti.com\/linear-regression-assumptions-limitations\/<\/a>.<\/em><\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this blog, we take a critical look at the assumptions of a linear regression model, how to detect and fix them, and how much water they hold in the real world.<\/p>\n","protected":false},"author":731,"featured_media":134181,"comment_status":"closed","ping_status":"open","sticky":true,"template":"","format":"standard","meta":{"_acf_changed":true,"footnotes":""},"categories":[343,349,338,350,341,344],"tags":[851,11600,4922,11599,8164,595,487,6591,4939],"contributors-categories":[13654],"class_list":{"0":"post-134079","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-programing-languages","8":"category-python-development","9":"category-ibkr-quant-news","10":"category-quant-asia-pacific","11":"category-quant-development","12":"category-quant-regions","13":"tag-algo-trading","14":"tag-assumptions-of-linear-regression","15":"tag-econometrics","16":"tag-gauss-markov-theorem","17":"tag-mathematics","18":"tag-python","19":"tag-r","20":"tag-rstats","21":"tag-statistics","22":"contributors-categories-quantinsti"},"pp_statuses_selecting_workflow":false,"pp_workflow_action":"current","pp_status_selection":"publish","acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v26.9 (Yoast SEO v27.3) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>Linear Regression: Assumptions and Limitations &#8211; Part I<\/title>\n<meta name=\"description\" content=\"In this blog, we take a critical look at the assumptions of a linear regression model, how to detect and fix them, and how much water they hold in the...\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.interactivebrokers.com\/campus\/wp-json\/wp\/v2\/posts\/134079\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Linear Regression: Assumptions and Limitations - Part I | IBKR Quant Blog\" \/>\n<meta property=\"og:description\" content=\"In this blog, we take a critical look at the assumptions of a linear regression model, how to detect and fix them, and how much water they hold in the real world.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/linear-regression-assumptions-and-limitations-part-i\/\" \/>\n<meta property=\"og:site_name\" content=\"IBKR Campus US\" \/>\n<meta property=\"article:published_time\" content=\"2022-04-18T15:29:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-05-17T18:24:04+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2022\/04\/quant-blue-digit-abstract.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1000\" \/>\n\t<meta property=\"og:image:height\" content=\"563\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Udisha Alok\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Udisha Alok\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\n\t    \"@context\": \"https:\\\/\\\/schema.org\",\n\t    \"@graph\": [\n\t        {\n\t            \"@type\": \"NewsArticle\",\n\t            \"@id\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/ibkr-quant-news\\\/linear-regression-assumptions-and-limitations-part-i\\\/#article\",\n\t            \"isPartOf\": {\n\t                \"@id\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/ibkr-quant-news\\\/linear-regression-assumptions-and-limitations-part-i\\\/\"\n\t            },\n\t            \"author\": {\n\t                \"name\": \"Udisha Alok\",\n\t                \"@id\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/#\\\/schema\\\/person\\\/7faa788f12ff54d5d598292f5a252fab\"\n\t            },\n\t            \"headline\": \"Linear Regression: Assumptions and Limitations &#8211; Part I\",\n\t            \"datePublished\": \"2022-04-18T15:29:00+00:00\",\n\t            \"dateModified\": \"2024-05-17T18:24:04+00:00\",\n\t            \"mainEntityOfPage\": {\n\t                \"@id\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/ibkr-quant-news\\\/linear-regression-assumptions-and-limitations-part-i\\\/\"\n\t            },\n\t            \"wordCount\": 999,\n\t            \"publisher\": {\n\t                \"@id\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/#organization\"\n\t            },\n\t            \"image\": {\n\t                \"@id\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/ibkr-quant-news\\\/linear-regression-assumptions-and-limitations-part-i\\\/#primaryimage\"\n\t            },\n\t            \"thumbnailUrl\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/wp-content\\\/uploads\\\/sites\\\/2\\\/2022\\\/04\\\/quant-blue-digit-abstract.png\",\n\t            \"keywords\": [\n\t                \"Algo Trading\",\n\t                \"Assumptions of Linear Regression\",\n\t                \"Econometrics\",\n\t                \"Gauss-Markov theorem\",\n\t                \"Mathematics\",\n\t                \"Python\",\n\t                \"R\",\n\t                \"rstats\",\n\t                \"statistics\"\n\t            ],\n\t            \"articleSection\": [\n\t                \"Programming Languages\",\n\t                \"Python Development\",\n\t                \"Quant\",\n\t                \"Quant Asia Pacific\",\n\t                \"Quant Development\",\n\t                \"Quant Regions\"\n\t            ],\n\t            \"inLanguage\": \"en-US\"\n\t        },\n\t        {\n\t            \"@type\": \"WebPage\",\n\t            \"@id\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/ibkr-quant-news\\\/linear-regression-assumptions-and-limitations-part-i\\\/\",\n\t            \"url\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/ibkr-quant-news\\\/linear-regression-assumptions-and-limitations-part-i\\\/\",\n\t            \"name\": \"Linear Regression: Assumptions and Limitations - Part I | IBKR Quant Blog\",\n\t            \"isPartOf\": {\n\t                \"@id\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/#website\"\n\t            },\n\t            \"primaryImageOfPage\": {\n\t                \"@id\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/ibkr-quant-news\\\/linear-regression-assumptions-and-limitations-part-i\\\/#primaryimage\"\n\t            },\n\t            \"image\": {\n\t                \"@id\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/ibkr-quant-news\\\/linear-regression-assumptions-and-limitations-part-i\\\/#primaryimage\"\n\t            },\n\t            \"thumbnailUrl\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/wp-content\\\/uploads\\\/sites\\\/2\\\/2022\\\/04\\\/quant-blue-digit-abstract.png\",\n\t            \"datePublished\": \"2022-04-18T15:29:00+00:00\",\n\t            \"dateModified\": \"2024-05-17T18:24:04+00:00\",\n\t            \"description\": \"In this blog, we take a critical look at the assumptions of a linear regression model, how to detect and fix them, and how much water they hold in the real world.\",\n\t            \"inLanguage\": \"en-US\",\n\t            \"potentialAction\": [\n\t                {\n\t                    \"@type\": \"ReadAction\",\n\t                    \"target\": [\n\t                        \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/ibkr-quant-news\\\/linear-regression-assumptions-and-limitations-part-i\\\/\"\n\t                    ]\n\t                }\n\t            ]\n\t        },\n\t        {\n\t            \"@type\": \"ImageObject\",\n\t            \"inLanguage\": \"en-US\",\n\t            \"@id\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/ibkr-quant-news\\\/linear-regression-assumptions-and-limitations-part-i\\\/#primaryimage\",\n\t            \"url\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/wp-content\\\/uploads\\\/sites\\\/2\\\/2022\\\/04\\\/quant-blue-digit-abstract.png\",\n\t            \"contentUrl\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/wp-content\\\/uploads\\\/sites\\\/2\\\/2022\\\/04\\\/quant-blue-digit-abstract.png\",\n\t            \"width\": 1000,\n\t            \"height\": 563,\n\t            \"caption\": \"Quant\"\n\t        },\n\t        {\n\t            \"@type\": \"WebSite\",\n\t            \"@id\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/#website\",\n\t            \"url\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/\",\n\t            \"name\": \"IBKR Campus US\",\n\t            \"description\": \"Financial Education from Interactive Brokers\",\n\t            \"publisher\": {\n\t                \"@id\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/#organization\"\n\t            },\n\t            \"potentialAction\": [\n\t                {\n\t                    \"@type\": \"SearchAction\",\n\t                    \"target\": {\n\t                        \"@type\": \"EntryPoint\",\n\t                        \"urlTemplate\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/?s={search_term_string}\"\n\t                    },\n\t                    \"query-input\": {\n\t                        \"@type\": \"PropertyValueSpecification\",\n\t                        \"valueRequired\": true,\n\t                        \"valueName\": \"search_term_string\"\n\t                    }\n\t                }\n\t            ],\n\t            \"inLanguage\": \"en-US\"\n\t        },\n\t        {\n\t            \"@type\": \"Organization\",\n\t            \"@id\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/#organization\",\n\t            \"name\": \"Interactive Brokers\",\n\t            \"alternateName\": \"IBKR\",\n\t            \"url\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/\",\n\t            \"logo\": {\n\t                \"@type\": \"ImageObject\",\n\t                \"inLanguage\": \"en-US\",\n\t                \"@id\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/#\\\/schema\\\/logo\\\/image\\\/\",\n\t                \"url\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/wp-content\\\/uploads\\\/sites\\\/2\\\/2024\\\/05\\\/ibkr-campus-logo.jpg\",\n\t                \"contentUrl\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/wp-content\\\/uploads\\\/sites\\\/2\\\/2024\\\/05\\\/ibkr-campus-logo.jpg\",\n\t                \"width\": 669,\n\t                \"height\": 669,\n\t                \"caption\": \"Interactive Brokers\"\n\t            },\n\t            \"image\": {\n\t                \"@id\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/#\\\/schema\\\/logo\\\/image\\\/\"\n\t            },\n\t            \"publishingPrinciples\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/about-ibkr-campus\\\/\",\n\t            \"ethicsPolicy\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/cyber-security-notice\\\/\"\n\t        },\n\t        {\n\t            \"@type\": \"Person\",\n\t            \"@id\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/#\\\/schema\\\/person\\\/7faa788f12ff54d5d598292f5a252fab\",\n\t            \"name\": \"Udisha Alok\",\n\t            \"url\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/author\\\/udisha-alok\\\/\"\n\t        }\n\t    ]\n\t}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Linear Regression: Assumptions and Limitations &#8211; Part I","description":"In this blog, we take a critical look at the assumptions of a linear regression model, how to detect and fix them, and how much water they hold in the...","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:\/\/www.interactivebrokers.com\/campus\/wp-json\/wp\/v2\/posts\/134079\/","og_locale":"en_US","og_type":"article","og_title":"Linear Regression: Assumptions and Limitations - Part I | IBKR Quant Blog","og_description":"In this blog, we take a critical look at the assumptions of a linear regression model, how to detect and fix them, and how much water they hold in the real world.","og_url":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/linear-regression-assumptions-and-limitations-part-i\/","og_site_name":"IBKR Campus US","article_published_time":"2022-04-18T15:29:00+00:00","article_modified_time":"2024-05-17T18:24:04+00:00","og_image":[{"width":1000,"height":563,"url":"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2022\/04\/quant-blue-digit-abstract.png","type":"image\/png"}],"author":"Udisha Alok","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Udisha Alok","Est. reading time":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"NewsArticle","@id":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/linear-regression-assumptions-and-limitations-part-i\/#article","isPartOf":{"@id":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/linear-regression-assumptions-and-limitations-part-i\/"},"author":{"name":"Udisha Alok","@id":"https:\/\/ibkrcampus.com\/campus\/#\/schema\/person\/7faa788f12ff54d5d598292f5a252fab"},"headline":"Linear Regression: Assumptions and Limitations &#8211; Part I","datePublished":"2022-04-18T15:29:00+00:00","dateModified":"2024-05-17T18:24:04+00:00","mainEntityOfPage":{"@id":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/linear-regression-assumptions-and-limitations-part-i\/"},"wordCount":999,"publisher":{"@id":"https:\/\/ibkrcampus.com\/campus\/#organization"},"image":{"@id":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/linear-regression-assumptions-and-limitations-part-i\/#primaryimage"},"thumbnailUrl":"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2022\/04\/quant-blue-digit-abstract.png","keywords":["Algo Trading","Assumptions of Linear Regression","Econometrics","Gauss-Markov theorem","Mathematics","Python","R","rstats","statistics"],"articleSection":["Programming Languages","Python Development","Quant","Quant Asia Pacific","Quant Development","Quant Regions"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/linear-regression-assumptions-and-limitations-part-i\/","url":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/linear-regression-assumptions-and-limitations-part-i\/","name":"Linear Regression: Assumptions and Limitations - Part I | IBKR Quant Blog","isPartOf":{"@id":"https:\/\/ibkrcampus.com\/campus\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/linear-regression-assumptions-and-limitations-part-i\/#primaryimage"},"image":{"@id":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/linear-regression-assumptions-and-limitations-part-i\/#primaryimage"},"thumbnailUrl":"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2022\/04\/quant-blue-digit-abstract.png","datePublished":"2022-04-18T15:29:00+00:00","dateModified":"2024-05-17T18:24:04+00:00","description":"In this blog, we take a critical look at the assumptions of a linear regression model, how to detect and fix them, and how much water they hold in the real world.","inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/linear-regression-assumptions-and-limitations-part-i\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/linear-regression-assumptions-and-limitations-part-i\/#primaryimage","url":"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2022\/04\/quant-blue-digit-abstract.png","contentUrl":"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2022\/04\/quant-blue-digit-abstract.png","width":1000,"height":563,"caption":"Quant"},{"@type":"WebSite","@id":"https:\/\/ibkrcampus.com\/campus\/#website","url":"https:\/\/ibkrcampus.com\/campus\/","name":"IBKR Campus US","description":"Financial Education from Interactive Brokers","publisher":{"@id":"https:\/\/ibkrcampus.com\/campus\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/ibkrcampus.com\/campus\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/ibkrcampus.com\/campus\/#organization","name":"Interactive Brokers","alternateName":"IBKR","url":"https:\/\/ibkrcampus.com\/campus\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/ibkrcampus.com\/campus\/#\/schema\/logo\/image\/","url":"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2024\/05\/ibkr-campus-logo.jpg","contentUrl":"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2024\/05\/ibkr-campus-logo.jpg","width":669,"height":669,"caption":"Interactive Brokers"},"image":{"@id":"https:\/\/ibkrcampus.com\/campus\/#\/schema\/logo\/image\/"},"publishingPrinciples":"https:\/\/www.interactivebrokers.com\/campus\/about-ibkr-campus\/","ethicsPolicy":"https:\/\/www.interactivebrokers.com\/campus\/cyber-security-notice\/"},{"@type":"Person","@id":"https:\/\/ibkrcampus.com\/campus\/#\/schema\/person\/7faa788f12ff54d5d598292f5a252fab","name":"Udisha Alok","url":"https:\/\/www.interactivebrokers.com\/campus\/author\/udisha-alok\/"}]}},"jetpack_featured_media_url":"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2022\/04\/quant-blue-digit-abstract.png","_links":{"self":[{"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/posts\/134079","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/users\/731"}],"replies":[{"embeddable":true,"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/comments?post=134079"}],"version-history":[{"count":0,"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/posts\/134079\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/media\/134181"}],"wp:attachment":[{"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/media?parent=134079"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/categories?post=134079"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/tags?post=134079"},{"taxonomy":"contributors-categories","embeddable":true,"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/contributors-categories?post=134079"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}