{"id":6438,"date":"2026-04-25T15:31:46","date_gmt":"2026-04-25T20:31:46","guid":{"rendered":"https:\/\/ykim.synology.me\/wordpress\/?p=6438"},"modified":"2026-11-26T22:39:33","modified_gmt":"2026-11-27T04:39:33","slug":"centered-r%c2%b2-vs-uncentered-r%c2%b2","status":"publish","type":"post","link":"https:\/\/ykim.synology.me\/wordpress\/centered-r%c2%b2-vs-uncentered-r%c2%b2-6438\/","title":{"rendered":"Centered R\u00b2 vs Uncentered R\u00b2"},"content":{"rendered":"\n<figure class=\"wp-block-image size-large is-resized\"><img decoding=\"async\" src=\"https:\/\/raw.githubusercontent.com\/yBarn1\/Images\/main\/pools\/bondi-icebergs-ocean-pool.webp\" alt=\"\" style=\"width:auto;height:500px\"\/><\/figure>\n\n\n<style>.kt-tabs-id6438_1b5cda-83 > .kt-tabs-content-wrap > .wp-block-kadence-tab{border-top:3px solid #0a6689;border-right:0px solid #0a6689;border-bottom:0px solid #0a6689;border-left:0px solid #0a6689;border-top-left-radius:0px;border-top-right-radius:0px;border-bottom-right-radius:0px;border-bottom-left-radius:0px;padding-top:var(--global-kb-spacing-sm, 1.5rem);padding-right:var(--global-kb-spacing-sm, 1.5rem);padding-bottom:var(--global-kb-spacing-sm, 1.5rem);padding-left:var(--global-kb-spacing-sm, 1.5rem);background:var(--global-palette9, #ffffff);}.wp-block-kadence-tabs .kt-tabs-id6438_1b5cda-83 > .kt-tabs-title-list li{margin-top:0px;margin-right:8px;margin-bottom:0px;margin-left:0px;}.wp-block-kadence-tabs .kt-tabs-id6438_1b5cda-83 > .kt-tabs-title-list li:last-child{margin-right:0px;}.wp-block-kadence-tabs .kt-tabs-id6438_1b5cda-83 > .kt-tabs-title-list li .kt-tab-title, .wp-block-kadence-tabs .kt-tabs-id6438_1b5cda-83 > .kt-tabs-content-wrap > .kt-tabs-accordion-title .kt-tab-title{line-height:1.4em;font-weight:regular;font-style:normal;border-top-width:0px;border-right-width:0px;border-bottom-width:0px;border-left-width:0px;border-top-left-radius:4px;border-top-right-radius:4px;border-bottom-right-radius:0px;border-bottom-left-radius:0px;padding-top:8px;padding-right:20px;padding-bottom:8px;padding-left:20px;border-color:var(--global-palette7, #eeeeee);color:var(--global-palette4, #2D3748);background:var(--global-palette7, #eeeeee);}.wp-block-kadence-tabs .kt-tabs-id6438_1b5cda-83 > .kt-tabs-content-wrap > .kt-tabs-accordion-title .kt-tab-title{margin-top:0px;margin-right:8px;margin-bottom:0px;margin-left:0px;}.wp-block-kadence-tabs .kt-tabs-id6438_1b5cda-83 > .kt-tabs-title-list li .kt-tab-title:hover, .wp-block-kadence-tabs .kt-tabs-id6438_1b5cda-83 > .kt-tabs-content-wrap > .kt-tabs-accordion-title .kt-tab-title:hover{border-color:var(--global-palette7, #eeeeee);color:var(--global-palette3, #1A202C);background:var(--global-palette8, #F7FAFC);}.wp-block-kadence-tabs .kt-tabs-id6438_1b5cda-83 > .kt-tabs-title-list li.kt-tab-title-active .kt-tab-title, .wp-block-kadence-tabs .kt-tabs-id6438_1b5cda-83 > .kt-tabs-content-wrap > .kt-tabs-accordion-title.kt-tab-title-active .kt-tab-title{border-color:var(--global-palette7, #eeeeee);color:#ffffff;background:#0a6689;}@media all and (max-width: 1024px){.kt-tabs-id6438_1b5cda-83 > .kt-tabs-content-wrap > .wp-block-kadence-tab{border-top:3px solid #0a6689;border-right:0px solid #0a6689;border-bottom:0px solid #0a6689;border-left:0px solid #0a6689;}}@media all and (max-width: 767px){.kt-tabs-id6438_1b5cda-83 > .kt-tabs-content-wrap > .wp-block-kadence-tab{border-top:3px solid #0a6689;border-right:0px solid #0a6689;border-bottom:0px solid #0a6689;border-left:0px solid #0a6689;}}<\/style>\n<div class=\"wp-block-kadence-tabs alignnone\"><div class=\"kt-tabs-wrap kt-tabs-id6438_1b5cda-83 kt-tabs-has-2-tabs kt-active-tab-2 kt-tabs-layout-tabs kt-tabs-tablet-layout-inherit kt-tabs-mobile-layout-inherit kt-tab-alignment-left \"><ul class=\"kt-tabs-title-list\"><li id=\"tab-english\" class=\"kt-title-item kt-title-item-1 kt-tabs-svg-show-always kt-tabs-icon-side-right kt-tab-title-inactive\"><a href=\"#tab-english\" data-tab=\"1\" class=\"kt-tab-title kt-tab-title-1 \"><span class=\"kt-title-text\">English<\/span><\/a><\/li><li id=\"tab-korean\" class=\"kt-title-item kt-title-item-2 kt-tabs-svg-show-always kt-tabs-icon-side-right kt-tab-title-active\"><a href=\"#tab-korean\" data-tab=\"2\" class=\"kt-tab-title kt-tab-title-2 \"><span class=\"kt-title-text\">Korean<\/span><\/a><\/li><\/ul><div class=\"kt-tabs-content-wrap\">\n<div class=\"wp-block-kadence-tab kt-tab-inner-content kt-inner-tab-1 kt-inner-tab6438_fa6f38-e3\"><div class=\"kt-tab-inner-content-inner\"><p><div class=\"github-readme-container markdown-body\"><div id=\"file\" class=\"md\" data-path=\"Metrics\/R2\/Uncentered-R2\/centered-r2-vs-uncentered-r2.md\"><article class=\"markdown-body entry-content container-lg\" itemprop=\"text\"><div class=\"markdown-heading\" dir=\"auto\"><h1 class=\"heading-element\" dir=\"auto\">Centered R\u00b2 vs Uncentered R\u00b2<\/h1><a id=\"user-content-centered-r-vs-uncentered-r\" class=\"anchor\" aria-label=\"Permalink: Centered R\u00b2 vs Uncentered R\u00b2\" href=\"#centered-r-vs-uncentered-r\"><svg data-component=\"Octicon\" class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"><\/path><\/svg><\/a><\/div>\n<p dir=\"auto\">Version 21 | Created: 2026-04-25 | Updated: 2026-11-07 13:46 UTC<\/p>\n<ul dir=\"auto\">\n<li><a href=\"#1-introduction-r%C2%B2-and-its-relation-to-rsq\">1. Introduction: R\u00b2 and Its Relation to RSQ<\/a><\/li>\n<li><a href=\"#2-comparison-of-the-two-formulas\">2. Comparison of the Two Formulas<\/a><\/li>\n<li><a href=\"#3-pros-and-cons\">3. Pros and Cons<\/a>\n<ul dir=\"auto\">\n<li><a href=\"#31-centered-r%C2%B2\">3.1 Centered R\u00b2<\/a><\/li>\n<li><a href=\"#32-uncentered-r%C2%B2\">3.2 Uncentered R\u00b2<\/a><\/li>\n<\/ul>\n<\/li>\n<li><a href=\"#4-applications\">4. Applications<\/a>\n<ul dir=\"auto\">\n<li><a href=\"#41-centered-r%C2%B2\">4.1 Centered R\u00b2<\/a><\/li>\n<li><a href=\"#42-uncentered-r%C2%B2\">4.2 Uncentered R\u00b2<\/a><\/li>\n<\/ul>\n<\/li>\n<li><a href=\"#5-derivation-of-uncentered-r%C2%B2\">5. Derivation of Uncentered R\u00b2<\/a>\n<ul dir=\"auto\">\n<li><a href=\"#51-sum-of-squares-decomposition\">5.1 Sum of Squares Decomposition<\/a><\/li>\n<li><a href=\"#52-ordinary-least-squares-ols-orthogonality-condition\">5.2 Ordinary Least Squares (OLS) Orthogonality Condition<\/a><\/li>\n<li><a href=\"#53-uncentered-decomposition\">5.3 Uncentered Decomposition<\/a><\/li>\n<li><a href=\"#54-definition-of-uncentered-r%C2%B2\">5.4 Definition of Uncentered R\u00b2<\/a><\/li>\n<li><a href=\"#55-relation-to-centered-r%C2%B2\">5.5 Relation to Centered R\u00b2<\/a><\/li>\n<\/ul>\n<\/li>\n<li><a href=\"#6-geometric-interpretation\">6. Geometric Interpretation<\/a>\n<ul dir=\"auto\">\n<li><a href=\"#61-vector-space-setup\">6.1 Vector Space Setup<\/a><\/li>\n<li><a href=\"#62-ols-as-orthogonal-projection\">6.2 OLS as Orthogonal Projection<\/a><\/li>\n<li><a href=\"#63-uncentered-decomposition-as-the-pythagorean-theorem\">6.3 Uncentered Decomposition as the Pythagorean Theorem<\/a><\/li>\n<li><a href=\"#64-centered-r%C2%B2-subtracting-the-mean-vector\">6.4 Centered R\u00b2: Subtracting the Mean Vector<\/a><\/li>\n<li><a href=\"#65-geometric-distinction-between-the-two-r%C2%B2\">6.5 Geometric Distinction Between the Two R\u00b2<\/a><\/li>\n<li><a href=\"#66-comparison-table\">6.6 Comparison Table<\/a><\/li>\n<\/ul>\n<\/li>\n<li><a href=\"#references\">References<\/a><\/li>\n<li><a href=\"#appendix-a-terminology\">Appendix A. Terminology<\/a><\/li>\n<li><a href=\"#appendix-b-python-code\">Appendix B. Python Code<\/a>\n<ul dir=\"auto\">\n<li><a href=\"#b1-centered-r%C2%B2\">B.1 Centered R\u00b2<\/a><\/li>\n<li><a href=\"#b2-uncentered-r%C2%B2\">B.2 Uncentered R\u00b2<\/a><\/li>\n<li><a href=\"#b3-integrated-evaluation-for-11-line-agreement\">B.3 Integrated Evaluation for 1:1-Line Agreement<\/a><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<div class=\"markdown-heading\" dir=\"auto\"><h2 class=\"heading-element\" dir=\"auto\">1. Introduction: R\u00b2 and Its Relation to RSQ<\/h2><a id=\"user-content-1-introduction-r-and-its-relation-to-rsq\" class=\"anchor\" aria-label=\"Permalink: 1. Introduction: R\u00b2 and Its Relation to RSQ\" href=\"#1-introduction-r-and-its-relation-to-rsq\"><svg data-component=\"Octicon\" class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"><\/path><\/svg><\/a><\/div>\n<p dir=\"auto\">The coefficient of determination, denoted as R\u00b2 (R-squared), is one of the most\nwidely used validation metrics in statistics and machine learning (ML) for\nassessing how well predicted values <math-renderer class=\"js-inline-math\" style=\"display: inline-block\" data-run-id=\"a13011b2b8de9dd89048f2ab6e525db2\">$\\hat{y}$<\/math-renderer> agree with observed values\n<math-renderer class=\"js-inline-math\" style=\"display: inline-block\" data-run-id=\"a13011b2b8de9dd89048f2ab6e525db2\">$y_{true}$<\/math-renderer>. In spreadsheet software and many engineering reports, R\u00b2 is often\nreferred to as <strong>RSQ<\/strong> (the Excel function name <code>RSQ()<\/code>), which computes the\nsquared Pearson correlation coefficient between two variables. The default RSQ\nin Excel and the standard R\u00b2 reported by most regression libraries refer to the\nsame quantity: the <strong>centered R\u00b2<\/strong>, which measures the proportion of variance in\n<math-renderer class=\"js-inline-math\" style=\"display: inline-block\" data-run-id=\"a13011b2b8de9dd89048f2ab6e525db2\">$y$<\/math-renderer> explained by the model relative to its mean baseline.<\/p>\n<p dir=\"auto\">However, a less commonly discussed variant \u2014 the <strong>uncentered R\u00b2<\/strong> \u2014 replaces\nthe mean-based baseline with a zero baseline. This article compares the two,\nderives the uncentered formula, provides a geometric interpretation, and\ndiscusses when each is appropriate, with the Python implementations collected in\n<a href=\"#appendix-b-python-code\">Appendix B<\/a>. In particular, we examine whether\nuncentered R\u00b2 is more suitable for evaluating 1:1-line agreement between\n<math-renderer class=\"js-inline-math\" style=\"display: inline-block\" data-run-id=\"a13011b2b8de9dd89048f2ab6e525db2\">$y_{true}$<\/math-renderer> and <math-renderer class=\"js-inline-math\" style=\"display: inline-block\" data-run-id=\"a13011b2b8de9dd89048f2ab6e525db2\">$\\hat{y}$<\/math-renderer> in same-physical-quantity comparisons\n[<a href=\"#ref-3\">3<\/a>][<a href=\"#ref-4\">4<\/a>].<\/p>\n<div class=\"markdown-heading\" dir=\"auto\"><h2 class=\"heading-element\" dir=\"auto\">2. Comparison of the Two Formulas<\/h2><a id=\"user-content-2-comparison-of-the-two-formulas\" class=\"anchor\" aria-label=\"Permalink: 2. Comparison of the Two Formulas\" href=\"#2-comparison-of-the-two-formulas\"><svg data-component=\"Octicon\" class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"><\/path><\/svg><\/a><\/div>\n<p dir=\"auto\"><math-renderer class=\"js-display-math\" style=\"display: block\" data-run-id=\"a13011b2b8de9dd89048f2ab6e525db2\">$$R^2_c = 1 - \\frac{\\sum_{i=1}^n (y_i - \\hat{y}_i)^2}{\\sum_{i=1}^n (y_i - \\bar{y})^2}$$<\/math-renderer><\/p>\n<p dir=\"auto\"><math-renderer class=\"js-display-math\" style=\"display: block\" data-run-id=\"a13011b2b8de9dd89048f2ab6e525db2\">$$R^2_u = 1 - \\frac{\\sum_{i=1}^n (y_i - \\hat{y}_i)^2}{\\sum_{i=1}^n y_i^2}$$<\/math-renderer><\/p>\n<ul dir=\"auto\">\n<li>The difference lies entirely in the denominator. Centered R\u00b2 asks \"how much\nvariance around the mean has been explained?\", whereas uncentered R\u00b2 asks \"how\nmuch of the total sum of squares around zero has been explained?\". Centered R\u00b2\nuses the mean prediction as its baseline, while uncentered R\u00b2 uses zero\nprediction as its baseline [<a href=\"#ref-3\">3<\/a>].<\/li>\n<li>Centered R\u00b2 asks: \"How much better is the model compared to a baseline that\nsimply predicts the mean?\"<\/li>\n<li>Uncentered R\u00b2 asks: \"How close is the model's prediction to the 1:1 identity\nline (y=x)?\"<\/li>\n<\/ul>\n<div class=\"markdown-heading\" dir=\"auto\"><h2 class=\"heading-element\" dir=\"auto\">3. Pros and Cons<\/h2><a id=\"user-content-3-pros-and-cons\" class=\"anchor\" aria-label=\"Permalink: 3. Pros and Cons\" href=\"#3-pros-and-cons\"><svg data-component=\"Octicon\" class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"><\/path><\/svg><\/a><\/div>\n<div class=\"markdown-heading\" dir=\"auto\"><h3 class=\"heading-element\" dir=\"auto\">3.1 Centered R\u00b2<\/h3><a id=\"user-content-31-centered-r\" class=\"anchor\" aria-label=\"Permalink: 3.1 Centered R\u00b2\" href=\"#31-centered-r\"><svg data-component=\"Octicon\" class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"><\/path><\/svg><\/a><\/div>\n<ul dir=\"auto\">\n<li>\n<strong>Pros<\/strong>: Scale- and unit-invariant, allowing comparison of models across\ndifferent physical quantities. Equivalent to the squared Pearson correlation\ncoefficient, providing rich statistical intuition.<\/li>\n<li>\n<strong>Cons<\/strong>: When the variance of <math-renderer class=\"js-inline-math\" style=\"display: inline-block\" data-run-id=\"a13011b2b8de9dd89048f2ab6e525db2\">$y$<\/math-renderer> is small (nearly constant), the denominator\napproaches zero and R\u00b2 collapses or even turns negative. Measures only\nrelative performance against a mean predictor and is insensitive to systematic\nbias.<\/li>\n<\/ul>\n<div class=\"markdown-heading\" dir=\"auto\"><h3 class=\"heading-element\" dir=\"auto\">3.2 Uncentered R\u00b2<\/h3><a id=\"user-content-32-uncentered-r\" class=\"anchor\" aria-label=\"Permalink: 3.2 Uncentered R\u00b2\" href=\"#32-uncentered-r\"><svg data-component=\"Octicon\" class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"><\/path><\/svg><\/a><\/div>\n<ul dir=\"auto\">\n<li>\n<strong>Pros<\/strong>: When comparing models, datasets, or experiments at the same\nphysical-quantity level, uncentered R\u00b2 provides a consistent absolute baseline\n(zero prediction), enabling coherent cross-comparison. Robust against\nlow-variance data. Sensitive to deviations from the 1:1 line, properly\npenalizing systematic bias [<a href=\"#ref-4\">4<\/a>].<\/li>\n<li>\n<strong>Cons<\/strong>: Scale-dependent, so unsuitable for comparing models across different\nunits or value ranges. When <math-renderer class=\"js-inline-math\" style=\"display: inline-block\" data-run-id=\"a13011b2b8de9dd89048f2ab6e525db2\">$\\bar{y}$<\/math-renderer> is large, <math-renderer class=\"js-inline-math\" style=\"display: inline-block\" data-run-id=\"a13011b2b8de9dd89048f2ab6e525db2\">$R^2_u$<\/math-renderer> tends to be\nartificially close to 1. Uncentered <math-renderer class=\"js-inline-math\" style=\"display: inline-block\" data-run-id=\"a13011b2b8de9dd89048f2ab6e525db2\">$R^2$<\/math-renderer> values tend to be significantly\nhigher (often reaching 0.99 or above) because the denominator, <math-renderer class=\"js-inline-math\" style=\"display: inline-block\" data-run-id=\"a13011b2b8de9dd89048f2ab6e525db2\">$\\sum y_i^2$<\/math-renderer>,\nis generally much larger than the centered denominator,\n<math-renderer class=\"js-inline-math\" style=\"display: inline-block\" data-run-id=\"a13011b2b8de9dd89048f2ab6e525db2\">$\\sum (y_i - \\bar{y})^2$<\/math-renderer>. This can lead to an overly optimistic assessment if\ninterpreted in isolation. However, for min-max normalized data, the uniformity\nof scale renders the uncentered <math-renderer class=\"js-inline-math\" style=\"display: inline-block\" data-run-id=\"a13011b2b8de9dd89048f2ab6e525db2\">$R^2$<\/math-renderer> a superior metric for quantifying the\nabsolute agreement between observed and predicted values.<\/li>\n<\/ul>\n<p dir=\"auto\"><strong>Key question<\/strong>: When comparing models on data of the same physical quantity,\nis uncentered R\u00b2 actually more accurate? The answer is essentially \"yes.\" For\nevaluating absolute agreement between <math-renderer class=\"js-inline-math\" style=\"display: inline-block\" data-run-id=\"a13011b2b8de9dd89048f2ab6e525db2\">$y_{true}$<\/math-renderer> and <math-renderer class=\"js-inline-math\" style=\"display: inline-block\" data-run-id=\"a13011b2b8de9dd89048f2ab6e525db2\">$\\hat{y}$<\/math-renderer> in same-unit\ndata, uncentered R\u00b2 (1) is not distorted by changes in dataset variance, (2) is\nsensitive to constant bias, and (3) shares an absolute baseline (zero\nprediction) across datasets, enabling consistent model-to-model comparison.<\/p>\n<div class=\"markdown-heading\" dir=\"auto\"><h2 class=\"heading-element\" dir=\"auto\">4. Applications<\/h2><a id=\"user-content-4-applications\" class=\"anchor\" aria-label=\"Permalink: 4. Applications\" href=\"#4-applications\"><svg data-component=\"Octicon\" class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"><\/path><\/svg><\/a><\/div>\n<div class=\"markdown-heading\" dir=\"auto\"><h3 class=\"heading-element\" dir=\"auto\">4.1 Centered R\u00b2<\/h3><a id=\"user-content-41-centered-r\" class=\"anchor\" aria-label=\"Permalink: 4.1 Centered R\u00b2\" href=\"#41-centered-r\"><svg data-component=\"Octicon\" class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"><\/path><\/svg><\/a><\/div>\n<ul dir=\"auto\">\n<li>Standard performance metric in general regression and ML modeling.<\/li>\n<li>Comparing model performance across heterogeneous units or domains in\nnormalized form.<\/li>\n<li>Variance-explanation evaluation based on Pearson correlation\n[<a href=\"#ref-1\">1<\/a>].<\/li>\n<\/ul>\n<div class=\"markdown-heading\" dir=\"auto\"><h3 class=\"heading-element\" dir=\"auto\">4.2 Uncentered R\u00b2<\/h3><a id=\"user-content-42-uncentered-r\" class=\"anchor\" aria-label=\"Permalink: 4.2 Uncentered R\u00b2\" href=\"#42-uncentered-r\"><svg data-component=\"Octicon\" class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"><\/path><\/svg><\/a><\/div>\n<ul dir=\"auto\">\n<li>\n<strong>Regression Through the Origin (RTO)<\/strong>: Models physically constrained to pass\nthrough zero, such as Hooke's law and radioactive decay. The <code>noconstant<\/code>\noption in Stata, R, and EViews automatically returns uncentered R\u00b2\n[<a href=\"#ref-2\">2<\/a>]. When the intercept is fixed to zero, standard (centered) <math-renderer class=\"js-inline-math\" style=\"display: inline-block\" data-run-id=\"a13011b2b8de9dd89048f2ab6e525db2\">$R^2$<\/math-renderer>\ncan produce negative values or misleading interpretations. In such cases,\nuncentered <math-renderer class=\"js-inline-math\" style=\"display: inline-block\" data-run-id=\"a13011b2b8de9dd89048f2ab6e525db2\">$R^2$<\/math-renderer> is used as a robust alternative to evaluate the model's fit\nrelative to the origin.<\/li>\n<li>\n<strong>Diagnostic tests in econometrics<\/strong>: Auxiliary regressions in the\nBreusch-Pagan and White tests use <math-renderer class=\"js-inline-math\" style=\"display: inline-block\" data-run-id=\"a13011b2b8de9dd89048f2ab6e525db2\">$nR^2$<\/math-renderer> as a chi-squared statistic, computed\nin uncentered form [<a href=\"#ref-6\">6<\/a>].<\/li>\n<li>\n<strong>Evaluating deviation from the 1:1 line in <math-renderer class=\"js-inline-math\" style=\"display: inline-block\" data-run-id=\"a13011b2b8de9dd89048f2ab6e525db2\">$Y_{true}$<\/math-renderer> vs <math-renderer class=\"js-inline-math\" style=\"display: inline-block\" data-run-id=\"a13011b2b8de9dd89048f2ab6e525db2\">$Y_{pred}$<\/math-renderer> plots<\/strong>:\nFor ML prediction tasks involving same-physical-quantity data, uncentered R\u00b2\nmeasures absolute agreement. Suitable for calibration, Computational Fluid\nDynamics (CFD) and Finite Element Method (FEM) validation, sensor calibration,\nand reproducibility studies.<\/li>\n<\/ul>\n<div class=\"markdown-heading\" dir=\"auto\"><h2 class=\"heading-element\" dir=\"auto\">5. Derivation of Uncentered R\u00b2<\/h2><a id=\"user-content-5-derivation-of-uncentered-r\" class=\"anchor\" aria-label=\"Permalink: 5. Derivation of Uncentered R\u00b2\" href=\"#5-derivation-of-uncentered-r\"><svg data-component=\"Octicon\" class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"><\/path><\/svg><\/a><\/div>\n<div class=\"markdown-heading\" dir=\"auto\"><h3 class=\"heading-element\" dir=\"auto\">5.1 Sum of Squares Decomposition<\/h3><a id=\"user-content-51-sum-of-squares-decomposition\" class=\"anchor\" aria-label=\"Permalink: 5.1 Sum of Squares Decomposition\" href=\"#51-sum-of-squares-decomposition\"><svg data-component=\"Octicon\" class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"><\/path><\/svg><\/a><\/div>\n<p dir=\"auto\">For observations <math-renderer class=\"js-inline-math\" style=\"display: inline-block\" data-run-id=\"a13011b2b8de9dd89048f2ab6e525db2\">$y_i$<\/math-renderer>, predictions <math-renderer class=\"js-inline-math\" style=\"display: inline-block\" data-run-id=\"a13011b2b8de9dd89048f2ab6e525db2\">$\\hat{y}_i$<\/math-renderer>, and residuals\n<math-renderer class=\"js-inline-math\" style=\"display: inline-block\" data-run-id=\"a13011b2b8de9dd89048f2ab6e525db2\">$e_i = y_i - \\hat{y}_i$<\/math-renderer> (<math-renderer class=\"js-inline-math\" style=\"display: inline-block\" data-run-id=\"a13011b2b8de9dd89048f2ab6e525db2\">$i = 1, \\ldots, n$<\/math-renderer>), define the uncentered sums of\nsquares \u2014 Total Sum of Squares (TSS), Explained Sum of Squares (ESS), and\nResidual Sum of Squares (RSS) \u2014 as follows:<\/p>\n<p dir=\"auto\"><math-renderer class=\"js-display-math\" style=\"display: block\" data-run-id=\"a13011b2b8de9dd89048f2ab6e525db2\">$$TSS_u = \\sum_{i=1}^n y_i^2, \\quad ESS_u = \\sum_{i=1}^n \\hat{y}_i^2, \\quad RSS = \\sum_{i=1}^n e_i^2$$<\/math-renderer><\/p>\n<div class=\"markdown-heading\" dir=\"auto\"><h3 class=\"heading-element\" dir=\"auto\">5.2 Ordinary Least Squares (OLS) Orthogonality Condition<\/h3><a id=\"user-content-52-ordinary-least-squares-ols-orthogonality-condition\" class=\"anchor\" aria-label=\"Permalink: 5.2 Ordinary Least Squares (OLS) Orthogonality Condition\" href=\"#52-ordinary-least-squares-ols-orthogonality-condition\"><svg data-component=\"Octicon\" class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"><\/path><\/svg><\/a><\/div>\n<p dir=\"auto\">From the OLS normal equations <math-renderer class=\"js-inline-math\" style=\"display: inline-block\" data-run-id=\"a13011b2b8de9dd89048f2ab6e525db2\">$X^T(y - X\\hat{\\beta}) = 0$<\/math-renderer>, every column of the\ndesign matrix <math-renderer class=\"js-inline-math\" style=\"display: inline-block\" data-run-id=\"a13011b2b8de9dd89048f2ab6e525db2\">$X$<\/math-renderer> is orthogonal to the residual vector <math-renderer class=\"js-inline-math\" style=\"display: inline-block\" data-run-id=\"a13011b2b8de9dd89048f2ab6e525db2\">$e$<\/math-renderer>:<\/p>\n<p dir=\"auto\"><math-renderer class=\"js-display-math\" style=\"display: block\" data-run-id=\"a13011b2b8de9dd89048f2ab6e525db2\">$$\\sum_{i=1}^n \\hat{y}_i \\cdot e_i = \\hat{\\beta}^T X^T e = 0$$<\/math-renderer><\/p>\n<p dir=\"auto\">The fitted-value vector and the residual vector are orthogonal. This holds\nregardless of whether the model includes an intercept.<\/p>\n<div class=\"markdown-heading\" dir=\"auto\"><h3 class=\"heading-element\" dir=\"auto\">5.3 Uncentered Decomposition<\/h3><a id=\"user-content-53-uncentered-decomposition\" class=\"anchor\" aria-label=\"Permalink: 5.3 Uncentered Decomposition\" href=\"#53-uncentered-decomposition\"><svg data-component=\"Octicon\" class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"><\/path><\/svg><\/a><\/div>\n<p dir=\"auto\">Squaring <math-renderer class=\"js-inline-math\" style=\"display: inline-block\" data-run-id=\"a13011b2b8de9dd89048f2ab6e525db2\">$y_i = \\hat{y}_i + e_i$<\/math-renderer> and summing over <math-renderer class=\"js-inline-math\" style=\"display: inline-block\" data-run-id=\"a13011b2b8de9dd89048f2ab6e525db2\">$i$<\/math-renderer>:<\/p>\n<p dir=\"auto\"><math-renderer class=\"js-display-math\" style=\"display: block\" data-run-id=\"a13011b2b8de9dd89048f2ab6e525db2\">$$\\sum y_i^2 = \\sum \\hat{y}_i^2 + 2\\sum \\hat{y}_i e_i + \\sum e_i^2$$<\/math-renderer><\/p>\n<p dir=\"auto\">The cross term vanishes by orthogonality <math-renderer class=\"js-inline-math\" style=\"display: inline-block\" data-run-id=\"a13011b2b8de9dd89048f2ab6e525db2\">$\\sum \\hat{y}_i e_i = 0$<\/math-renderer>, leaving:<\/p>\n<p dir=\"auto\"><math-renderer class=\"js-display-math\" style=\"display: block\" data-run-id=\"a13011b2b8de9dd89048f2ab6e525db2\">$$\\sum y_i^2 = \\sum \\hat{y}_i^2 + \\sum e_i^2 \\quad \\Longleftrightarrow \\quad TSS_u = ESS_u + RSS$$<\/math-renderer><\/p>\n<div class=\"markdown-heading\" dir=\"auto\"><h3 class=\"heading-element\" dir=\"auto\">5.4 Definition of Uncentered R\u00b2<\/h3><a id=\"user-content-54-definition-of-uncentered-r\" class=\"anchor\" aria-label=\"Permalink: 5.4 Definition of Uncentered R\u00b2\" href=\"#54-definition-of-uncentered-r\"><svg data-component=\"Octicon\" class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"><\/path><\/svg><\/a><\/div>\n<p dir=\"auto\">Dividing both sides by <math-renderer class=\"js-inline-math\" style=\"display: inline-block\" data-run-id=\"a13011b2b8de9dd89048f2ab6e525db2\">$TSS_u$<\/math-renderer> gives <math-renderer class=\"js-inline-math\" style=\"display: inline-block\" data-run-id=\"a13011b2b8de9dd89048f2ab6e525db2\">$1 = ESS_u\/TSS_u + RSS\/TSS_u$<\/math-renderer>.<\/p>\n<blockquote>\n<p dir=\"auto\"><strong>Definition: Uncentered R\u00b2<\/strong><br>\nUncentered R\u00b2 is the ratio of the sum of squares explained by the model, <math-renderer class=\"js-inline-math\" style=\"display: inline-block\" data-run-id=\"a13011b2b8de9dd89048f2ab6e525db2\">$ESS_u$<\/math-renderer>, to the total sum of squares around zero, <math-renderer class=\"js-inline-math\" style=\"display: inline-block\" data-run-id=\"a13011b2b8de9dd89048f2ab6e525db2\">$TSS_u$<\/math-renderer>.<\/p>\n<\/blockquote>\n<p dir=\"auto\"><math-renderer class=\"js-display-math\" style=\"display: block\" data-run-id=\"a13011b2b8de9dd89048f2ab6e525db2\">$$R^2_u \\equiv \\frac{ESS_u}{TSS_u} = \\frac{\\sum \\hat{y}_i^2}{\\sum y_i^2} = 1 - \\frac{\\sum(y_i - \\hat{y}_i)^2}{\\sum y_i^2}$$<\/math-renderer><\/p>\n<div class=\"markdown-heading\" dir=\"auto\"><h3 class=\"heading-element\" dir=\"auto\">5.5 Relation to Centered R\u00b2<\/h3><a id=\"user-content-55-relation-to-centered-r\" class=\"anchor\" aria-label=\"Permalink: 5.5 Relation to Centered R\u00b2\" href=\"#55-relation-to-centered-r\"><svg data-component=\"Octicon\" class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"><\/path><\/svg><\/a><\/div>\n<p dir=\"auto\">Since <math-renderer class=\"js-inline-math\" style=\"display: inline-block\" data-run-id=\"a13011b2b8de9dd89048f2ab6e525db2\">$\\sum y_i^2 = \\sum (y_i - \\bar{y})^2 + n\\bar{y}^2$<\/math-renderer>, we have\n<math-renderer class=\"js-inline-math\" style=\"display: inline-block\" data-run-id=\"a13011b2b8de9dd89048f2ab6e525db2\">$TSS_u = TSS_c + n\\bar{y}^2$<\/math-renderer>. For an intercept-included model:<\/p>\n<p dir=\"auto\"><math-renderer class=\"js-display-math\" style=\"display: block\" data-run-id=\"a13011b2b8de9dd89048f2ab6e525db2\">$$R^2_u = \\frac{TSS_c \\cdot R^2_c + n\\bar{y}^2}{TSS_c + n\\bar{y}^2}$$<\/math-renderer><\/p>\n<p dir=\"auto\">When <math-renderer class=\"js-inline-math\" style=\"display: inline-block\" data-run-id=\"a13011b2b8de9dd89048f2ab6e525db2\">$\\bar{y}$<\/math-renderer> is large or <math-renderer class=\"js-inline-math\" style=\"display: inline-block\" data-run-id=\"a13011b2b8de9dd89048f2ab6e525db2\">$n$<\/math-renderer> is large, <math-renderer class=\"js-inline-math\" style=\"display: inline-block\" data-run-id=\"a13011b2b8de9dd89048f2ab6e525db2\">$R^2_u$<\/math-renderer> moves closer to 1 than <math-renderer class=\"js-inline-math\" style=\"display: inline-block\" data-run-id=\"a13011b2b8de9dd89048f2ab6e525db2\">$R^2_c$<\/math-renderer>.\nWhen <math-renderer class=\"js-inline-math\" style=\"display: inline-block\" data-run-id=\"a13011b2b8de9dd89048f2ab6e525db2\">$\\bar{y} = 0$<\/math-renderer>, the two coincide.<\/p>\n<div class=\"markdown-heading\" dir=\"auto\"><h2 class=\"heading-element\" dir=\"auto\">6. Geometric Interpretation<\/h2><a id=\"user-content-6-geometric-interpretation\" class=\"anchor\" aria-label=\"Permalink: 6. Geometric Interpretation\" href=\"#6-geometric-interpretation\"><svg data-component=\"Octicon\" class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"><\/path><\/svg><\/a><\/div>\n<div class=\"markdown-heading\" dir=\"auto\"><h3 class=\"heading-element\" dir=\"auto\">6.1 Vector Space Setup<\/h3><a id=\"user-content-61-vector-space-setup\" class=\"anchor\" aria-label=\"Permalink: 6.1 Vector Space Setup\" href=\"#61-vector-space-setup\"><svg data-component=\"Octicon\" class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"><\/path><\/svg><\/a><\/div>\n<p dir=\"auto\">Treating the <math-renderer class=\"js-inline-math\" style=\"display: inline-block\" data-run-id=\"a13011b2b8de9dd89048f2ab6e525db2\">$n$<\/math-renderer> observations as vectors\n<math-renderer class=\"js-inline-math\" style=\"display: inline-block\" data-run-id=\"a13011b2b8de9dd89048f2ab6e525db2\">$\\mathbf{y}, \\hat{\\mathbf{y}}, \\mathbf{e} = \\mathbf{y} - \\hat{\\mathbf{y}} \\in \\mathbb{R}^n$<\/math-renderer>,\nevery sum of squares becomes a squared norm: <math-renderer class=\"js-inline-math\" style=\"display: inline-block\" data-run-id=\"a13011b2b8de9dd89048f2ab6e525db2\">$\\sum y_i^2 = |\\mathbf{y}|^2$<\/math-renderer>,\n<math-renderer class=\"js-inline-math\" style=\"display: inline-block\" data-run-id=\"a13011b2b8de9dd89048f2ab6e525db2\">$\\sum \\hat{y}_i^2 = |\\hat{\\mathbf{y}}|^2$<\/math-renderer>, <math-renderer class=\"js-inline-math\" style=\"display: inline-block\" data-run-id=\"a13011b2b8de9dd89048f2ab6e525db2\">$\\sum e_i^2 = |\\mathbf{e}|^2$<\/math-renderer>.<\/p>\n<div class=\"markdown-heading\" dir=\"auto\"><h3 class=\"heading-element\" dir=\"auto\">6.2 OLS as Orthogonal Projection<\/h3><a id=\"user-content-62-ols-as-orthogonal-projection\" class=\"anchor\" aria-label=\"Permalink: 6.2 OLS as Orthogonal Projection\" href=\"#62-ols-as-orthogonal-projection\"><svg data-component=\"Octicon\" class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"><\/path><\/svg><\/a><\/div>\n<p dir=\"auto\">Let <math-renderer class=\"js-inline-math\" style=\"display: inline-block\" data-run-id=\"a13011b2b8de9dd89048f2ab6e525db2\">$\\mathcal{C}(X)$<\/math-renderer> denote the column space of the design matrix <math-renderer class=\"js-inline-math\" style=\"display: inline-block\" data-run-id=\"a13011b2b8de9dd89048f2ab6e525db2\">$X$<\/math-renderer>. The OLS\nestimate is <math-renderer class=\"js-inline-math\" style=\"display: inline-block\" data-run-id=\"a13011b2b8de9dd89048f2ab6e525db2\">$\\hat{\\mathbf{y}} = P_X \\mathbf{y}$<\/math-renderer> with\n<math-renderer class=\"js-inline-math\" style=\"display: inline-block\" data-run-id=\"a13011b2b8de9dd89048f2ab6e525db2\">$P_X = X(X^TX)^{-1}X^T$<\/math-renderer>, the orthogonal projection of <math-renderer class=\"js-inline-math\" style=\"display: inline-block\" data-run-id=\"a13011b2b8de9dd89048f2ab6e525db2\">$\\mathbf{y}$<\/math-renderer> onto\n<math-renderer class=\"js-inline-math\" style=\"display: inline-block\" data-run-id=\"a13011b2b8de9dd89048f2ab6e525db2\">$\\mathcal{C}(X)$<\/math-renderer>. The residual <math-renderer class=\"js-inline-math\" style=\"display: inline-block\" data-run-id=\"a13011b2b8de9dd89048f2ab6e525db2\">$\\mathbf{e}$<\/math-renderer> lies in the orthogonal complement,\nautomatically satisfying <math-renderer class=\"js-inline-math\" style=\"display: inline-block\" data-run-id=\"a13011b2b8de9dd89048f2ab6e525db2\">$\\mathbf{e} \\perp \\hat{\\mathbf{y}}$<\/math-renderer> [<a href=\"#ref-5\">5<\/a>].<\/p>\n<div class=\"markdown-heading\" dir=\"auto\"><h3 class=\"heading-element\" dir=\"auto\">6.3 Uncentered Decomposition as the Pythagorean Theorem<\/h3><a id=\"user-content-63-uncentered-decomposition-as-the-pythagorean-theorem\" class=\"anchor\" aria-label=\"Permalink: 6.3 Uncentered Decomposition as the Pythagorean Theorem\" href=\"#63-uncentered-decomposition-as-the-pythagorean-theorem\"><svg data-component=\"Octicon\" class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"><\/path><\/svg><\/a><\/div>\n<p dir=\"auto\">Since <math-renderer class=\"js-inline-math\" style=\"display: inline-block\" data-run-id=\"a13011b2b8de9dd89048f2ab6e525db2\">$\\mathbf{y} = \\hat{\\mathbf{y}} + \\mathbf{e}$<\/math-renderer> and\n<math-renderer class=\"js-inline-math\" style=\"display: inline-block\" data-run-id=\"a13011b2b8de9dd89048f2ab6e525db2\">$\\hat{\\mathbf{y}} \\perp \\mathbf{e}$<\/math-renderer>, a right triangle is formed:<\/p>\n<div class=\"snippet-clipboard-content notranslate position-relative overflow-auto\" data-snippet-clipboard-copy-content=\"              y\n             \/|\n            \/ |\n           \/  |  e  (perpendicular residual)\n          \/   |\n         \/____|\n      origin  \u0177  (on the C(X) plane)\"><pre lang=\"text\" class=\"notranslate\"><code>              y\n             \/|\n            \/ |\n           \/  |  e  (perpendicular residual)\n          \/   |\n         \/____|\n      origin  \u0177  (on the C(X) plane)\n<\/code><\/pre><\/div>\n<p dir=\"auto\"><math-renderer class=\"js-display-math\" style=\"display: block\" data-run-id=\"a13011b2b8de9dd89048f2ab6e525db2\">$$|\\mathbf{y}|^2 = |\\hat{\\mathbf{y}}|^2 + |\\mathbf{e}|^2$$<\/math-renderer><\/p>\n<p dir=\"auto\">This is the geometric identity behind <math-renderer class=\"js-inline-math\" style=\"display: inline-block\" data-run-id=\"a13011b2b8de9dd89048f2ab6e525db2\">$TSS_u = ESS_u + RSS$<\/math-renderer> \u2014 not merely an\nalgebraic identity, but literally the Pythagorean theorem. The geometric meaning\nof uncentered R\u00b2 becomes:<\/p>\n<p dir=\"auto\"><math-renderer class=\"js-display-math\" style=\"display: block\" data-run-id=\"a13011b2b8de9dd89048f2ab6e525db2\">$$R^2_u = \\frac{|\\hat{\\mathbf{y}}|^2}{|\\mathbf{y}|^2} = \\cos^2\\theta_u$$<\/math-renderer><\/p>\n<p dir=\"auto\">where <math-renderer class=\"js-inline-math\" style=\"display: inline-block\" data-run-id=\"a13011b2b8de9dd89048f2ab6e525db2\">$\\theta_u$<\/math-renderer> is the angle between <math-renderer class=\"js-inline-math\" style=\"display: inline-block\" data-run-id=\"a13011b2b8de9dd89048f2ab6e525db2\">$\\mathbf{y}$<\/math-renderer> and <math-renderer class=\"js-inline-math\" style=\"display: inline-block\" data-run-id=\"a13011b2b8de9dd89048f2ab6e525db2\">$\\hat{\\mathbf{y}}$<\/math-renderer>\nmeasured from the origin. <math-renderer class=\"js-inline-math\" style=\"display: inline-block\" data-run-id=\"a13011b2b8de9dd89048f2ab6e525db2\">$R^2_u \\to 1$<\/math-renderer> means the two vectors point in the same\ndirection; <math-renderer class=\"js-inline-math\" style=\"display: inline-block\" data-run-id=\"a13011b2b8de9dd89048f2ab6e525db2\">$R^2_u \\to 0$<\/math-renderer> means they are orthogonal.<\/p>\n<div class=\"markdown-heading\" dir=\"auto\"><h3 class=\"heading-element\" dir=\"auto\">6.4 Centered R\u00b2: Subtracting the Mean Vector<\/h3><a id=\"user-content-64-centered-r-subtracting-the-mean-vector\" class=\"anchor\" aria-label=\"Permalink: 6.4 Centered R\u00b2: Subtracting the Mean Vector\" href=\"#64-centered-r-subtracting-the-mean-vector\"><svg data-component=\"Octicon\" class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"><\/path><\/svg><\/a><\/div>\n<p dir=\"auto\">Subtracting the mean vector <math-renderer class=\"js-inline-math\" style=\"display: inline-block\" data-run-id=\"a13011b2b8de9dd89048f2ab6e525db2\">$\\bar{\\mathbf{y}} = \\bar{y} \\cdot \\mathbf{1}$<\/math-renderer> is\ngeometrically equivalent to projecting onto the hyperplane <math-renderer class=\"js-inline-math\" style=\"display: inline-block\" data-run-id=\"a13011b2b8de9dd89048f2ab6e525db2\">$\\mathbf{1}^\\perp$<\/math-renderer>,\nwhich removes the component along the constant vector <math-renderer class=\"js-inline-math\" style=\"display: inline-block\" data-run-id=\"a13011b2b8de9dd89048f2ab6e525db2\">$\\mathbf{1}$<\/math-renderer>. When the\nmodel contains an intercept, <math-renderer class=\"js-inline-math\" style=\"display: inline-block\" data-run-id=\"a13011b2b8de9dd89048f2ab6e525db2\">$\\mathbf{1} \\in \\mathcal{C}(X)$<\/math-renderer>, so a right\ntriangle still forms within <math-renderer class=\"js-inline-math\" style=\"display: inline-block\" data-run-id=\"a13011b2b8de9dd89048f2ab6e525db2\">$\\mathbf{1}^\\perp$<\/math-renderer>:<\/p>\n<p dir=\"auto\"><math-renderer class=\"js-display-math\" style=\"display: block\" data-run-id=\"a13011b2b8de9dd89048f2ab6e525db2\">$$R^2_c = \\frac{|\\tilde{\\hat{\\mathbf{y}}}|^2}{|\\tilde{\\mathbf{y}}|^2} = \\cos^2\\theta_c$$<\/math-renderer><\/p>\n<p dir=\"auto\">where <math-renderer class=\"js-inline-math\" style=\"display: inline-block\" data-run-id=\"a13011b2b8de9dd89048f2ab6e525db2\">$\\theta_c$<\/math-renderer> is the angle between the two vectors after the mean has been\nremoved \u2014 equivalent to the squared Pearson correlation coefficient.<\/p>\n<div class=\"markdown-heading\" dir=\"auto\"><h3 class=\"heading-element\" dir=\"auto\">6.5 Geometric Distinction Between the Two R\u00b2<\/h3><a id=\"user-content-65-geometric-distinction-between-the-two-r\" class=\"anchor\" aria-label=\"Permalink: 6.5 Geometric Distinction Between the Two R\u00b2\" href=\"#65-geometric-distinction-between-the-two-r\"><svg data-component=\"Octicon\" class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"><\/path><\/svg><\/a><\/div>\n<div class=\"snippet-clipboard-content notranslate position-relative overflow-auto\" data-snippet-clipboard-copy-content=\"              y\n             \/|\n            \/ |\n           \/  |\n          \/   | e\n         \/    |\n        \/     |\n       *------\u0177-----\u2192 (C(X) plane)\n   origin\n     \/\n    *\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 1 direction (constant vector)\n    \u0233\u00b71\"><pre lang=\"text\" class=\"notranslate\"><code>              y\n             \/|\n            \/ |\n           \/  |\n          \/   | e\n         \/    |\n        \/     |\n       *------\u0177-----\u2192 (C(X) plane)\n   origin\n     \/\n    *\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 1 direction (constant vector)\n    \u0233\u00b71\n<\/code><\/pre><\/div>\n<ul dir=\"auto\">\n<li>\n<strong>Uncentered R\u00b2<\/strong>: angle between <math-renderer class=\"js-inline-math\" style=\"display: inline-block\" data-run-id=\"a13011b2b8de9dd89048f2ab6e525db2\">$\\mathbf{y}$<\/math-renderer> and <math-renderer class=\"js-inline-math\" style=\"display: inline-block\" data-run-id=\"a13011b2b8de9dd89048f2ab6e525db2\">$\\hat{\\mathbf{y}}$<\/math-renderer> measured\nfrom the origin.<\/li>\n<li>\n<strong>Centered R\u00b2<\/strong>: angle measured after shifting the reference point to\n<math-renderer class=\"js-inline-math\" style=\"display: inline-block\" data-run-id=\"a13011b2b8de9dd89048f2ab6e525db2\">$\\bar{y}\\cdot\\mathbf{1}$<\/math-renderer>.<\/li>\n<\/ul>\n<p dir=\"auto\">The fundamental distinction is whether the reference point is the origin or the\nmean vector. The same data, viewed from different reference points, yields\ndifferent angles between the two vectors.<\/p>\n<div class=\"markdown-heading\" dir=\"auto\"><h3 class=\"heading-element\" dir=\"auto\">6.6 Comparison Table<\/h3><a id=\"user-content-66-comparison-table\" class=\"anchor\" aria-label=\"Permalink: 6.6 Comparison Table\" href=\"#66-comparison-table\"><svg data-component=\"Octicon\" class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"><\/path><\/svg><\/a><\/div>\n<p dir=\"auto\">Table 1. Geometric distinction between uncentered and centered R\u00b2<\/p>\n<markdown-accessiblity-table><table>\n<thead>\n<tr>\n<th>Aspect<\/th>\n<th>Uncentered<\/th>\n<th>Centered<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>Reference point<\/td>\n<td>Origin 0<\/td>\n<td>Mean vector \u0233\u00b71<\/td>\n<\/tr>\n<tr>\n<td>Right triangle<\/td>\n<td>y, \u0177, e<\/td>\n<td>\u1ef9, \u0177\u0303, e<\/td>\n<\/tr>\n<tr>\n<td>Angle interpretation<\/td>\n<td>cos\u00b2(\u2220y\u0177)<\/td>\n<td>cos\u00b2(\u2220\u1ef9\u0177\u0303) = r\u00b2<\/td>\n<\/tr>\n<tr>\n<td>Required condition<\/td>\n<td>e \u22a5 \u0177<\/td>\n<td>e \u22a5 \u0177 and 1 \u2208 C(X)<\/td>\n<\/tr>\n<tr>\n<td>Sensitivity to bias<\/td>\n<td>Sensitive (origin-fixed)<\/td>\n<td>Insensitive (mean-shift invariant)<\/td>\n<\/tr>\n<\/tbody>\n<\/table><\/markdown-accessiblity-table>\n<p dir=\"auto\"><strong>Geometric meaning of 1:1-line validation<\/strong>: Under a constant bias\n<math-renderer class=\"js-inline-math\" style=\"display: inline-block\" data-run-id=\"a13011b2b8de9dd89048f2ab6e525db2\">$\\hat{\\mathbf{y}} = \\mathbf{y} + c\\mathbf{1}$<\/math-renderer>, the uncentered angle widens but\nthe centered angle remains unchanged. Therefore, for evaluating absolute\nagreement, uncentered R\u00b2 responds more sensitively.<\/p>\n<div class=\"markdown-heading\" dir=\"auto\"><h2 class=\"heading-element\" dir=\"auto\">References<\/h2><a id=\"user-content-references\" class=\"anchor\" aria-label=\"Permalink: References\" href=\"#references\"><svg data-component=\"Octicon\" class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"><\/path><\/svg><\/a><\/div>\n<p dir=\"auto\"><a id=\"user-content-ref-1\"><\/a>[1] Draper, N. R., &amp; Smith, H. (1998). <a href=\"https:\/\/doi.org\/10.1002\/9781118625590\" rel=\"nofollow\"><em>Applied Regression Analysis<\/em><\/a> (3rd ed.). Wiley.<br>\n<a id=\"user-content-ref-2\"><\/a>[2] Eisenhauer, J. G. (2003). <a href=\"https:\/\/doi.org\/10.1111\/1467-9639.00136\" rel=\"nofollow\">Regression through the origin<\/a>. <em>Teaching Statistics<\/em>, 25(3), 76\u201380.<br>\n<a id=\"user-content-ref-3\"><\/a>[3] Kvalseth, T. O. (1985). <a href=\"https:\/\/doi.org\/10.1080\/00031305.1985.10479448\" rel=\"nofollow\">Cautionary note about R\u00b2<\/a>. <em>The American Statistician<\/em>, 39(4), 279\u2013285.<br>\n<a id=\"user-content-ref-4\"><\/a>[4] Legates, D. R., &amp; McCabe, G. J. (1999). <a href=\"https:\/\/doi.org\/10.1029\/1998WR900018\" rel=\"nofollow\">Evaluating the use of \"goodness-of-fit\" measures in hydrologic and hydroclimatic model validation<\/a>. <em>Water Resources Research<\/em>, 35(1), 233\u2013241.<br>\n<a id=\"user-content-ref-5\"><\/a>[5] Strang, G. (2009). <a href=\"https:\/\/wellesleycambridge.com\/\" rel=\"nofollow\"><em>Introduction to Linear Algebra<\/em><\/a> (4th ed.). Wellesley-Cambridge Press. ISBN 978-0-9802327-1-4.<br>\n<a id=\"user-content-ref-6\"><\/a>[6] Wooldridge, J. M. (2010). <a href=\"https:\/\/mitpress.mit.edu\/9780262232586\/econometric-analysis-of-cross-section-and-panel-data\/\" rel=\"nofollow\"><em>Econometric Analysis of Cross Section and Panel Data<\/em><\/a> (2nd ed.). MIT Press. ISBN 978-0-262-23258-6.<\/p>\n<hr>\n<div class=\"markdown-heading\" dir=\"auto\"><h2 class=\"heading-element\" dir=\"auto\">Appendix A. Terminology<\/h2><a id=\"user-content-appendix-a-terminology\" class=\"anchor\" aria-label=\"Permalink: Appendix A. Terminology\" href=\"#appendix-a-terminology\"><svg data-component=\"Octicon\" class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"><\/path><\/svg><\/a><\/div>\n<ul dir=\"auto\">\n<li>\n<strong>centered R\u00b2<\/strong>: the standard R\u00b2, whose denominator is the sum of squares about the mean of the data.<\/li>\n<li>\n<strong>CFD<\/strong>: Computational Fluid Dynamics, the numerical simulation of fluid flow.<\/li>\n<li>\n<strong>ESS<\/strong>: Explained Sum of Squares. In uncentered form, <math-renderer class=\"js-inline-math\" style=\"display: inline-block\" data-run-id=\"a13011b2b8de9dd89048f2ab6e525db2\">$\\sum \\hat{y}_i^2$<\/math-renderer>.<\/li>\n<li>\n<strong>FEM<\/strong>: Finite Element Method, the numerical solution of field problems on a discretized domain.<\/li>\n<li>\n<strong>MAE<\/strong>: Mean Absolute Error, the mean of the absolute residuals.<\/li>\n<li>\n<strong>MAPE<\/strong>: Mean Absolute Percentage Error, the mean absolute residual expressed as a percentage of the observation. Undefined where an observation is zero.<\/li>\n<li>\n<strong>OLS<\/strong>: Ordinary Least Squares, the estimator that minimizes the sum of squared residuals.<\/li>\n<li>\n<strong>RMSE<\/strong>: Root Mean Squared Error, the square root of the mean squared residual.<\/li>\n<li>\n<strong>RSQ<\/strong>: the Excel function name for the squared Pearson correlation coefficient, which equals the centered R\u00b2.<\/li>\n<li>\n<strong>RSS<\/strong>: Residual Sum of Squares, <math-renderer class=\"js-inline-math\" style=\"display: inline-block\" data-run-id=\"a13011b2b8de9dd89048f2ab6e525db2\">$\\sum e_i^2$<\/math-renderer>.<\/li>\n<li>\n<strong>RTO<\/strong>: Regression Through the Origin, a regression whose intercept is fixed to zero.<\/li>\n<li>\n<strong>TSS<\/strong>: Total Sum of Squares. In uncentered form, <math-renderer class=\"js-inline-math\" style=\"display: inline-block\" data-run-id=\"a13011b2b8de9dd89048f2ab6e525db2\">$\\sum y_i^2$<\/math-renderer>; in centered form, <math-renderer class=\"js-inline-math\" style=\"display: inline-block\" data-run-id=\"a13011b2b8de9dd89048f2ab6e525db2\">$\\sum (y_i - \\bar{y})^2$<\/math-renderer>.<\/li>\n<li>\n<strong>uncentered R\u00b2<\/strong>: the R\u00b2 whose denominator is the sum of squares about zero rather than about the mean.<\/li>\n<\/ul>\n<div class=\"markdown-heading\" dir=\"auto\"><h2 class=\"heading-element\" dir=\"auto\">Appendix B. Python Code<\/h2><a id=\"user-content-appendix-b-python-code\" class=\"anchor\" aria-label=\"Permalink: Appendix B. Python Code\" href=\"#appendix-b-python-code\"><svg data-component=\"Octicon\" class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"><\/path><\/svg><\/a><\/div>\n<div class=\"markdown-heading\" dir=\"auto\"><h3 class=\"heading-element\" dir=\"auto\">B.1 Centered R\u00b2<\/h3><a id=\"user-content-b1-centered-r\" class=\"anchor\" aria-label=\"Permalink: B.1 Centered R\u00b2\" href=\"#b1-centered-r\"><svg data-component=\"Octicon\" class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"><\/path><\/svg><\/a><\/div>\n<div class=\"highlight highlight-source-python notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"import numpy as np\n\n\ndef centered_r2(y_true, y_pred):\n    &quot;&quot;&quot;\n    Centered R\u00b2 (standard R\u00b2)\n    R\u00b2_c = 1 - SSE \/ SST_centered\n    &quot;&quot;&quot;\n    y_true = np.asarray(y_true, dtype=float)\n    y_pred = np.asarray(y_pred, dtype=float)\n\n    sse = np.sum((y_true - y_pred) ** 2)\n    sst_c = np.sum((y_true - np.mean(y_true)) ** 2)\n\n    if sst_c == 0:\n        return np.nan  # undefined when y has zero variance\n    return 1.0 - sse \/ sst_c\n\n# Example usage\ny_true = np.array([10.1, 10.2, 10.3, 10.4, 10.5])\ny_pred = np.array([10.0, 10.3, 10.2, 10.5, 10.4])\n\nprint(f&quot;Centered R\u00b2:   {centered_r2(y_true, y_pred):.6f}&quot;)\n# Confirm equivalence with scikit-learn\nfrom sklearn.metrics import r2_score\nprint(f&quot;sklearn r2:    {r2_score(y_true, y_pred):.6f}&quot;)\"><pre><span class=\"pl-k\">import<\/span> <span class=\"pl-s1\">numpy<\/span> <span class=\"pl-k\">as<\/span> <span class=\"pl-s1\">np<\/span>\n\n\n<span class=\"pl-k\">def<\/span> <span class=\"pl-en\">centered_r2<\/span>(<span class=\"pl-s1\">y_true<\/span>, <span class=\"pl-s1\">y_pred<\/span>):\n    <span class=\"pl-s\">\"\"\"<\/span>\n<span class=\"pl-s\">    Centered R\u00b2 (standard R\u00b2)<\/span>\n<span class=\"pl-s\">    R\u00b2_c = 1 - SSE \/ SST_centered<\/span>\n<span class=\"pl-s\">    \"\"\"<\/span>\n    <span class=\"pl-s1\">y_true<\/span> <span class=\"pl-c1\">=<\/span> <span class=\"pl-s1\">np<\/span>.<span class=\"pl-c1\">asarray<\/span>(<span class=\"pl-s1\">y_true<\/span>, <span class=\"pl-s1\">dtype<\/span><span class=\"pl-c1\">=<\/span><span class=\"pl-s1\">float<\/span>)\n    <span class=\"pl-s1\">y_pred<\/span> <span class=\"pl-c1\">=<\/span> <span class=\"pl-s1\">np<\/span>.<span class=\"pl-c1\">asarray<\/span>(<span class=\"pl-s1\">y_pred<\/span>, <span class=\"pl-s1\">dtype<\/span><span class=\"pl-c1\">=<\/span><span class=\"pl-s1\">float<\/span>)\n\n    <span class=\"pl-s1\">sse<\/span> <span class=\"pl-c1\">=<\/span> <span class=\"pl-s1\">np<\/span>.<span class=\"pl-c1\">sum<\/span>((<span class=\"pl-s1\">y_true<\/span> <span class=\"pl-c1\">-<\/span> <span class=\"pl-s1\">y_pred<\/span>) <span class=\"pl-c1\">**<\/span> <span class=\"pl-c1\">2<\/span>)\n    <span class=\"pl-s1\">sst_c<\/span> <span class=\"pl-c1\">=<\/span> <span class=\"pl-s1\">np<\/span>.<span class=\"pl-c1\">sum<\/span>((<span class=\"pl-s1\">y_true<\/span> <span class=\"pl-c1\">-<\/span> <span class=\"pl-s1\">np<\/span>.<span class=\"pl-c1\">mean<\/span>(<span class=\"pl-s1\">y_true<\/span>)) <span class=\"pl-c1\">**<\/span> <span class=\"pl-c1\">2<\/span>)\n\n    <span class=\"pl-k\">if<\/span> <span class=\"pl-s1\">sst_c<\/span> <span class=\"pl-c1\">==<\/span> <span class=\"pl-c1\">0<\/span>:\n        <span class=\"pl-k\">return<\/span> <span class=\"pl-s1\">np<\/span>.<span class=\"pl-c1\">nan<\/span>  <span class=\"pl-c\"># undefined when y has zero variance<\/span>\n    <span class=\"pl-k\">return<\/span> <span class=\"pl-c1\">1.0<\/span> <span class=\"pl-c1\">-<\/span> <span class=\"pl-s1\">sse<\/span> <span class=\"pl-c1\">\/<\/span> <span class=\"pl-s1\">sst_c<\/span>\n\n<span class=\"pl-c\"># Example usage<\/span>\n<span class=\"pl-s1\">y_true<\/span> <span class=\"pl-c1\">=<\/span> <span class=\"pl-s1\">np<\/span>.<span class=\"pl-c1\">array<\/span>(&#91;<span class=\"pl-c1\">10.1<\/span>, <span class=\"pl-c1\">10.2<\/span>, <span class=\"pl-c1\">10.3<\/span>, <span class=\"pl-c1\">10.4<\/span>, <span class=\"pl-c1\">10.5<\/span>&#93;)\n<span class=\"pl-s1\">y_pred<\/span> <span class=\"pl-c1\">=<\/span> <span class=\"pl-s1\">np<\/span>.<span class=\"pl-c1\">array<\/span>(&#91;<span class=\"pl-c1\">10.0<\/span>, <span class=\"pl-c1\">10.3<\/span>, <span class=\"pl-c1\">10.2<\/span>, <span class=\"pl-c1\">10.5<\/span>, <span class=\"pl-c1\">10.4<\/span>&#93;)\n\n<span class=\"pl-en\">print<\/span>(<span class=\"pl-s\">f\"Centered R\u00b2:   <span class=\"pl-s1\"><span class=\"pl-kos\">{<\/span><span class=\"pl-en\">centered_r2<\/span>(<span class=\"pl-s1\">y_true<\/span>, <span class=\"pl-s1\">y_pred<\/span>):.6f<span class=\"pl-kos\">}<\/span><\/span>\"<\/span>)\n<span class=\"pl-c\"># Confirm equivalence with scikit-learn<\/span>\n<span class=\"pl-k\">from<\/span> <span class=\"pl-s1\">sklearn<\/span>.<span class=\"pl-s1\">metrics<\/span> <span class=\"pl-k\">import<\/span> <span class=\"pl-s1\">r2_score<\/span>\n<span class=\"pl-en\">print<\/span>(<span class=\"pl-s\">f\"sklearn r2:    <span class=\"pl-s1\"><span class=\"pl-kos\">{<\/span><span class=\"pl-en\">r2_score<\/span>(<span class=\"pl-s1\">y_true<\/span>, <span class=\"pl-s1\">y_pred<\/span>):.6f<span class=\"pl-kos\">}<\/span><\/span>\"<\/span>)<\/pre><\/div>\n<div class=\"markdown-heading\" dir=\"auto\"><h3 class=\"heading-element\" dir=\"auto\">B.2 Uncentered R\u00b2<\/h3><a id=\"user-content-b2-uncentered-r\" class=\"anchor\" aria-label=\"Permalink: B.2 Uncentered R\u00b2\" href=\"#b2-uncentered-r\"><svg data-component=\"Octicon\" class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"><\/path><\/svg><\/a><\/div>\n<div class=\"highlight highlight-source-python notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"def uncentered_r2(y_true, y_pred):\n    &quot;&quot;&quot;\n    Uncentered R\u00b2 (origin-based R\u00b2)\n    R\u00b2_u = 1 - SSE \/ SST_uncentered\n         = \u27e8\u0177, \u0177\u27e9 \/ \u27e8y, y\u27e9  (when e \u22a5 \u0177)\n    &quot;&quot;&quot;\n    y_true = np.asarray(y_true, dtype=float)\n    y_pred = np.asarray(y_pred, dtype=float)\n\n    sse = np.sum((y_true - y_pred) ** 2)\n    sst_u = np.sum(y_true ** 2)\n\n    if sst_u == 0:\n        return np.nan\n    return 1.0 - sse \/ sst_u\n\n# Example usage \u2014 comparing predictions on a same-physical-quantity scale (e.g., voltage)\ny_true = np.array([10.1, 10.2, 10.3, 10.4, 10.5])\ny_pred = np.array([10.0, 10.3, 10.2, 10.5, 10.4])\n\nprint(f&quot;Uncentered R\u00b2: {uncentered_r2(y_true, y_pred):.6f}&quot;)\n\n# Constant-bias scenario: contrast between the two metrics\ny_pred_biased = y_true + 0.5  # all predictions offset by +0.5\nprint(f&quot;\\nConstant bias +0.5 scenario:&quot;)\nprint(f&quot;  Centered R\u00b2:   {centered_r2(y_true, y_pred_biased):.6f}  &quot;\n      f&quot;(insensitive to bias)&quot;)\nprint(f&quot;  Uncentered R\u00b2: {uncentered_r2(y_true, y_pred_biased):.6f}  &quot;\n      f&quot;(sensitive to bias)&quot;)\"><pre><span class=\"pl-k\">def<\/span> <span class=\"pl-en\">uncentered_r2<\/span>(<span class=\"pl-s1\">y_true<\/span>, <span class=\"pl-s1\">y_pred<\/span>):\n    <span class=\"pl-s\">\"\"\"<\/span>\n<span class=\"pl-s\">    Uncentered R\u00b2 (origin-based R\u00b2)<\/span>\n<span class=\"pl-s\">    R\u00b2_u = 1 - SSE \/ SST_uncentered<\/span>\n<span class=\"pl-s\">         = \u27e8\u0177, \u0177\u27e9 \/ \u27e8y, y\u27e9  (when e \u22a5 \u0177)<\/span>\n<span class=\"pl-s\">    \"\"\"<\/span>\n    <span class=\"pl-s1\">y_true<\/span> <span class=\"pl-c1\">=<\/span> <span class=\"pl-s1\">np<\/span>.<span class=\"pl-c1\">asarray<\/span>(<span class=\"pl-s1\">y_true<\/span>, <span class=\"pl-s1\">dtype<\/span><span class=\"pl-c1\">=<\/span><span class=\"pl-s1\">float<\/span>)\n    <span class=\"pl-s1\">y_pred<\/span> <span class=\"pl-c1\">=<\/span> <span class=\"pl-s1\">np<\/span>.<span class=\"pl-c1\">asarray<\/span>(<span class=\"pl-s1\">y_pred<\/span>, <span class=\"pl-s1\">dtype<\/span><span class=\"pl-c1\">=<\/span><span class=\"pl-s1\">float<\/span>)\n\n    <span class=\"pl-s1\">sse<\/span> <span class=\"pl-c1\">=<\/span> <span class=\"pl-s1\">np<\/span>.<span class=\"pl-c1\">sum<\/span>((<span class=\"pl-s1\">y_true<\/span> <span class=\"pl-c1\">-<\/span> <span class=\"pl-s1\">y_pred<\/span>) <span class=\"pl-c1\">**<\/span> <span class=\"pl-c1\">2<\/span>)\n    <span class=\"pl-s1\">sst_u<\/span> <span class=\"pl-c1\">=<\/span> <span class=\"pl-s1\">np<\/span>.<span class=\"pl-c1\">sum<\/span>(<span class=\"pl-s1\">y_true<\/span> <span class=\"pl-c1\">**<\/span> <span class=\"pl-c1\">2<\/span>)\n\n    <span class=\"pl-k\">if<\/span> <span class=\"pl-s1\">sst_u<\/span> <span class=\"pl-c1\">==<\/span> <span class=\"pl-c1\">0<\/span>:\n        <span class=\"pl-k\">return<\/span> <span class=\"pl-s1\">np<\/span>.<span class=\"pl-c1\">nan<\/span>\n    <span class=\"pl-k\">return<\/span> <span class=\"pl-c1\">1.0<\/span> <span class=\"pl-c1\">-<\/span> <span class=\"pl-s1\">sse<\/span> <span class=\"pl-c1\">\/<\/span> <span class=\"pl-s1\">sst_u<\/span>\n\n<span class=\"pl-c\"># Example usage \u2014 comparing predictions on a same-physical-quantity scale (e.g., voltage)<\/span>\n<span class=\"pl-s1\">y_true<\/span> <span class=\"pl-c1\">=<\/span> <span class=\"pl-s1\">np<\/span>.<span class=\"pl-c1\">array<\/span>(&#91;<span class=\"pl-c1\">10.1<\/span>, <span class=\"pl-c1\">10.2<\/span>, <span class=\"pl-c1\">10.3<\/span>, <span class=\"pl-c1\">10.4<\/span>, <span class=\"pl-c1\">10.5<\/span>&#93;)\n<span class=\"pl-s1\">y_pred<\/span> <span class=\"pl-c1\">=<\/span> <span class=\"pl-s1\">np<\/span>.<span class=\"pl-c1\">array<\/span>(&#91;<span class=\"pl-c1\">10.0<\/span>, <span class=\"pl-c1\">10.3<\/span>, <span class=\"pl-c1\">10.2<\/span>, <span class=\"pl-c1\">10.5<\/span>, <span class=\"pl-c1\">10.4<\/span>&#93;)\n\n<span class=\"pl-en\">print<\/span>(<span class=\"pl-s\">f\"Uncentered R\u00b2: <span class=\"pl-s1\"><span class=\"pl-kos\">{<\/span><span class=\"pl-en\">uncentered_r2<\/span>(<span class=\"pl-s1\">y_true<\/span>, <span class=\"pl-s1\">y_pred<\/span>):.6f<span class=\"pl-kos\">}<\/span><\/span>\"<\/span>)\n\n<span class=\"pl-c\"># Constant-bias scenario: contrast between the two metrics<\/span>\n<span class=\"pl-s1\">y_pred_biased<\/span> <span class=\"pl-c1\">=<\/span> <span class=\"pl-s1\">y_true<\/span> <span class=\"pl-c1\">+<\/span> <span class=\"pl-c1\">0.5<\/span>  <span class=\"pl-c\"># all predictions offset by +0.5<\/span>\n<span class=\"pl-en\">print<\/span>(<span class=\"pl-s\">f\"<span class=\"pl-cce\">\\n<\/span>Constant bias +0.5 scenario:\"<\/span>)\n<span class=\"pl-en\">print<\/span>(<span class=\"pl-s\">f\"  Centered R\u00b2:   <span class=\"pl-s1\"><span class=\"pl-kos\">{<\/span><span class=\"pl-en\">centered_r2<\/span>(<span class=\"pl-s1\">y_true<\/span>, <span class=\"pl-s1\">y_pred_biased<\/span>):.6f<span class=\"pl-kos\">}<\/span><\/span>  \"<\/span>\n      <span class=\"pl-s\">f\"(insensitive to bias)\"<\/span>)\n<span class=\"pl-en\">print<\/span>(<span class=\"pl-s\">f\"  Uncentered R\u00b2: <span class=\"pl-s1\"><span class=\"pl-kos\">{<\/span><span class=\"pl-en\">uncentered_r2<\/span>(<span class=\"pl-s1\">y_true<\/span>, <span class=\"pl-s1\">y_pred_biased<\/span>):.6f<span class=\"pl-kos\">}<\/span><\/span>  \"<\/span>\n      <span class=\"pl-s\">f\"(sensitive to bias)\"<\/span>)<\/pre><\/div>\n<div class=\"markdown-heading\" dir=\"auto\"><h3 class=\"heading-element\" dir=\"auto\">B.3 Integrated Evaluation for 1:1-Line Agreement<\/h3><a id=\"user-content-b3-integrated-evaluation-for-11-line-agreement\" class=\"anchor\" aria-label=\"Permalink: B.3 Integrated Evaluation for 1:1-Line Agreement\" href=\"#b3-integrated-evaluation-for-11-line-agreement\"><svg data-component=\"Octicon\" class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"><\/path><\/svg><\/a><\/div>\n<div class=\"highlight highlight-source-python notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"def evaluate_1_to_1_line_agreement(y_true, y_pred):\n    &quot;&quot;&quot;Evaluate 1:1-line agreement on same-physical-quantity data.&quot;&quot;&quot;\n    y_true = np.asarray(y_true, dtype=float)\n    y_pred = np.asarray(y_pred, dtype=float)\n\n    err = y_pred - y_true\n\n    rmse = np.sqrt(np.mean(err ** 2))\n    mae  = np.mean(np.abs(err))                       # Mean Absolute Error\n    bias = np.mean(err)                               # Mean Error (systematic bias)\n\n    # MAPE: Mean Absolute Percentage Error (%) \u2014 undefined when y_true contains 0\n    mask = y_true != 0\n    if mask.any():\n        mape = np.mean(np.abs(err[mask] \/ y_true[mask])) * 100.0\n    else:\n        mape = np.nan\n\n    return {\n        &quot;CenteredR2&quot;:   centered_r2(y_true, y_pred),\n        &quot;UncenteredR2&quot;: uncentered_r2(y_true, y_pred),\n        &quot;RMSE&quot;:         rmse,\n        &quot;MAE&quot;:          mae,\n        &quot;MAPE&quot;:         mape,\n        &quot;Bias&quot;:         bias,\n    }\n\n\n# Example usage\ny_true = np.array([10.1, 10.2, 10.3, 10.4, 10.5])\ny_pred = np.array([10.0, 10.3, 10.2, 10.5, 10.4])\n\nresults = evaluate_1_to_1_line_agreement(y_true, y_pred)\nfor k, v in results.items():\n    print(f&quot;{k:&gt;15s}: {v:.6f}&quot;)\"><pre><span class=\"pl-k\">def<\/span> <span class=\"pl-en\">evaluate_1_to_1_line_agreement<\/span>(<span class=\"pl-s1\">y_true<\/span>, <span class=\"pl-s1\">y_pred<\/span>):\n    <span class=\"pl-s\">\"\"\"Evaluate 1:1-line agreement on same-physical-quantity data.\"\"\"<\/span>\n    <span class=\"pl-s1\">y_true<\/span> <span class=\"pl-c1\">=<\/span> <span class=\"pl-s1\">np<\/span>.<span class=\"pl-c1\">asarray<\/span>(<span class=\"pl-s1\">y_true<\/span>, <span class=\"pl-s1\">dtype<\/span><span class=\"pl-c1\">=<\/span><span class=\"pl-s1\">float<\/span>)\n    <span class=\"pl-s1\">y_pred<\/span> <span class=\"pl-c1\">=<\/span> <span class=\"pl-s1\">np<\/span>.<span class=\"pl-c1\">asarray<\/span>(<span class=\"pl-s1\">y_pred<\/span>, <span class=\"pl-s1\">dtype<\/span><span class=\"pl-c1\">=<\/span><span class=\"pl-s1\">float<\/span>)\n\n    <span class=\"pl-s1\">err<\/span> <span class=\"pl-c1\">=<\/span> <span class=\"pl-s1\">y_pred<\/span> <span class=\"pl-c1\">-<\/span> <span class=\"pl-s1\">y_true<\/span>\n\n    <span class=\"pl-s1\">rmse<\/span> <span class=\"pl-c1\">=<\/span> <span class=\"pl-s1\">np<\/span>.<span class=\"pl-c1\">sqrt<\/span>(<span class=\"pl-s1\">np<\/span>.<span class=\"pl-c1\">mean<\/span>(<span class=\"pl-s1\">err<\/span> <span class=\"pl-c1\">**<\/span> <span class=\"pl-c1\">2<\/span>))\n    <span class=\"pl-s1\">mae<\/span>  <span class=\"pl-c1\">=<\/span> <span class=\"pl-s1\">np<\/span>.<span class=\"pl-c1\">mean<\/span>(<span class=\"pl-s1\">np<\/span>.<span class=\"pl-c1\">abs<\/span>(<span class=\"pl-s1\">err<\/span>))                       <span class=\"pl-c\"># Mean Absolute Error<\/span>\n    <span class=\"pl-s1\">bias<\/span> <span class=\"pl-c1\">=<\/span> <span class=\"pl-s1\">np<\/span>.<span class=\"pl-c1\">mean<\/span>(<span class=\"pl-s1\">err<\/span>)                               <span class=\"pl-c\"># Mean Error (systematic bias)<\/span>\n\n    <span class=\"pl-c\"># MAPE: Mean Absolute Percentage Error (%) \u2014 undefined when y_true contains 0<\/span>\n    <span class=\"pl-s1\">mask<\/span> <span class=\"pl-c1\">=<\/span> <span class=\"pl-s1\">y_true<\/span> <span class=\"pl-c1\">!=<\/span> <span class=\"pl-c1\">0<\/span>\n    <span class=\"pl-k\">if<\/span> <span class=\"pl-s1\">mask<\/span>.<span class=\"pl-c1\">any<\/span>():\n        <span class=\"pl-s1\">mape<\/span> <span class=\"pl-c1\">=<\/span> <span class=\"pl-s1\">np<\/span>.<span class=\"pl-c1\">mean<\/span>(<span class=\"pl-s1\">np<\/span>.<span class=\"pl-c1\">abs<\/span>(<span class=\"pl-s1\">err<\/span>&#91;<span class=\"pl-s1\">mask<\/span>&#93; <span class=\"pl-c1\">\/<\/span> <span class=\"pl-s1\">y_true<\/span>&#91;<span class=\"pl-s1\">mask<\/span>&#93;)) <span class=\"pl-c1\">*<\/span> <span class=\"pl-c1\">100.0<\/span>\n    <span class=\"pl-k\">else<\/span>:\n        <span class=\"pl-s1\">mape<\/span> <span class=\"pl-c1\">=<\/span> <span class=\"pl-s1\">np<\/span>.<span class=\"pl-c1\">nan<\/span>\n\n    <span class=\"pl-k\">return<\/span> {\n        <span class=\"pl-s\">\"CenteredR2\"<\/span>:   <span class=\"pl-en\">centered_r2<\/span>(<span class=\"pl-s1\">y_true<\/span>, <span class=\"pl-s1\">y_pred<\/span>),\n        <span class=\"pl-s\">\"UncenteredR2\"<\/span>: <span class=\"pl-en\">uncentered_r2<\/span>(<span class=\"pl-s1\">y_true<\/span>, <span class=\"pl-s1\">y_pred<\/span>),\n        <span class=\"pl-s\">\"RMSE\"<\/span>:         <span class=\"pl-s1\">rmse<\/span>,\n        <span class=\"pl-s\">\"MAE\"<\/span>:          <span class=\"pl-s1\">mae<\/span>,\n        <span class=\"pl-s\">\"MAPE\"<\/span>:         <span class=\"pl-s1\">mape<\/span>,\n        <span class=\"pl-s\">\"Bias\"<\/span>:         <span class=\"pl-s1\">bias<\/span>,\n    }\n\n\n<span class=\"pl-c\"># Example usage<\/span>\n<span class=\"pl-s1\">y_true<\/span> <span class=\"pl-c1\">=<\/span> <span class=\"pl-s1\">np<\/span>.<span class=\"pl-c1\">array<\/span>(&#91;<span class=\"pl-c1\">10.1<\/span>, <span class=\"pl-c1\">10.2<\/span>, <span class=\"pl-c1\">10.3<\/span>, <span class=\"pl-c1\">10.4<\/span>, <span class=\"pl-c1\">10.5<\/span>&#93;)\n<span class=\"pl-s1\">y_pred<\/span> <span class=\"pl-c1\">=<\/span> <span class=\"pl-s1\">np<\/span>.<span class=\"pl-c1\">array<\/span>(&#91;<span class=\"pl-c1\">10.0<\/span>, <span class=\"pl-c1\">10.3<\/span>, <span class=\"pl-c1\">10.2<\/span>, <span class=\"pl-c1\">10.5<\/span>, <span class=\"pl-c1\">10.4<\/span>&#93;)\n\n<span class=\"pl-s1\">results<\/span> <span class=\"pl-c1\">=<\/span> <span class=\"pl-en\">evaluate_1_to_1_line_agreement<\/span>(<span class=\"pl-s1\">y_true<\/span>, <span class=\"pl-s1\">y_pred<\/span>)\n<span class=\"pl-k\">for<\/span> <span class=\"pl-s1\">k<\/span>, <span class=\"pl-s1\">v<\/span> <span class=\"pl-c1\">in<\/span> <span class=\"pl-s1\">results<\/span>.<span class=\"pl-c1\">items<\/span>():\n    <span class=\"pl-en\">print<\/span>(<span class=\"pl-s\">f\"<span class=\"pl-s1\"><span class=\"pl-kos\">{<\/span><span class=\"pl-s1\">k<\/span>:&gt;15s<span class=\"pl-kos\">}<\/span><\/span>: <span class=\"pl-s1\"><span class=\"pl-kos\">{<\/span><span class=\"pl-s1\">v<\/span>:.6f<span class=\"pl-kos\">}<\/span><\/span>\"<\/span>)<\/pre><\/div>\n<\/article><\/div><\/div><\/p>\n<\/div><\/div>\n\n\n\n<div class=\"wp-block-kadence-tab kt-tab-inner-content kt-inner-tab-2 kt-inner-tab6438_cf40ac-ff\"><div class=\"kt-tab-inner-content-inner\"><p><div class=\"github-readme-container markdown-body\"><div id=\"file\" class=\"md\" data-path=\"Metrics\/R2\/Uncentered-R2\/centered-r2-vs-uncentered-r2-ko.md\"><article class=\"markdown-body entry-content container-lg\" itemprop=\"text\"><div class=\"markdown-heading\" dir=\"auto\"><h1 class=\"heading-element\" dir=\"auto\">Centered R\u00b2 vs Uncentered R\u00b2<\/h1><a id=\"user-content-centered-r-vs-uncentered-r\" class=\"anchor\" aria-label=\"Permalink: Centered R\u00b2 vs Uncentered R\u00b2\" href=\"#centered-r-vs-uncentered-r\"><svg data-component=\"Octicon\" class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"><\/path><\/svg><\/a><\/div>\n<p dir=\"auto\">Version 9 | Created: 2026-09-05 | Updated: 2026-11-07 13:46 UTC<\/p>\n<ul dir=\"auto\">\n<li><a href=\"#1-introduction-r%C2%B2-and-its-relation-to-rsq\">1. Introduction: R\u00b2 and Its Relation to RSQ<\/a><\/li>\n<li><a href=\"#2-comparison-of-the-two-formulas\">2. Comparison of the Two Formulas<\/a><\/li>\n<li><a href=\"#3-pros-and-cons\">3. Pros and Cons<\/a>\n<ul dir=\"auto\">\n<li><a href=\"#31-centered-r%C2%B2\">3.1 Centered R\u00b2<\/a><\/li>\n<li><a href=\"#32-uncentered-r%C2%B2\">3.2 Uncentered R\u00b2<\/a><\/li>\n<\/ul>\n<\/li>\n<li><a href=\"#4-applications\">4. Applications<\/a>\n<ul dir=\"auto\">\n<li><a href=\"#41-centered-r%C2%B2\">4.1 Centered R\u00b2<\/a><\/li>\n<li><a href=\"#42-uncentered-r%C2%B2\">4.2 Uncentered R\u00b2<\/a><\/li>\n<\/ul>\n<\/li>\n<li><a href=\"#5-derivation-of-uncentered-r%C2%B2\">5. Derivation of Uncentered R\u00b2<\/a>\n<ul dir=\"auto\">\n<li><a href=\"#51-sum-of-squares-decomposition\">5.1 Sum of Squares Decomposition<\/a><\/li>\n<li><a href=\"#52-ordinary-least-squares-ols-orthogonality-condition\">5.2 Ordinary Least Squares (OLS) Orthogonality Condition<\/a><\/li>\n<li><a href=\"#53-uncentered-decomposition\">5.3 Uncentered Decomposition<\/a><\/li>\n<li><a href=\"#54-definition-of-uncentered-r%C2%B2\">5.4 Definition of Uncentered R\u00b2<\/a><\/li>\n<li><a href=\"#55-relation-to-centered-r%C2%B2\">5.5 Relation to Centered R\u00b2<\/a><\/li>\n<\/ul>\n<\/li>\n<li><a href=\"#6-geometric-interpretation\">6. Geometric Interpretation<\/a>\n<ul dir=\"auto\">\n<li><a href=\"#61-vector-space-setup\">6.1 Vector Space Setup<\/a><\/li>\n<li><a href=\"#62-ols-as-orthogonal-projection\">6.2 OLS as Orthogonal Projection<\/a><\/li>\n<li><a href=\"#63-uncentered-decomposition-as-the-pythagorean-theorem\">6.3 Uncentered Decomposition as the Pythagorean Theorem<\/a><\/li>\n<li><a href=\"#64-centered-r%C2%B2-subtracting-the-mean-vector\">6.4 Centered R\u00b2: Subtracting the Mean Vector<\/a><\/li>\n<li><a href=\"#65-geometric-distinction-between-the-two-r%C2%B2\">6.5 Geometric Distinction Between the Two R\u00b2<\/a><\/li>\n<li><a href=\"#66-comparison-table\">6.6 Comparison Table<\/a><\/li>\n<\/ul>\n<\/li>\n<li><a href=\"#references\">References<\/a><\/li>\n<li><a href=\"#appendix-a-terminology\">Appendix A. Terminology<\/a><\/li>\n<li><a href=\"#appendix-b-python-code\">Appendix B. Python Code<\/a>\n<ul dir=\"auto\">\n<li><a href=\"#b1-centered-r%C2%B2\">B.1 Centered R\u00b2<\/a><\/li>\n<li><a href=\"#b2-uncentered-r%C2%B2\">B.2 Uncentered R\u00b2<\/a><\/li>\n<li><a href=\"#b3-integrated-evaluation-for-11-line-agreement\">B.3 Integrated Evaluation for 1:1-Line Agreement<\/a><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<div class=\"markdown-heading\" dir=\"auto\"><h2 class=\"heading-element\" dir=\"auto\">1. Introduction: R\u00b2 and Its Relation to RSQ<\/h2><a id=\"user-content-1-introduction-r-and-its-relation-to-rsq\" class=\"anchor\" aria-label=\"Permalink: 1. Introduction: R\u00b2 and Its Relation to RSQ\" href=\"#1-introduction-r-and-its-relation-to-rsq\"><svg data-component=\"Octicon\" class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"><\/path><\/svg><\/a><\/div>\n<p dir=\"auto\">\uacb0\uc815\uacc4\uc218 (coefficient of determination), \uace7 R\u00b2 \ub294 \uc608\uce21\uac12 <math-renderer class=\"js-inline-math\" style=\"display: inline-block\" data-run-id=\"eb4e0044685f708a4345ded4b5c86114\">$\\hat{y}$<\/math-renderer> \uac00 \uad00\uce21\uac12\n<math-renderer class=\"js-inline-math\" style=\"display: inline-block\" data-run-id=\"eb4e0044685f708a4345ded4b5c86114\">$y_{true}$<\/math-renderer> \uc640 \uc5bc\ub9c8\ub098 \uc798 \ub9de\ub294\uc9c0\ub97c \uc7ac\ub294 \uc9c0\ud45c\ub85c, \ud1b5\uacc4\uc640 machine learning (ML) \uc5d0\uc11c\n\uac00\uc7a5 \ub110\ub9ac \uc4f0\uc774\ub294 \uac80\uc99d \uc9c0\ud45c \uac00\uc6b4\ub370 \ud558\ub098\uc774\ub2e4. Spreadsheet software \uc640 \ub9ce\uc740\nengineering \ubcf4\uace0\uc11c\uc5d0\uc11c R\u00b2 \ub294 \ud754\ud788 <strong>RSQ<\/strong> (Excel \ud568\uc218 \uc774\ub984 <code>RSQ()<\/code>) \ub85c \ubd88\ub9ac\uba70,\n\uc774\ub294 \ub450 \ubcc0\uc218 \uc0ac\uc774\uc758 Pearson \uc0c1\uad00\uacc4\uc218\ub97c \uc81c\uacf1\ud55c \uac12\uc744 \uacc4\uc0b0\ud55c\ub2e4. Excel \uc758 \uae30\ubcf8 RSQ \uc640\n\ub300\ubd80\ubd84\uc758 \ud68c\uadc0 library \uac00 \ub0b4\ub193\ub294 \ud45c\uc900 R\u00b2 \ub294 \uac19\uc740 \uc591, \uace7 <strong>centered R\u00b2<\/strong> \ub97c\n\uac00\ub9ac\ud0a4\uba70, \uc774\ub294 <math-renderer class=\"js-inline-math\" style=\"display: inline-block\" data-run-id=\"eb4e0044685f708a4345ded4b5c86114\">$y$<\/math-renderer> \uc758 \ubcc0\ub3d9 \uac00\uc6b4\ub370 model \uc774 \ud3c9\uade0 baseline \ub300\ube44 \uc124\uba85\ud55c \ube44\uc728\uc744 \uc7b0\ub2e4.<\/p>\n<p dir=\"auto\">\uadf8\ub7f0\ub370 \ub35c \ub2e4\ub8e8\uc5b4\uc9c0\ub294 \ubcc0\ud615\uc778 <strong>uncentered R\u00b2<\/strong> \ub294 \ud3c9\uade0 \uae30\uc900\uc758 baseline \uc744 0 \uae30\uc900\uc758\nbaseline \uc73c\ub85c \ubc14\uafbc\ub2e4. \uc774 \uae00\uc740 \ub458\uc744 \uacac\uc8fc\uace0, uncentered \uc2dd\uc744 \uc720\ub3c4\ud558\uace0, \uae30\ud558\ud559\uc801\n\ud574\uc11d\uc744 \uc8fc\uace0, \uac01\uac01\uc774 \uc5b8\uc81c \uc54c\ub9de\uc740\uc9c0\ub97c \ub2e4\ub8e8\uba70, Python \uad6c\ud604\uc740\n<a href=\"#appendix-b-python-code\">Appendix B<\/a> \uc5d0 \ubaa8\uc558\ub2e4. \ud2b9\ud788 \uac19\uc740 \ubb3c\ub9ac\ub7c9\ub07c\ub9ac \uacac\uc8fc\ub294\n\uc790\ub9ac\uc5d0\uc11c <math-renderer class=\"js-inline-math\" style=\"display: inline-block\" data-run-id=\"eb4e0044685f708a4345ded4b5c86114\">$y_{true}$<\/math-renderer> \uc640 <math-renderer class=\"js-inline-math\" style=\"display: inline-block\" data-run-id=\"eb4e0044685f708a4345ded4b5c86114\">$\\hat{y}$<\/math-renderer> \uc758 1:1 line \uc77c\uce58\ub97c \ud3c9\uac00\ud558\ub294 \ub370 uncentered R\u00b2 \uac00\n\ub354 \uc801\ud569\ud55c\uc9c0\ub97c \uc0b4\ud540\ub2e4\n[<a href=\"#ref-3\">3<\/a>][<a href=\"#ref-4\">4<\/a>].<\/p>\n<div class=\"markdown-heading\" dir=\"auto\"><h2 class=\"heading-element\" dir=\"auto\">2. Comparison of the Two Formulas<\/h2><a id=\"user-content-2-comparison-of-the-two-formulas\" class=\"anchor\" aria-label=\"Permalink: 2. Comparison of the Two Formulas\" href=\"#2-comparison-of-the-two-formulas\"><svg data-component=\"Octicon\" class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"><\/path><\/svg><\/a><\/div>\n<p dir=\"auto\"><math-renderer class=\"js-display-math\" style=\"display: block\" data-run-id=\"eb4e0044685f708a4345ded4b5c86114\">$$R^2_c = 1 - \\frac{\\sum_{i=1}^n (y_i - \\hat{y}_i)^2}{\\sum_{i=1}^n (y_i - \\bar{y})^2}$$<\/math-renderer><\/p>\n<p dir=\"auto\"><math-renderer class=\"js-display-math\" style=\"display: block\" data-run-id=\"eb4e0044685f708a4345ded4b5c86114\">$$R^2_u = 1 - \\frac{\\sum_{i=1}^n (y_i - \\hat{y}_i)^2}{\\sum_{i=1}^n y_i^2}$$<\/math-renderer><\/p>\n<ul dir=\"auto\">\n<li>\ucc28\uc774\ub294 \uc628\uc804\ud788 \ubd84\ubaa8\uc5d0 \uc788\ub2e4. Centered R\u00b2 \ub294 \"\ud3c9\uade0 \ub458\ub808\uc758 \ubcc0\ub3d9\uc744 \uc5bc\ub9c8\ub098\n\uc124\uba85\ud588\ub294\uac00\" \ub97c \ubb3b\uace0, uncentered R\u00b2 \ub294 \"0 \ub458\ub808\uc758 \uc804\uccb4 \uc81c\uacf1\ud569\uc744 \uc5bc\ub9c8\ub098\n\uc124\uba85\ud588\ub294\uac00\" \ub97c \ubb3b\ub294\ub2e4. Centered R\u00b2 \ub294 \ud3c9\uade0 \uc608\uce21\uc744 baseline \uc73c\ub85c \uc0bc\uace0,\nuncentered R\u00b2 \ub294 0 \uc608\uce21\uc744 baseline \uc73c\ub85c \uc0bc\ub294\ub2e4 [<a href=\"#ref-3\">3<\/a>].<\/li>\n<li>Centered R\u00b2 \uac00 \ubb3b\ub294 \uac83: \"\ud3c9\uade0\uc744 \uadf8\ub300\ub85c \ub0b4\ub193\ub294 baseline \ubcf4\ub2e4 model \uc774 \uc5bc\ub9c8\ub098\n\ub098\uc740\uac00?\"<\/li>\n<li>Uncentered R\u00b2 \uac00 \ubb3b\ub294 \uac83: \"model \uc758 \uc608\uce21\uc774 1:1 identity line (y=x) \uc5d0 \uc5bc\ub9c8\ub098\n\uac00\uae4c\uc6b4\uac00?\"<\/li>\n<\/ul>\n<div class=\"markdown-heading\" dir=\"auto\"><h2 class=\"heading-element\" dir=\"auto\">3. Pros and Cons<\/h2><a id=\"user-content-3-pros-and-cons\" class=\"anchor\" aria-label=\"Permalink: 3. Pros and Cons\" href=\"#3-pros-and-cons\"><svg data-component=\"Octicon\" class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"><\/path><\/svg><\/a><\/div>\n<div class=\"markdown-heading\" dir=\"auto\"><h3 class=\"heading-element\" dir=\"auto\">3.1 Centered R\u00b2<\/h3><a id=\"user-content-31-centered-r\" class=\"anchor\" aria-label=\"Permalink: 3.1 Centered R\u00b2\" href=\"#31-centered-r\"><svg data-component=\"Octicon\" class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"><\/path><\/svg><\/a><\/div>\n<ul dir=\"auto\">\n<li>\n<strong>Pros<\/strong>: \ucc99\ub3c4\uc640 \ub2e8\uc704\uc5d0 \ubb34\uad00\ud558\uc5ec \uc11c\ub85c \ub2e4\ub978 \ubb3c\ub9ac\ub7c9\uc758 model \uc744 \uacac\uc904 \uc218 \uc788\ub2e4.\nPearson \uc0c1\uad00\uacc4\uc218\uc758 \uc81c\uacf1\uacfc \uac19\uc73c\ubbc0\ub85c \ud1b5\uacc4\uc801 \uc9c1\uad00\uc774 \ud48d\ubd80\ud558\ub2e4.<\/li>\n<li>\n<strong>Cons<\/strong>: <math-renderer class=\"js-inline-math\" style=\"display: inline-block\" data-run-id=\"eb4e0044685f708a4345ded4b5c86114\">$y$<\/math-renderer> \uc758 \ubd84\uc0b0\uc774 \uc791\uc73c\uba74 (\uac70\uc758 \uc77c\uc815\ud558\uba74) \ubd84\ubaa8\uac00 0 \uc5d0 \uac00\uae4c\uc6cc\uc838 R\u00b2 \uac00\n\ubb34\ub108\uc9c0\uac70\ub098 \uc74c\uc218\uac00 \ub41c\ub2e4. \ud3c9\uade0 \uc608\uce21\uae30 \ub300\ube44 \uc0c1\ub300 \uc131\ub2a5\ub9cc \uc7ac\ubbc0\ub85c \uacc4\ud1b5\uc801 bias \uc5d0\n\ub454\uac10\ud558\ub2e4.<\/li>\n<\/ul>\n<div class=\"markdown-heading\" dir=\"auto\"><h3 class=\"heading-element\" dir=\"auto\">3.2 Uncentered R\u00b2<\/h3><a id=\"user-content-32-uncentered-r\" class=\"anchor\" aria-label=\"Permalink: 3.2 Uncentered R\u00b2\" href=\"#32-uncentered-r\"><svg data-component=\"Octicon\" class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"><\/path><\/svg><\/a><\/div>\n<ul dir=\"auto\">\n<li>\n<strong>Pros<\/strong>: \uac19\uc740 \ubb3c\ub9ac\ub7c9 \uc218\uc900\uc5d0\uc11c model, dataset, \uc2e4\ud5d8\uc744 \uacac\uc904 \ub54c uncentered R\u00b2 \ub294\n\uc77c\uad00\ub41c \uc808\ub300 baseline (0 \uc608\uce21) \uc744 \uc8fc\uc5b4 \uc11c\ub85c \uacac\uc8fc\ub294 \uc77c\uc774 \uc5b4\uae0b\ub098\uc9c0 \uc54a\uac8c \ud55c\ub2e4. \uc800\n\ubd84\uc0b0 \uc790\ub8cc\uc5d0 \uac15\uac74\ud558\ub2e4. 1:1 line \uc5d0\uc11c \ubc97\uc5b4\ub098\ub294 \uac83\uc5d0 \ubbfc\uac10\ud558\uc5ec \uacc4\ud1b5\uc801 bias \ub97c \uc81c\ub300\ub85c\n\ubc8c\ud55c\ub2e4 [<a href=\"#ref-4\">4<\/a>].<\/li>\n<li>\n<strong>Cons<\/strong>: \ucc99\ub3c4\uc5d0 \uc885\uc18d\ub418\ubbc0\ub85c \ub2e8\uc704\ub098 \uac12 \ubc94\uc704\uac00 \ub2e4\ub978 model \uc744 \uacac\uc8fc\ub294 \ub370\ub294 \ub9de\uc9c0\n\uc54a\ub294\ub2e4. <math-renderer class=\"js-inline-math\" style=\"display: inline-block\" data-run-id=\"eb4e0044685f708a4345ded4b5c86114\">$\\bar{y}$<\/math-renderer> \uac00 \ud06c\uba74 <math-renderer class=\"js-inline-math\" style=\"display: inline-block\" data-run-id=\"eb4e0044685f708a4345ded4b5c86114\">$R^2_u$<\/math-renderer> \ub294 \uc778\uc704\uc801\uc73c\ub85c 1 \uc5d0 \uac00\uae4c\uc6cc\uc9c4\ub2e4. Uncentered\n<math-renderer class=\"js-inline-math\" style=\"display: inline-block\" data-run-id=\"eb4e0044685f708a4345ded4b5c86114\">$R^2$<\/math-renderer> \uac12\uc740 \ub300\uccb4\ub85c \ud6e8\uc52c \ub192\uac8c (\ud754\ud788 0.99 \uc774\uc0c1) \ub098\uc624\ub294\ub370, \ubd84\ubaa8 <math-renderer class=\"js-inline-math\" style=\"display: inline-block\" data-run-id=\"eb4e0044685f708a4345ded4b5c86114\">$\\sum y_i^2$<\/math-renderer> \uc774\ncentered \ubd84\ubaa8 <math-renderer class=\"js-inline-math\" style=\"display: inline-block\" data-run-id=\"eb4e0044685f708a4345ded4b5c86114\">$\\sum (y_i - \\bar{y})^2$<\/math-renderer> \ubcf4\ub2e4 \uc77c\ubc18\uc801\uc73c\ub85c \ud6e8\uc52c \ud06c\uae30\n\ub54c\ubb38\uc774\ub2e4. \uc774\uac83\ub9cc \ub5bc\uc5b4 \uc77d\uc73c\uba74 \uc9c0\ub098\uce58\uac8c \ub099\uad00\uc801\uc778 \ud3c9\uac00\ub85c \uc774\uc5b4\uc9c4\ub2e4. \ub2e4\ub9cc min-max\n\uc815\uaddc\ud654\ub41c \uc790\ub8cc\uc5d0\uc11c\ub294 \ucc99\ub3c4\uac00 \uace0\ub974\ubbc0\ub85c uncentered <math-renderer class=\"js-inline-math\" style=\"display: inline-block\" data-run-id=\"eb4e0044685f708a4345ded4b5c86114\">$R^2$<\/math-renderer> \uac00 \uad00\uce21\uac12\uacfc \uc608\uce21\uac12 \uc0ac\uc774\uc758\n\uc808\ub300 \uc77c\uce58\ub97c \uc7ac\ub294 \ub370 \ub354 \ub098\uc740 \uc9c0\ud45c\uac00 \ub41c\ub2e4.<\/li>\n<\/ul>\n<p dir=\"auto\"><strong>Key question<\/strong>: \uac19\uc740 \ubb3c\ub9ac\ub7c9\uc758 \uc790\ub8cc\uc5d0\uc11c model \uc744 \uacac\uc904 \ub54c uncentered R\u00b2 \uac00 \uc2e4\uc81c\ub85c\n\ub354 \uc815\ud655\ud55c\uac00? \ub2f5\uc740 \uc0ac\uc2e4\uc0c1 \"\uadf8\ub807\ub2e4\" \uc774\ub2e4. \uac19\uc740 \ub2e8\uc704\uc758 \uc790\ub8cc\uc5d0\uc11c <math-renderer class=\"js-inline-math\" style=\"display: inline-block\" data-run-id=\"eb4e0044685f708a4345ded4b5c86114\">$y_{true}$<\/math-renderer> \uc640\n<math-renderer class=\"js-inline-math\" style=\"display: inline-block\" data-run-id=\"eb4e0044685f708a4345ded4b5c86114\">$\\hat{y}$<\/math-renderer> \uc758 \uc808\ub300 \uc77c\uce58\ub97c \ud3c9\uac00\ud560 \ub54c uncentered R\u00b2 \ub294 (1) dataset \ubd84\uc0b0\uc774 \ub2ec\ub77c\uc838\ub3c4\n\uc65c\uace1\ub418\uc9c0 \uc54a\uace0, (2) \uc77c\uc815\ud55c bias \uc5d0 \ubbfc\uac10\ud558\uba70, (3) dataset \uc0ac\uc774\uc5d0 \uc808\ub300 baseline (0\n\uc608\uce21) \uc744 \uacf5\uc720\ud558\uc5ec model \ub07c\ub9ac \uc77c\uad00\ub418\uac8c \uacac\uc904 \uc218 \uc788\ub2e4.<\/p>\n<div class=\"markdown-heading\" dir=\"auto\"><h2 class=\"heading-element\" dir=\"auto\">4. Applications<\/h2><a id=\"user-content-4-applications\" class=\"anchor\" aria-label=\"Permalink: 4. Applications\" href=\"#4-applications\"><svg data-component=\"Octicon\" class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"><\/path><\/svg><\/a><\/div>\n<div class=\"markdown-heading\" dir=\"auto\"><h3 class=\"heading-element\" dir=\"auto\">4.1 Centered R\u00b2<\/h3><a id=\"user-content-41-centered-r\" class=\"anchor\" aria-label=\"Permalink: 4.1 Centered R\u00b2\" href=\"#41-centered-r\"><svg data-component=\"Octicon\" class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"><\/path><\/svg><\/a><\/div>\n<ul dir=\"auto\">\n<li>\uc77c\ubc18\uc801\uc778 \ud68c\uadc0\uc640 ML modeling \uc758 \ud45c\uc900 \uc131\ub2a5 \uc9c0\ud45c.<\/li>\n<li>\ub2e8\uc704\ub098 \uc601\uc5ed\uc774 \ub2e4\ub978 model \uc758 \uc131\ub2a5\uc744 \uc815\uaddc\ud654\ub41c \ud615\ud0dc\ub85c \uacac\uc8fc\ub294 \uc77c.<\/li>\n<li>Pearson \uc0c1\uad00\uc5d0 \ubc14\ud0d5\uc744 \ub454 \ubcc0\ub3d9 \uc124\uba85\ub825 \ud3c9\uac00\n[<a href=\"#ref-1\">1<\/a>].<\/li>\n<\/ul>\n<div class=\"markdown-heading\" dir=\"auto\"><h3 class=\"heading-element\" dir=\"auto\">4.2 Uncentered R\u00b2<\/h3><a id=\"user-content-42-uncentered-r\" class=\"anchor\" aria-label=\"Permalink: 4.2 Uncentered R\u00b2\" href=\"#42-uncentered-r\"><svg data-component=\"Octicon\" class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"><\/path><\/svg><\/a><\/div>\n<ul dir=\"auto\">\n<li>\n<strong>Regression Through the Origin (RTO)<\/strong>: Hooke \uc758 \ubc95\uce59\uc774\ub098 \ubc29\uc0ac\uc131 \ubd95\uad34\ucc98\ub7fc\n\ubb3c\ub9ac\uc801\uc73c\ub85c 0 \uc744 \uc9c0\ub098\uc57c \ud558\ub294 model. Stata, R, EViews \uc758 <code>noconstant<\/code> option \uc740\n\uc790\ub3d9\uc73c\ub85c uncentered R\u00b2 \ub97c \ub0b4\ub193\ub294\ub2e4\n[<a href=\"#ref-2\">2<\/a>]. \uc808\ud3b8\uc744 0 \uc73c\ub85c \uace0\uc815\ud558\uba74 \ud45c\uc900 (centered) <math-renderer class=\"js-inline-math\" style=\"display: inline-block\" data-run-id=\"eb4e0044685f708a4345ded4b5c86114\">$R^2$<\/math-renderer> \ub294\n\uc74c\uc218\uac00 \ub418\uac70\ub098 \uc798\ubabb\ub41c \ud574\uc11d\uc744 \ub0b3\ub294\ub2e4. \uc774\ub7f0 \uc790\ub9ac\uc5d0\uc11c uncentered <math-renderer class=\"js-inline-math\" style=\"display: inline-block\" data-run-id=\"eb4e0044685f708a4345ded4b5c86114\">$R^2$<\/math-renderer> \ub294 \uc6d0\uc810\n\uae30\uc900\uc73c\ub85c model \uc758 \uc801\ud569\uc744 \ud3c9\uac00\ud558\ub294 \uac15\uac74\ud55c \ub300\uc548\uc73c\ub85c \uc4f0\uc778\ub2e4.<\/li>\n<li>\n<strong>\uacc4\ub7c9\uacbd\uc81c\ud559\uc758 \uc9c4\ub2e8 \uac80\uc815<\/strong>: Breusch-Pagan \uac80\uc815\uacfc White \uac80\uc815\uc758 \ubcf4\uc870 \ud68c\uadc0\ub294\n<math-renderer class=\"js-inline-math\" style=\"display: inline-block\" data-run-id=\"eb4e0044685f708a4345ded4b5c86114\">$nR^2$<\/math-renderer> \ub97c chi-square \ud1b5\uacc4\ub7c9\uc73c\ub85c \uc4f0\ub294\ub370, \uc774\ub54c\uc758 \uacc4\uc0b0\uc774\nuncentered \ud615\ud0dc\uc774\ub2e4 [<a href=\"#ref-6\">6<\/a>].<\/li>\n<li>\n<strong><math-renderer class=\"js-inline-math\" style=\"display: inline-block\" data-run-id=\"eb4e0044685f708a4345ded4b5c86114\">$Y_{true}$<\/math-renderer> \ub300 <math-renderer class=\"js-inline-math\" style=\"display: inline-block\" data-run-id=\"eb4e0044685f708a4345ded4b5c86114\">$Y_{pred}$<\/math-renderer> \uadf8\ub9bc\uc5d0\uc11c 1:1 line \uc774\ud0c8 \ud3c9\uac00<\/strong>:\n\uac19\uc740 \ubb3c\ub9ac\ub7c9 \uc790\ub8cc\ub97c \ub2e4\ub8e8\ub294 ML \uc608\uce21 \uacfc\uc81c\uc5d0\uc11c uncentered R\u00b2 \ub294\n\uc808\ub300 \uc77c\uce58\ub97c \uc7b0\ub2e4. Calibration, Computational Fluid\nDynamics (CFD) \uc640 Finite Element Method (FEM) \uac80\uc99d, sensor \uad50\uc815,\n\uc7ac\ud604\uc131 \uc5f0\uad6c\uc5d0 \uc54c\ub9de\ub2e4.<\/li>\n<\/ul>\n<div class=\"markdown-heading\" dir=\"auto\"><h2 class=\"heading-element\" dir=\"auto\">5. Derivation of Uncentered R\u00b2<\/h2><a id=\"user-content-5-derivation-of-uncentered-r\" class=\"anchor\" aria-label=\"Permalink: 5. Derivation of Uncentered R\u00b2\" href=\"#5-derivation-of-uncentered-r\"><svg data-component=\"Octicon\" class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"><\/path><\/svg><\/a><\/div>\n<div class=\"markdown-heading\" dir=\"auto\"><h3 class=\"heading-element\" dir=\"auto\">5.1 Sum of Squares Decomposition<\/h3><a id=\"user-content-51-sum-of-squares-decomposition\" class=\"anchor\" aria-label=\"Permalink: 5.1 Sum of Squares Decomposition\" href=\"#51-sum-of-squares-decomposition\"><svg data-component=\"Octicon\" class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"><\/path><\/svg><\/a><\/div>\n<p dir=\"auto\">\uad00\uce21\uac12 <math-renderer class=\"js-inline-math\" style=\"display: inline-block\" data-run-id=\"eb4e0044685f708a4345ded4b5c86114\">$y_i$<\/math-renderer>, \uc608\uce21\uac12 <math-renderer class=\"js-inline-math\" style=\"display: inline-block\" data-run-id=\"eb4e0044685f708a4345ded4b5c86114\">$\\hat{y}_i$<\/math-renderer>, \uc794\ucc28\n<math-renderer class=\"js-inline-math\" style=\"display: inline-block\" data-run-id=\"eb4e0044685f708a4345ded4b5c86114\">$e_i = y_i - \\hat{y}_i$<\/math-renderer> (<math-renderer class=\"js-inline-math\" style=\"display: inline-block\" data-run-id=\"eb4e0044685f708a4345ded4b5c86114\">$i = 1, \\ldots, n$<\/math-renderer>) \uc5d0 \ub300\ud558\uc5ec uncentered \uc81c\uacf1\ud569\uc778\nTotal Sum of Squares (TSS), Explained Sum of Squares (ESS),\nResidual Sum of Squares (RSS) \ub97c \ub2e4\uc74c\uacfc \uac19\uc774 \uc815\uc758\ud55c\ub2e4.<\/p>\n<p dir=\"auto\"><math-renderer class=\"js-display-math\" style=\"display: block\" data-run-id=\"eb4e0044685f708a4345ded4b5c86114\">$$TSS_u = \\sum_{i=1}^n y_i^2, \\quad ESS_u = \\sum_{i=1}^n \\hat{y}_i^2, \\quad RSS = \\sum_{i=1}^n e_i^2$$<\/math-renderer><\/p>\n<div class=\"markdown-heading\" dir=\"auto\"><h3 class=\"heading-element\" dir=\"auto\">5.2 Ordinary Least Squares (OLS) Orthogonality Condition<\/h3><a id=\"user-content-52-ordinary-least-squares-ols-orthogonality-condition\" class=\"anchor\" aria-label=\"Permalink: 5.2 Ordinary Least Squares (OLS) Orthogonality Condition\" href=\"#52-ordinary-least-squares-ols-orthogonality-condition\"><svg data-component=\"Octicon\" class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"><\/path><\/svg><\/a><\/div>\n<p dir=\"auto\">OLS \uc815\uaddc\ubc29\uc815\uc2dd <math-renderer class=\"js-inline-math\" style=\"display: inline-block\" data-run-id=\"eb4e0044685f708a4345ded4b5c86114\">$X^T(y - X\\hat{\\beta}) = 0$<\/math-renderer> \uc5d0\uc11c, \uc124\uacc4\ud589\ub82c <math-renderer class=\"js-inline-math\" style=\"display: inline-block\" data-run-id=\"eb4e0044685f708a4345ded4b5c86114\">$X$<\/math-renderer> \uc758 \ubaa8\ub4e0 \uc5f4\uc740 \uc794\ucc28\nvector <math-renderer class=\"js-inline-math\" style=\"display: inline-block\" data-run-id=\"eb4e0044685f708a4345ded4b5c86114\">$e$<\/math-renderer> \uc640 \uc9c1\uad50\ud55c\ub2e4.<\/p>\n<p dir=\"auto\"><math-renderer class=\"js-display-math\" style=\"display: block\" data-run-id=\"eb4e0044685f708a4345ded4b5c86114\">$$\\sum_{i=1}^n \\hat{y}_i \\cdot e_i = \\hat{\\beta}^T X^T e = 0$$<\/math-renderer><\/p>\n<p dir=\"auto\">\uc801\ud569\uac12 vector \uc640 \uc794\ucc28 vector \ub294 \uc9c1\uad50\ud55c\ub2e4. \uc774\ub294 model \uc5d0 \uc808\ud3b8\uc774 \uc788\ub4e0 \uc5c6\ub4e0\n\uc131\ub9bd\ud55c\ub2e4.<\/p>\n<div class=\"markdown-heading\" dir=\"auto\"><h3 class=\"heading-element\" dir=\"auto\">5.3 Uncentered Decomposition<\/h3><a id=\"user-content-53-uncentered-decomposition\" class=\"anchor\" aria-label=\"Permalink: 5.3 Uncentered Decomposition\" href=\"#53-uncentered-decomposition\"><svg data-component=\"Octicon\" class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"><\/path><\/svg><\/a><\/div>\n<p dir=\"auto\"><math-renderer class=\"js-inline-math\" style=\"display: inline-block\" data-run-id=\"eb4e0044685f708a4345ded4b5c86114\">$y_i = \\hat{y}_i + e_i$<\/math-renderer> \ub97c \uc81c\uacf1\ud558\uc5ec <math-renderer class=\"js-inline-math\" style=\"display: inline-block\" data-run-id=\"eb4e0044685f708a4345ded4b5c86114\">$i$<\/math-renderer> \uc5d0 \ub300\ud574 \ub354\ud558\uba74 \ub2e4\uc74c\uacfc \uac19\ub2e4.<\/p>\n<p dir=\"auto\"><math-renderer class=\"js-display-math\" style=\"display: block\" data-run-id=\"eb4e0044685f708a4345ded4b5c86114\">$$\\sum y_i^2 = \\sum \\hat{y}_i^2 + 2\\sum \\hat{y}_i e_i + \\sum e_i^2$$<\/math-renderer><\/p>\n<p dir=\"auto\">\uad50\ucc28\ud56d\uc740 \uc9c1\uad50\uc131 <math-renderer class=\"js-inline-math\" style=\"display: inline-block\" data-run-id=\"eb4e0044685f708a4345ded4b5c86114\">$\\sum \\hat{y}_i e_i = 0$<\/math-renderer> \uc73c\ub85c \uc0ac\ub77c\uc9c0\uace0, \ub2e4\uc74c\uc774 \ub0a8\ub294\ub2e4.<\/p>\n<p dir=\"auto\"><math-renderer class=\"js-display-math\" style=\"display: block\" data-run-id=\"eb4e0044685f708a4345ded4b5c86114\">$$\\sum y_i^2 = \\sum \\hat{y}_i^2 + \\sum e_i^2 \\quad \\Longleftrightarrow \\quad TSS_u = ESS_u + RSS$$<\/math-renderer><\/p>\n<div class=\"markdown-heading\" dir=\"auto\"><h3 class=\"heading-element\" dir=\"auto\">5.4 Definition of Uncentered R\u00b2<\/h3><a id=\"user-content-54-definition-of-uncentered-r\" class=\"anchor\" aria-label=\"Permalink: 5.4 Definition of Uncentered R\u00b2\" href=\"#54-definition-of-uncentered-r\"><svg data-component=\"Octicon\" class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"><\/path><\/svg><\/a><\/div>\n<p dir=\"auto\">\uc591\ubcc0\uc744 <math-renderer class=\"js-inline-math\" style=\"display: inline-block\" data-run-id=\"eb4e0044685f708a4345ded4b5c86114\">$TSS_u$<\/math-renderer> \ub85c \ub098\ub204\uba74 <math-renderer class=\"js-inline-math\" style=\"display: inline-block\" data-run-id=\"eb4e0044685f708a4345ded4b5c86114\">$1 = ESS_u\/TSS_u + RSS\/TSS_u$<\/math-renderer> \uac00 \ub41c\ub2e4.<\/p>\n<blockquote>\n<p dir=\"auto\"><strong>Definition: Uncentered R\u00b2<\/strong><br>\nUncentered R\u00b2 \ub294 0 \uc744 \uae30\uc900\uc73c\ub85c \ud55c \ucd1d\uc81c\uacf1\ud569 <math-renderer class=\"js-inline-math\" style=\"display: inline-block\" data-run-id=\"eb4e0044685f708a4345ded4b5c86114\">$TSS_u$<\/math-renderer> \uac00\uc6b4\ub370 model \uc774 \uc124\uba85\ud55c <math-renderer class=\"js-inline-math\" style=\"display: inline-block\" data-run-id=\"eb4e0044685f708a4345ded4b5c86114\">$ESS_u$<\/math-renderer> \uc758 \ube44\uc728\uc774\ub2e4.<\/p>\n<\/blockquote>\n<p dir=\"auto\"><math-renderer class=\"js-display-math\" style=\"display: block\" data-run-id=\"eb4e0044685f708a4345ded4b5c86114\">$$R^2_u \\equiv \\frac{ESS_u}{TSS_u} = \\frac{\\sum \\hat{y}_i^2}{\\sum y_i^2} = 1 - \\frac{\\sum(y_i - \\hat{y}_i)^2}{\\sum y_i^2}$$<\/math-renderer><\/p>\n<div class=\"markdown-heading\" dir=\"auto\"><h3 class=\"heading-element\" dir=\"auto\">5.5 Relation to Centered R\u00b2<\/h3><a id=\"user-content-55-relation-to-centered-r\" class=\"anchor\" aria-label=\"Permalink: 5.5 Relation to Centered R\u00b2\" href=\"#55-relation-to-centered-r\"><svg data-component=\"Octicon\" class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"><\/path><\/svg><\/a><\/div>\n<p dir=\"auto\"><math-renderer class=\"js-inline-math\" style=\"display: inline-block\" data-run-id=\"eb4e0044685f708a4345ded4b5c86114\">$\\sum y_i^2 = \\sum (y_i - \\bar{y})^2 + n\\bar{y}^2$<\/math-renderer> \uc774\ubbc0\ub85c\n<math-renderer class=\"js-inline-math\" style=\"display: inline-block\" data-run-id=\"eb4e0044685f708a4345ded4b5c86114\">$TSS_u = TSS_c + n\\bar{y}^2$<\/math-renderer> \uc774\ub2e4. \uc808\ud3b8\uc774 \uc788\ub294 model \uc5d0\uc11c\ub294 \ub2e4\uc74c\uc774 \uc131\ub9bd\ud55c\ub2e4.<\/p>\n<p dir=\"auto\"><math-renderer class=\"js-display-math\" style=\"display: block\" data-run-id=\"eb4e0044685f708a4345ded4b5c86114\">$$R^2_u = \\frac{TSS_c \\cdot R^2_c + n\\bar{y}^2}{TSS_c + n\\bar{y}^2}$$<\/math-renderer><\/p>\n<p dir=\"auto\"><math-renderer class=\"js-inline-math\" style=\"display: inline-block\" data-run-id=\"eb4e0044685f708a4345ded4b5c86114\">$\\bar{y}$<\/math-renderer> \uac00 \ud06c\uac70\ub098 <math-renderer class=\"js-inline-math\" style=\"display: inline-block\" data-run-id=\"eb4e0044685f708a4345ded4b5c86114\">$n$<\/math-renderer> \uc774 \ud06c\uba74 <math-renderer class=\"js-inline-math\" style=\"display: inline-block\" data-run-id=\"eb4e0044685f708a4345ded4b5c86114\">$R^2_u$<\/math-renderer> \ub294 <math-renderer class=\"js-inline-math\" style=\"display: inline-block\" data-run-id=\"eb4e0044685f708a4345ded4b5c86114\">$R^2_c$<\/math-renderer> \ubcf4\ub2e4 1 \uc5d0 \uac00\uae4c\uc6cc\uc9c4\ub2e4.\n<math-renderer class=\"js-inline-math\" style=\"display: inline-block\" data-run-id=\"eb4e0044685f708a4345ded4b5c86114\">$\\bar{y} = 0$<\/math-renderer> \uc774\uba74 \ub458\uc740 \uc77c\uce58\ud55c\ub2e4.<\/p>\n<div class=\"markdown-heading\" dir=\"auto\"><h2 class=\"heading-element\" dir=\"auto\">6. Geometric Interpretation<\/h2><a id=\"user-content-6-geometric-interpretation\" class=\"anchor\" aria-label=\"Permalink: 6. Geometric Interpretation\" href=\"#6-geometric-interpretation\"><svg data-component=\"Octicon\" class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"><\/path><\/svg><\/a><\/div>\n<div class=\"markdown-heading\" dir=\"auto\"><h3 class=\"heading-element\" dir=\"auto\">6.1 Vector Space Setup<\/h3><a id=\"user-content-61-vector-space-setup\" class=\"anchor\" aria-label=\"Permalink: 6.1 Vector Space Setup\" href=\"#61-vector-space-setup\"><svg data-component=\"Octicon\" class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"><\/path><\/svg><\/a><\/div>\n<p dir=\"auto\"><math-renderer class=\"js-inline-math\" style=\"display: inline-block\" data-run-id=\"eb4e0044685f708a4345ded4b5c86114\">$n$<\/math-renderer> \uac1c\uc758 \uad00\uce21\uc744 vector\n<math-renderer class=\"js-inline-math\" style=\"display: inline-block\" data-run-id=\"eb4e0044685f708a4345ded4b5c86114\">$\\mathbf{y}, \\hat{\\mathbf{y}}, \\mathbf{e} = \\mathbf{y} - \\hat{\\mathbf{y}} \\in \\mathbb{R}^n$<\/math-renderer>\n\ub85c \ub2e4\ub8e8\uba74 \ubaa8\ub4e0 \uc81c\uacf1\ud569\uc774 norm \uc758 \uc81c\uacf1\uc774 \ub41c\ub2e4: <math-renderer class=\"js-inline-math\" style=\"display: inline-block\" data-run-id=\"eb4e0044685f708a4345ded4b5c86114\">$\\sum y_i^2 = |\\mathbf{y}|^2$<\/math-renderer>,\n<math-renderer class=\"js-inline-math\" style=\"display: inline-block\" data-run-id=\"eb4e0044685f708a4345ded4b5c86114\">$\\sum \\hat{y}_i^2 = |\\hat{\\mathbf{y}}|^2$<\/math-renderer>, <math-renderer class=\"js-inline-math\" style=\"display: inline-block\" data-run-id=\"eb4e0044685f708a4345ded4b5c86114\">$\\sum e_i^2 = |\\mathbf{e}|^2$<\/math-renderer>.<\/p>\n<div class=\"markdown-heading\" dir=\"auto\"><h3 class=\"heading-element\" dir=\"auto\">6.2 OLS as Orthogonal Projection<\/h3><a id=\"user-content-62-ols-as-orthogonal-projection\" class=\"anchor\" aria-label=\"Permalink: 6.2 OLS as Orthogonal Projection\" href=\"#62-ols-as-orthogonal-projection\"><svg data-component=\"Octicon\" class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"><\/path><\/svg><\/a><\/div>\n<p dir=\"auto\">\uc124\uacc4\ud589\ub82c <math-renderer class=\"js-inline-math\" style=\"display: inline-block\" data-run-id=\"eb4e0044685f708a4345ded4b5c86114\">$X$<\/math-renderer> \uc758 \uc5f4\uacf5\uac04\uc744 <math-renderer class=\"js-inline-math\" style=\"display: inline-block\" data-run-id=\"eb4e0044685f708a4345ded4b5c86114\">$\\mathcal{C}(X)$<\/math-renderer> \ub77c \ud558\uc790. OLS \ucd94\uc815\uac12\uc740\n<math-renderer class=\"js-inline-math\" style=\"display: inline-block\" data-run-id=\"eb4e0044685f708a4345ded4b5c86114\">$\\hat{\\mathbf{y}} = P_X \\mathbf{y}$<\/math-renderer> \uc774\uace0 \uc5ec\uae30\uc11c\n<math-renderer class=\"js-inline-math\" style=\"display: inline-block\" data-run-id=\"eb4e0044685f708a4345ded4b5c86114\">$P_X = X(X^TX)^{-1}X^T$<\/math-renderer> \ub294 <math-renderer class=\"js-inline-math\" style=\"display: inline-block\" data-run-id=\"eb4e0044685f708a4345ded4b5c86114\">$\\mathbf{y}$<\/math-renderer> \ub97c <math-renderer class=\"js-inline-math\" style=\"display: inline-block\" data-run-id=\"eb4e0044685f708a4345ded4b5c86114\">$\\mathcal{C}(X)$<\/math-renderer> \uc704\ub85c \ub0b4\ub9ac\ub294 \uc9c1\uad50\n\uc0ac\uc601\uc774\ub2e4. \uc794\ucc28 <math-renderer class=\"js-inline-math\" style=\"display: inline-block\" data-run-id=\"eb4e0044685f708a4345ded4b5c86114\">$\\mathbf{e}$<\/math-renderer> \ub294 \uc9c1\uad50\uc5ec\uacf5\uac04\uc5d0 \ub193\uc774\ubbc0\ub85c\n<math-renderer class=\"js-inline-math\" style=\"display: inline-block\" data-run-id=\"eb4e0044685f708a4345ded4b5c86114\">$\\mathbf{e} \\perp \\hat{\\mathbf{y}}$<\/math-renderer> \uac00 \uc800\uc808\ub85c \uc131\ub9bd\ud55c\ub2e4 [<a href=\"#ref-5\">5<\/a>].<\/p>\n<div class=\"markdown-heading\" dir=\"auto\"><h3 class=\"heading-element\" dir=\"auto\">6.3 Uncentered Decomposition as the Pythagorean Theorem<\/h3><a id=\"user-content-63-uncentered-decomposition-as-the-pythagorean-theorem\" class=\"anchor\" aria-label=\"Permalink: 6.3 Uncentered Decomposition as the Pythagorean Theorem\" href=\"#63-uncentered-decomposition-as-the-pythagorean-theorem\"><svg data-component=\"Octicon\" class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"><\/path><\/svg><\/a><\/div>\n<p dir=\"auto\"><math-renderer class=\"js-inline-math\" style=\"display: inline-block\" data-run-id=\"eb4e0044685f708a4345ded4b5c86114\">$\\mathbf{y} = \\hat{\\mathbf{y}} + \\mathbf{e}$<\/math-renderer> \uc774\uace0\n<math-renderer class=\"js-inline-math\" style=\"display: inline-block\" data-run-id=\"eb4e0044685f708a4345ded4b5c86114\">$\\hat{\\mathbf{y}} \\perp \\mathbf{e}$<\/math-renderer> \uc774\ubbc0\ub85c \uc9c1\uac01\uc0bc\uac01\ud615\uc774 \ub9cc\ub4e4\uc5b4\uc9c4\ub2e4.<\/p>\n<div class=\"snippet-clipboard-content notranslate position-relative overflow-auto\" data-snippet-clipboard-copy-content=\"              y\n             \/|\n            \/ |\n           \/  |  e  (perpendicular residual)\n          \/   |\n         \/____|\n      origin  \u0177  (on the C(X) plane)\"><pre lang=\"text\" class=\"notranslate\"><code>              y\n             \/|\n            \/ |\n           \/  |  e  (perpendicular residual)\n          \/   |\n         \/____|\n      origin  \u0177  (on the C(X) plane)\n<\/code><\/pre><\/div>\n<p dir=\"auto\"><math-renderer class=\"js-display-math\" style=\"display: block\" data-run-id=\"eb4e0044685f708a4345ded4b5c86114\">$$|\\mathbf{y}|^2 = |\\hat{\\mathbf{y}}|^2 + |\\mathbf{e}|^2$$<\/math-renderer><\/p>\n<p dir=\"auto\">\uc774\uac83\uc774 <math-renderer class=\"js-inline-math\" style=\"display: inline-block\" data-run-id=\"eb4e0044685f708a4345ded4b5c86114\">$TSS_u = ESS_u + RSS$<\/math-renderer> \ub4a4\uc5d0 \uc788\ub294 \uae30\ud558\ud559\uc801 \ud56d\ub4f1\uc2dd\uc774\uba70, \ub2e8\uc21c\ud55c \ub300\uc218\uc801\n\ud56d\ub4f1\uc2dd\uc774 \uc544\ub2c8\ub77c \ubb38\uc790 \uadf8\ub300\ub85c \ud53c\ud0c0\uace0\ub77c\uc2a4 \uc815\ub9ac\uc774\ub2e4. Uncentered R\u00b2 \uc758 \uae30\ud558\ud559\uc801 \ub73b\uc740\n\ub2e4\uc74c\uc774 \ub41c\ub2e4.<\/p>\n<p dir=\"auto\"><math-renderer class=\"js-display-math\" style=\"display: block\" data-run-id=\"eb4e0044685f708a4345ded4b5c86114\">$$R^2_u = \\frac{|\\hat{\\mathbf{y}}|^2}{|\\mathbf{y}|^2} = \\cos^2\\theta_u$$<\/math-renderer><\/p>\n<p dir=\"auto\">\uc5ec\uae30\uc11c <math-renderer class=\"js-inline-math\" style=\"display: inline-block\" data-run-id=\"eb4e0044685f708a4345ded4b5c86114\">$\\theta_u$<\/math-renderer> \ub294 \uc6d0\uc810\uc5d0\uc11c \uc7b0 <math-renderer class=\"js-inline-math\" style=\"display: inline-block\" data-run-id=\"eb4e0044685f708a4345ded4b5c86114\">$\\mathbf{y}$<\/math-renderer> \uc640 <math-renderer class=\"js-inline-math\" style=\"display: inline-block\" data-run-id=\"eb4e0044685f708a4345ded4b5c86114\">$\\hat{\\mathbf{y}}$<\/math-renderer> \uc0ac\uc774\uc758\n\uac01\uc774\ub2e4. <math-renderer class=\"js-inline-math\" style=\"display: inline-block\" data-run-id=\"eb4e0044685f708a4345ded4b5c86114\">$R^2_u \\to 1$<\/math-renderer> \uc740 \ub450 vector \uac00 \uac19\uc740 \ubc29\ud5a5\uc744 \uac00\ub9ac\ud0a8\ub2e4\ub294 \ub73b\uc774\uace0,\n<math-renderer class=\"js-inline-math\" style=\"display: inline-block\" data-run-id=\"eb4e0044685f708a4345ded4b5c86114\">$R^2_u \\to 0$<\/math-renderer> \uc740 \ub458\uc774 \uc9c1\uad50\ud55c\ub2e4\ub294 \ub73b\uc774\ub2e4.<\/p>\n<div class=\"markdown-heading\" dir=\"auto\"><h3 class=\"heading-element\" dir=\"auto\">6.4 Centered R\u00b2: Subtracting the Mean Vector<\/h3><a id=\"user-content-64-centered-r-subtracting-the-mean-vector\" class=\"anchor\" aria-label=\"Permalink: 6.4 Centered R\u00b2: Subtracting the Mean Vector\" href=\"#64-centered-r-subtracting-the-mean-vector\"><svg data-component=\"Octicon\" class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"><\/path><\/svg><\/a><\/div>\n<p dir=\"auto\">\ud3c9\uade0 vector <math-renderer class=\"js-inline-math\" style=\"display: inline-block\" data-run-id=\"eb4e0044685f708a4345ded4b5c86114\">$\\bar{\\mathbf{y}} = \\bar{y} \\cdot \\mathbf{1}$<\/math-renderer> \uc744 \ube7c\ub294 \uac83\uc740\n\ucd08\ud3c9\uba74 <math-renderer class=\"js-inline-math\" style=\"display: inline-block\" data-run-id=\"eb4e0044685f708a4345ded4b5c86114\">$\\mathbf{1}^\\perp$<\/math-renderer> \uc704\ub85c \uc0ac\uc601\ud558\ub294 \uac83\uacfc \uae30\ud558\ud559\uc801\uc73c\ub85c \uac19\uc73c\uba70, \uc0c1\uc218 vector\n<math-renderer class=\"js-inline-math\" style=\"display: inline-block\" data-run-id=\"eb4e0044685f708a4345ded4b5c86114\">$\\mathbf{1}$<\/math-renderer> \ubc29\ud5a5\uc758 \uc131\ubd84\uc744 \uc5c6\uc564\ub2e4. Model \uc5d0 \uc808\ud3b8\uc774 \uc788\uc73c\uba74\n<math-renderer class=\"js-inline-math\" style=\"display: inline-block\" data-run-id=\"eb4e0044685f708a4345ded4b5c86114\">$\\mathbf{1} \\in \\mathcal{C}(X)$<\/math-renderer> \uc774\ubbc0\ub85c <math-renderer class=\"js-inline-math\" style=\"display: inline-block\" data-run-id=\"eb4e0044685f708a4345ded4b5c86114\">$\\mathbf{1}^\\perp$<\/math-renderer> \uc548\uc5d0\uc11c \uc9c1\uac01\uc0bc\uac01\ud615\uc774\n\uadf8\ub300\ub85c \ub9cc\ub4e4\uc5b4\uc9c4\ub2e4.<\/p>\n<p dir=\"auto\"><math-renderer class=\"js-display-math\" style=\"display: block\" data-run-id=\"eb4e0044685f708a4345ded4b5c86114\">$$R^2_c = \\frac{|\\tilde{\\hat{\\mathbf{y}}}|^2}{|\\tilde{\\mathbf{y}}|^2} = \\cos^2\\theta_c$$<\/math-renderer><\/p>\n<p dir=\"auto\">\uc5ec\uae30\uc11c <math-renderer class=\"js-inline-math\" style=\"display: inline-block\" data-run-id=\"eb4e0044685f708a4345ded4b5c86114\">$\\theta_c$<\/math-renderer> \ub294 \ud3c9\uade0\uc744 \uc5c6\uc564 \ub4a4 \ub450 vector \uc0ac\uc774\uc758 \uac01\uc774\uba70, Pearson \uc0c1\uad00\uacc4\uc218\uc758\n\uc81c\uacf1\uacfc \uac19\ub2e4.<\/p>\n<div class=\"markdown-heading\" dir=\"auto\"><h3 class=\"heading-element\" dir=\"auto\">6.5 Geometric Distinction Between the Two R\u00b2<\/h3><a id=\"user-content-65-geometric-distinction-between-the-two-r\" class=\"anchor\" aria-label=\"Permalink: 6.5 Geometric Distinction Between the Two R\u00b2\" href=\"#65-geometric-distinction-between-the-two-r\"><svg data-component=\"Octicon\" class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"><\/path><\/svg><\/a><\/div>\n<div class=\"snippet-clipboard-content notranslate position-relative overflow-auto\" data-snippet-clipboard-copy-content=\"              y\n             \/|\n            \/ |\n           \/  |\n          \/   | e\n         \/    |\n        \/     |\n       *------\u0177-----\u2192 (C(X) plane)\n   origin\n     \/\n    *\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 1 direction (constant vector)\n    \u0233\u00b71\"><pre lang=\"text\" class=\"notranslate\"><code>              y\n             \/|\n            \/ |\n           \/  |\n          \/   | e\n         \/    |\n        \/     |\n       *------\u0177-----\u2192 (C(X) plane)\n   origin\n     \/\n    *\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 1 direction (constant vector)\n    \u0233\u00b71\n<\/code><\/pre><\/div>\n<ul dir=\"auto\">\n<li>\n<strong>Uncentered R\u00b2<\/strong>: \uc6d0\uc810\uc5d0\uc11c \uc7b0 <math-renderer class=\"js-inline-math\" style=\"display: inline-block\" data-run-id=\"eb4e0044685f708a4345ded4b5c86114\">$\\mathbf{y}$<\/math-renderer> \uc640 <math-renderer class=\"js-inline-math\" style=\"display: inline-block\" data-run-id=\"eb4e0044685f708a4345ded4b5c86114\">$\\hat{\\mathbf{y}}$<\/math-renderer> \uc0ac\uc774\uc758\n\uac01\uc774\ub2e4.<\/li>\n<li>\n<strong>Centered R\u00b2<\/strong>: \uae30\uc900\uc810\uc744 <math-renderer class=\"js-inline-math\" style=\"display: inline-block\" data-run-id=\"eb4e0044685f708a4345ded4b5c86114\">$\\bar{y}\\cdot\\mathbf{1}$<\/math-renderer> \ub85c \uc62e\uae34 \ub4a4\uc5d0 \uc7b0\n\uac01\uc774\ub2e4.<\/li>\n<\/ul>\n<p dir=\"auto\">\uadfc\ubcf8\uc801\uc778 \ucc28\uc774\ub294 \uae30\uc900\uc810\uc774 \uc6d0\uc810\uc778\uac00 \ud3c9\uade0 vector \uc778\uac00\uc5d0 \uc788\ub2e4. \uac19\uc740 \uc790\ub8cc\ub77c\ub3c4 \uae30\uc900\uc810\uc744\n\ub2ec\ub9ac \ud558\uc5ec \ubcf4\uba74 \ub450 vector \uc0ac\uc774\uc758 \uac01\uc774 \ub2ec\ub77c\uc9c4\ub2e4.<\/p>\n<div class=\"markdown-heading\" dir=\"auto\"><h3 class=\"heading-element\" dir=\"auto\">6.6 Comparison Table<\/h3><a id=\"user-content-66-comparison-table\" class=\"anchor\" aria-label=\"Permalink: 6.6 Comparison Table\" href=\"#66-comparison-table\"><svg data-component=\"Octicon\" class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"><\/path><\/svg><\/a><\/div>\n<p dir=\"auto\">Table 1. Geometric distinction between uncentered and centered R\u00b2<\/p>\n<markdown-accessiblity-table><table>\n<thead>\n<tr>\n<th>Aspect<\/th>\n<th>Uncentered<\/th>\n<th>Centered<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>Reference point<\/td>\n<td>\uc6d0\uc810 0<\/td>\n<td>\ud3c9\uade0 vector \u0233\u00b71<\/td>\n<\/tr>\n<tr>\n<td>Right triangle<\/td>\n<td>y, \u0177, e<\/td>\n<td>\u1ef9, \u0177\u0303, e<\/td>\n<\/tr>\n<tr>\n<td>Angle interpretation<\/td>\n<td>cos\u00b2(\u2220y\u0177)<\/td>\n<td>cos\u00b2(\u2220\u1ef9\u0177\u0303) = r\u00b2<\/td>\n<\/tr>\n<tr>\n<td>Required condition<\/td>\n<td>e \u22a5 \u0177<\/td>\n<td>e \u22a5 \u0177 \uc774\uace0 1 \u2208 C(X)<\/td>\n<\/tr>\n<tr>\n<td>Sensitivity to bias<\/td>\n<td>\ubbfc\uac10\ud568 (\uc6d0\uc810 \uace0\uc815)<\/td>\n<td>\ub454\uac10\ud568 (\ud3c9\uade0 \uc774\ub3d9\uc5d0 \ubd88\ubcc0)<\/td>\n<\/tr>\n<\/tbody>\n<\/table><\/markdown-accessiblity-table>\n<p dir=\"auto\"><strong>1:1 line \uac80\uc99d\uc758 \uae30\ud558\ud559\uc801 \ub73b<\/strong>: \uc77c\uc815\ud55c bias\n<math-renderer class=\"js-inline-math\" style=\"display: inline-block\" data-run-id=\"eb4e0044685f708a4345ded4b5c86114\">$\\hat{\\mathbf{y}} = \\mathbf{y} + c\\mathbf{1}$<\/math-renderer> \uc544\ub798\uc5d0\uc11c uncentered \uac01\uc740 \ubc8c\uc5b4\uc9c0\uc9c0\ub9cc\ncentered \uac01\uc740 \uadf8\ub300\ub85c\uc774\ub2e4. \ub530\ub77c\uc11c \uc808\ub300 \uc77c\uce58\ub97c \ud3c9\uac00\ud560 \ub54c uncentered R\u00b2 \uac00 \ub354\n\ubbfc\uac10\ud558\uac8c \ubc18\uc751\ud55c\ub2e4.<\/p>\n<div class=\"markdown-heading\" dir=\"auto\"><h2 class=\"heading-element\" dir=\"auto\">References<\/h2><a id=\"user-content-references\" class=\"anchor\" aria-label=\"Permalink: References\" href=\"#references\"><svg data-component=\"Octicon\" class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"><\/path><\/svg><\/a><\/div>\n<p dir=\"auto\"><a id=\"user-content-ref-1\"><\/a>[1] Draper, N. R., &amp; Smith, H. (1998). <a href=\"https:\/\/doi.org\/10.1002\/9781118625590\" rel=\"nofollow\"><em>Applied Regression Analysis<\/em><\/a> (3rd ed.). Wiley.<br>\n<a id=\"user-content-ref-2\"><\/a>[2] Eisenhauer, J. G. (2003). <a href=\"https:\/\/doi.org\/10.1111\/1467-9639.00136\" rel=\"nofollow\">Regression through the origin<\/a>. <em>Teaching Statistics<\/em>, 25(3), 76\u201380.<br>\n<a id=\"user-content-ref-3\"><\/a>[3] Kvalseth, T. O. (1985). <a href=\"https:\/\/doi.org\/10.1080\/00031305.1985.10479448\" rel=\"nofollow\">Cautionary note about R\u00b2<\/a>. <em>The American Statistician<\/em>, 39(4), 279\u2013285.<br>\n<a id=\"user-content-ref-4\"><\/a>[4] Legates, D. R., &amp; McCabe, G. J. (1999). <a href=\"https:\/\/doi.org\/10.1029\/1998WR900018\" rel=\"nofollow\">Evaluating the use of \"goodness-of-fit\" measures in hydrologic and hydroclimatic model validation<\/a>. <em>Water Resources Research<\/em>, 35(1), 233\u2013241.<br>\n<a id=\"user-content-ref-5\"><\/a>[5] Strang, G. (2009). <a href=\"https:\/\/wellesleycambridge.com\/\" rel=\"nofollow\"><em>Introduction to Linear Algebra<\/em><\/a> (4th ed.). Wellesley-Cambridge Press. ISBN 978-0-9802327-1-4.<br>\n<a id=\"user-content-ref-6\"><\/a>[6] Wooldridge, J. M. (2010). <a href=\"https:\/\/mitpress.mit.edu\/9780262232586\/econometric-analysis-of-cross-section-and-panel-data\/\" rel=\"nofollow\"><em>Econometric Analysis of Cross Section and Panel Data<\/em><\/a> (2nd ed.). MIT Press. ISBN 978-0-262-23258-6.<\/p>\n<hr>\n<div class=\"markdown-heading\" dir=\"auto\"><h2 class=\"heading-element\" dir=\"auto\">Appendix A. Terminology<\/h2><a id=\"user-content-appendix-a-terminology\" class=\"anchor\" aria-label=\"Permalink: Appendix A. Terminology\" href=\"#appendix-a-terminology\"><svg data-component=\"Octicon\" class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"><\/path><\/svg><\/a><\/div>\n<ul dir=\"auto\">\n<li>\n<strong>centered R\u00b2<\/strong>: \ud45c\uc900 R\u00b2 \uc774\uba70, \ubd84\ubaa8\uac00 \uc790\ub8cc \ud3c9\uade0 \ub458\ub808\uc758 \uc81c\uacf1\ud569\uc778 \uac83.<\/li>\n<li>\n<strong>CFD<\/strong>: Computational Fluid Dynamics. \uc720\uccb4 \ud750\ub984\uc758 numerical \ubaa8\uc0ac.<\/li>\n<li>\n<strong>ESS<\/strong>: Explained Sum of Squares. Uncentered \ud615\ud0dc\uc5d0\uc11c\ub294 <math-renderer class=\"js-inline-math\" style=\"display: inline-block\" data-run-id=\"eb4e0044685f708a4345ded4b5c86114\">$\\sum \\hat{y}_i^2$<\/math-renderer>.<\/li>\n<li>\n<strong>FEM<\/strong>: Finite Element Method. \uc774\uc0b0\ud654\ub41c \uc601\uc5ed\uc5d0\uc11c \uc7a5 \ubb38\uc81c\ub97c \uc218\uce58\ub85c \ud478\ub294 \ubc29\ubc95.<\/li>\n<li>\n<strong>MAE<\/strong>: Mean Absolute Error. \uc794\ucc28 \uc808\ub313\uac12\uc758 \ud3c9\uade0.<\/li>\n<li>\n<strong>MAPE<\/strong>: Mean Absolute Percentage Error. \uc794\ucc28 \uc808\ub313\uac12\uc744 \uad00\uce21\uac12\uc5d0 \ub300\ud55c \ubc31\ubd84\uc728\ub85c \uc801\uc740 \uac83\uc758 \ud3c9\uade0. \uad00\uce21\uac12\uc774 0 \uc778 \uc790\ub9ac\uc5d0\uc11c\ub294 \uc815\uc758\ub418\uc9c0 \uc54a\ub294\ub2e4.<\/li>\n<li>\n<strong>OLS<\/strong>: Ordinary Least Squares. \uc794\ucc28 \uc81c\uacf1\ud569\uc744 \ucd5c\uc18c\ub85c \ud558\ub294 \ucd94\uc815\ub7c9.<\/li>\n<li>\n<strong>RMSE<\/strong>: Root Mean Squared Error. \uc794\ucc28 \uc81c\uacf1 \ud3c9\uade0\uc758 \uc81c\uacf1\uadfc.<\/li>\n<li>\n<strong>RSQ<\/strong>: Pearson \uc0c1\uad00\uacc4\uc218\uc758 \uc81c\uacf1\uc744 \ub73b\ud558\ub294 Excel \ud568\uc218 \uc774\ub984\uc774\uba70, centered R\u00b2 \uc640 \uac19\ub2e4.<\/li>\n<li>\n<strong>RSS<\/strong>: Residual Sum of Squares. <math-renderer class=\"js-inline-math\" style=\"display: inline-block\" data-run-id=\"eb4e0044685f708a4345ded4b5c86114\">$\\sum e_i^2$<\/math-renderer>.<\/li>\n<li>\n<strong>RTO<\/strong>: Regression Through the Origin. \uc808\ud3b8\uc744 0 \uc73c\ub85c \uace0\uc815\ud55c \ud68c\uadc0.<\/li>\n<li>\n<strong>TSS<\/strong>: Total Sum of Squares. Uncentered \ud615\ud0dc\uc5d0\uc11c\ub294 <math-renderer class=\"js-inline-math\" style=\"display: inline-block\" data-run-id=\"eb4e0044685f708a4345ded4b5c86114\">$\\sum y_i^2$<\/math-renderer>, centered \ud615\ud0dc\uc5d0\uc11c\ub294 <math-renderer class=\"js-inline-math\" style=\"display: inline-block\" data-run-id=\"eb4e0044685f708a4345ded4b5c86114\">$\\sum (y_i - \\bar{y})^2$<\/math-renderer>.<\/li>\n<li>\n<strong>uncentered R\u00b2<\/strong>: \ubd84\ubaa8\uac00 \ud3c9\uade0\uc774 \uc544\ub2c8\ub77c 0 \ub458\ub808\uc758 \uc81c\uacf1\ud569\uc778 R\u00b2.<\/li>\n<\/ul>\n<div class=\"markdown-heading\" dir=\"auto\"><h2 class=\"heading-element\" dir=\"auto\">Appendix B. Python Code<\/h2><a id=\"user-content-appendix-b-python-code\" class=\"anchor\" aria-label=\"Permalink: Appendix B. Python Code\" href=\"#appendix-b-python-code\"><svg data-component=\"Octicon\" class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"><\/path><\/svg><\/a><\/div>\n<div class=\"markdown-heading\" dir=\"auto\"><h3 class=\"heading-element\" dir=\"auto\">B.1 Centered R\u00b2<\/h3><a id=\"user-content-b1-centered-r\" class=\"anchor\" aria-label=\"Permalink: B.1 Centered R\u00b2\" href=\"#b1-centered-r\"><svg data-component=\"Octicon\" class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"><\/path><\/svg><\/a><\/div>\n<div class=\"highlight highlight-source-python notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"import numpy as np\n\n\ndef centered_r2(y_true, y_pred):\n    &quot;&quot;&quot;\n    Centered R\u00b2 (standard R\u00b2)\n    R\u00b2_c = 1 - SSE \/ SST_centered\n    &quot;&quot;&quot;\n    y_true = np.asarray(y_true, dtype=float)\n    y_pred = np.asarray(y_pred, dtype=float)\n\n    sse = np.sum((y_true - y_pred) ** 2)\n    sst_c = np.sum((y_true - np.mean(y_true)) ** 2)\n\n    if sst_c == 0:\n        return np.nan  # undefined when y has zero variance\n    return 1.0 - sse \/ sst_c\n\n# Example usage\ny_true = np.array([10.1, 10.2, 10.3, 10.4, 10.5])\ny_pred = np.array([10.0, 10.3, 10.2, 10.5, 10.4])\n\nprint(f&quot;Centered R\u00b2:   {centered_r2(y_true, y_pred):.6f}&quot;)\n# Confirm equivalence with scikit-learn\nfrom sklearn.metrics import r2_score\nprint(f&quot;sklearn r2:    {r2_score(y_true, y_pred):.6f}&quot;)\"><pre><span class=\"pl-k\">import<\/span> <span class=\"pl-s1\">numpy<\/span> <span class=\"pl-k\">as<\/span> <span class=\"pl-s1\">np<\/span>\n\n\n<span class=\"pl-k\">def<\/span> <span class=\"pl-en\">centered_r2<\/span>(<span class=\"pl-s1\">y_true<\/span>, <span class=\"pl-s1\">y_pred<\/span>):\n    <span class=\"pl-s\">\"\"\"<\/span>\n<span class=\"pl-s\">    Centered R\u00b2 (standard R\u00b2)<\/span>\n<span class=\"pl-s\">    R\u00b2_c = 1 - SSE \/ SST_centered<\/span>\n<span class=\"pl-s\">    \"\"\"<\/span>\n    <span class=\"pl-s1\">y_true<\/span> <span class=\"pl-c1\">=<\/span> <span class=\"pl-s1\">np<\/span>.<span class=\"pl-c1\">asarray<\/span>(<span class=\"pl-s1\">y_true<\/span>, <span class=\"pl-s1\">dtype<\/span><span class=\"pl-c1\">=<\/span><span class=\"pl-s1\">float<\/span>)\n    <span class=\"pl-s1\">y_pred<\/span> <span class=\"pl-c1\">=<\/span> <span class=\"pl-s1\">np<\/span>.<span class=\"pl-c1\">asarray<\/span>(<span class=\"pl-s1\">y_pred<\/span>, <span class=\"pl-s1\">dtype<\/span><span class=\"pl-c1\">=<\/span><span class=\"pl-s1\">float<\/span>)\n\n    <span class=\"pl-s1\">sse<\/span> <span class=\"pl-c1\">=<\/span> <span class=\"pl-s1\">np<\/span>.<span class=\"pl-c1\">sum<\/span>((<span class=\"pl-s1\">y_true<\/span> <span class=\"pl-c1\">-<\/span> <span class=\"pl-s1\">y_pred<\/span>) <span class=\"pl-c1\">**<\/span> <span class=\"pl-c1\">2<\/span>)\n    <span class=\"pl-s1\">sst_c<\/span> <span class=\"pl-c1\">=<\/span> <span class=\"pl-s1\">np<\/span>.<span class=\"pl-c1\">sum<\/span>((<span class=\"pl-s1\">y_true<\/span> <span class=\"pl-c1\">-<\/span> <span class=\"pl-s1\">np<\/span>.<span class=\"pl-c1\">mean<\/span>(<span class=\"pl-s1\">y_true<\/span>)) <span class=\"pl-c1\">**<\/span> <span class=\"pl-c1\">2<\/span>)\n\n    <span class=\"pl-k\">if<\/span> <span class=\"pl-s1\">sst_c<\/span> <span class=\"pl-c1\">==<\/span> <span class=\"pl-c1\">0<\/span>:\n        <span class=\"pl-k\">return<\/span> <span class=\"pl-s1\">np<\/span>.<span class=\"pl-c1\">nan<\/span>  <span class=\"pl-c\"># undefined when y has zero variance<\/span>\n    <span class=\"pl-k\">return<\/span> <span class=\"pl-c1\">1.0<\/span> <span class=\"pl-c1\">-<\/span> <span class=\"pl-s1\">sse<\/span> <span class=\"pl-c1\">\/<\/span> <span class=\"pl-s1\">sst_c<\/span>\n\n<span class=\"pl-c\"># Example usage<\/span>\n<span class=\"pl-s1\">y_true<\/span> <span class=\"pl-c1\">=<\/span> <span class=\"pl-s1\">np<\/span>.<span class=\"pl-c1\">array<\/span>(&#91;<span class=\"pl-c1\">10.1<\/span>, <span class=\"pl-c1\">10.2<\/span>, <span class=\"pl-c1\">10.3<\/span>, <span class=\"pl-c1\">10.4<\/span>, <span class=\"pl-c1\">10.5<\/span>&#93;)\n<span class=\"pl-s1\">y_pred<\/span> <span class=\"pl-c1\">=<\/span> <span class=\"pl-s1\">np<\/span>.<span class=\"pl-c1\">array<\/span>(&#91;<span class=\"pl-c1\">10.0<\/span>, <span class=\"pl-c1\">10.3<\/span>, <span class=\"pl-c1\">10.2<\/span>, <span class=\"pl-c1\">10.5<\/span>, <span class=\"pl-c1\">10.4<\/span>&#93;)\n\n<span class=\"pl-en\">print<\/span>(<span class=\"pl-s\">f\"Centered R\u00b2:   <span class=\"pl-s1\"><span class=\"pl-kos\">{<\/span><span class=\"pl-en\">centered_r2<\/span>(<span class=\"pl-s1\">y_true<\/span>, <span class=\"pl-s1\">y_pred<\/span>):.6f<span class=\"pl-kos\">}<\/span><\/span>\"<\/span>)\n<span class=\"pl-c\"># Confirm equivalence with scikit-learn<\/span>\n<span class=\"pl-k\">from<\/span> <span class=\"pl-s1\">sklearn<\/span>.<span class=\"pl-s1\">metrics<\/span> <span class=\"pl-k\">import<\/span> <span class=\"pl-s1\">r2_score<\/span>\n<span class=\"pl-en\">print<\/span>(<span class=\"pl-s\">f\"sklearn r2:    <span class=\"pl-s1\"><span class=\"pl-kos\">{<\/span><span class=\"pl-en\">r2_score<\/span>(<span class=\"pl-s1\">y_true<\/span>, <span class=\"pl-s1\">y_pred<\/span>):.6f<span class=\"pl-kos\">}<\/span><\/span>\"<\/span>)<\/pre><\/div>\n<div class=\"markdown-heading\" dir=\"auto\"><h3 class=\"heading-element\" dir=\"auto\">B.2 Uncentered R\u00b2<\/h3><a id=\"user-content-b2-uncentered-r\" class=\"anchor\" aria-label=\"Permalink: B.2 Uncentered R\u00b2\" href=\"#b2-uncentered-r\"><svg data-component=\"Octicon\" class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"><\/path><\/svg><\/a><\/div>\n<div class=\"highlight highlight-source-python notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"def uncentered_r2(y_true, y_pred):\n    &quot;&quot;&quot;\n    Uncentered R\u00b2 (origin-based R\u00b2)\n    R\u00b2_u = 1 - SSE \/ SST_uncentered\n         = \u27e8\u0177, \u0177\u27e9 \/ \u27e8y, y\u27e9  (when e \u22a5 \u0177)\n    &quot;&quot;&quot;\n    y_true = np.asarray(y_true, dtype=float)\n    y_pred = np.asarray(y_pred, dtype=float)\n\n    sse = np.sum((y_true - y_pred) ** 2)\n    sst_u = np.sum(y_true ** 2)\n\n    if sst_u == 0:\n        return np.nan\n    return 1.0 - sse \/ sst_u\n\n# Example usage \u2014 comparing predictions on a same-physical-quantity scale (e.g., voltage)\ny_true = np.array([10.1, 10.2, 10.3, 10.4, 10.5])\ny_pred = np.array([10.0, 10.3, 10.2, 10.5, 10.4])\n\nprint(f&quot;Uncentered R\u00b2: {uncentered_r2(y_true, y_pred):.6f}&quot;)\n\n# Constant-bias scenario: contrast between the two metrics\ny_pred_biased = y_true + 0.5  # all predictions offset by +0.5\nprint(f&quot;\\nConstant bias +0.5 scenario:&quot;)\nprint(f&quot;  Centered R\u00b2:   {centered_r2(y_true, y_pred_biased):.6f}  &quot;\n      f&quot;(insensitive to bias)&quot;)\nprint(f&quot;  Uncentered R\u00b2: {uncentered_r2(y_true, y_pred_biased):.6f}  &quot;\n      f&quot;(sensitive to bias)&quot;)\"><pre><span class=\"pl-k\">def<\/span> <span class=\"pl-en\">uncentered_r2<\/span>(<span class=\"pl-s1\">y_true<\/span>, <span class=\"pl-s1\">y_pred<\/span>):\n    <span class=\"pl-s\">\"\"\"<\/span>\n<span class=\"pl-s\">    Uncentered R\u00b2 (origin-based R\u00b2)<\/span>\n<span class=\"pl-s\">    R\u00b2_u = 1 - SSE \/ SST_uncentered<\/span>\n<span class=\"pl-s\">         = \u27e8\u0177, \u0177\u27e9 \/ \u27e8y, y\u27e9  (when e \u22a5 \u0177)<\/span>\n<span class=\"pl-s\">    \"\"\"<\/span>\n    <span class=\"pl-s1\">y_true<\/span> <span class=\"pl-c1\">=<\/span> <span class=\"pl-s1\">np<\/span>.<span class=\"pl-c1\">asarray<\/span>(<span class=\"pl-s1\">y_true<\/span>, <span class=\"pl-s1\">dtype<\/span><span class=\"pl-c1\">=<\/span><span class=\"pl-s1\">float<\/span>)\n    <span class=\"pl-s1\">y_pred<\/span> <span class=\"pl-c1\">=<\/span> <span class=\"pl-s1\">np<\/span>.<span class=\"pl-c1\">asarray<\/span>(<span class=\"pl-s1\">y_pred<\/span>, <span class=\"pl-s1\">dtype<\/span><span class=\"pl-c1\">=<\/span><span class=\"pl-s1\">float<\/span>)\n\n    <span class=\"pl-s1\">sse<\/span> <span class=\"pl-c1\">=<\/span> <span class=\"pl-s1\">np<\/span>.<span class=\"pl-c1\">sum<\/span>((<span class=\"pl-s1\">y_true<\/span> <span class=\"pl-c1\">-<\/span> <span class=\"pl-s1\">y_pred<\/span>) <span class=\"pl-c1\">**<\/span> <span class=\"pl-c1\">2<\/span>)\n    <span class=\"pl-s1\">sst_u<\/span> <span class=\"pl-c1\">=<\/span> <span class=\"pl-s1\">np<\/span>.<span class=\"pl-c1\">sum<\/span>(<span class=\"pl-s1\">y_true<\/span> <span class=\"pl-c1\">**<\/span> <span class=\"pl-c1\">2<\/span>)\n\n    <span class=\"pl-k\">if<\/span> <span class=\"pl-s1\">sst_u<\/span> <span class=\"pl-c1\">==<\/span> <span class=\"pl-c1\">0<\/span>:\n        <span class=\"pl-k\">return<\/span> <span class=\"pl-s1\">np<\/span>.<span class=\"pl-c1\">nan<\/span>\n    <span class=\"pl-k\">return<\/span> <span class=\"pl-c1\">1.0<\/span> <span class=\"pl-c1\">-<\/span> <span class=\"pl-s1\">sse<\/span> <span class=\"pl-c1\">\/<\/span> <span class=\"pl-s1\">sst_u<\/span>\n\n<span class=\"pl-c\"># Example usage \u2014 comparing predictions on a same-physical-quantity scale (e.g., voltage)<\/span>\n<span class=\"pl-s1\">y_true<\/span> <span class=\"pl-c1\">=<\/span> <span class=\"pl-s1\">np<\/span>.<span class=\"pl-c1\">array<\/span>(&#91;<span class=\"pl-c1\">10.1<\/span>, <span class=\"pl-c1\">10.2<\/span>, <span class=\"pl-c1\">10.3<\/span>, <span class=\"pl-c1\">10.4<\/span>, <span class=\"pl-c1\">10.5<\/span>&#93;)\n<span class=\"pl-s1\">y_pred<\/span> <span class=\"pl-c1\">=<\/span> <span class=\"pl-s1\">np<\/span>.<span class=\"pl-c1\">array<\/span>(&#91;<span class=\"pl-c1\">10.0<\/span>, <span class=\"pl-c1\">10.3<\/span>, <span class=\"pl-c1\">10.2<\/span>, <span class=\"pl-c1\">10.5<\/span>, <span class=\"pl-c1\">10.4<\/span>&#93;)\n\n<span class=\"pl-en\">print<\/span>(<span class=\"pl-s\">f\"Uncentered R\u00b2: <span class=\"pl-s1\"><span class=\"pl-kos\">{<\/span><span class=\"pl-en\">uncentered_r2<\/span>(<span class=\"pl-s1\">y_true<\/span>, <span class=\"pl-s1\">y_pred<\/span>):.6f<span class=\"pl-kos\">}<\/span><\/span>\"<\/span>)\n\n<span class=\"pl-c\"># Constant-bias scenario: contrast between the two metrics<\/span>\n<span class=\"pl-s1\">y_pred_biased<\/span> <span class=\"pl-c1\">=<\/span> <span class=\"pl-s1\">y_true<\/span> <span class=\"pl-c1\">+<\/span> <span class=\"pl-c1\">0.5<\/span>  <span class=\"pl-c\"># all predictions offset by +0.5<\/span>\n<span class=\"pl-en\">print<\/span>(<span class=\"pl-s\">f\"<span class=\"pl-cce\">\\n<\/span>Constant bias +0.5 scenario:\"<\/span>)\n<span class=\"pl-en\">print<\/span>(<span class=\"pl-s\">f\"  Centered R\u00b2:   <span class=\"pl-s1\"><span class=\"pl-kos\">{<\/span><span class=\"pl-en\">centered_r2<\/span>(<span class=\"pl-s1\">y_true<\/span>, <span class=\"pl-s1\">y_pred_biased<\/span>):.6f<span class=\"pl-kos\">}<\/span><\/span>  \"<\/span>\n      <span class=\"pl-s\">f\"(insensitive to bias)\"<\/span>)\n<span class=\"pl-en\">print<\/span>(<span class=\"pl-s\">f\"  Uncentered R\u00b2: <span class=\"pl-s1\"><span class=\"pl-kos\">{<\/span><span class=\"pl-en\">uncentered_r2<\/span>(<span class=\"pl-s1\">y_true<\/span>, <span class=\"pl-s1\">y_pred_biased<\/span>):.6f<span class=\"pl-kos\">}<\/span><\/span>  \"<\/span>\n      <span class=\"pl-s\">f\"(sensitive to bias)\"<\/span>)<\/pre><\/div>\n<div class=\"markdown-heading\" dir=\"auto\"><h3 class=\"heading-element\" dir=\"auto\">B.3 Integrated Evaluation for 1:1-Line Agreement<\/h3><a id=\"user-content-b3-integrated-evaluation-for-11-line-agreement\" class=\"anchor\" aria-label=\"Permalink: B.3 Integrated Evaluation for 1:1-Line Agreement\" href=\"#b3-integrated-evaluation-for-11-line-agreement\"><svg data-component=\"Octicon\" class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"><\/path><\/svg><\/a><\/div>\n<div class=\"highlight highlight-source-python notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"def evaluate_1_to_1_line_agreement(y_true, y_pred):\n    &quot;&quot;&quot;Evaluate 1:1-line agreement on same-physical-quantity data.&quot;&quot;&quot;\n    y_true = np.asarray(y_true, dtype=float)\n    y_pred = np.asarray(y_pred, dtype=float)\n\n    err = y_pred - y_true\n\n    rmse = np.sqrt(np.mean(err ** 2))\n    mae  = np.mean(np.abs(err))                       # Mean Absolute Error\n    bias = np.mean(err)                               # Mean Error (systematic bias)\n\n    # MAPE: Mean Absolute Percentage Error (%) \u2014 undefined when y_true contains 0\n    mask = y_true != 0\n    if mask.any():\n        mape = np.mean(np.abs(err[mask] \/ y_true[mask])) * 100.0\n    else:\n        mape = np.nan\n\n    return {\n        &quot;CenteredR2&quot;:   centered_r2(y_true, y_pred),\n        &quot;UncenteredR2&quot;: uncentered_r2(y_true, y_pred),\n        &quot;RMSE&quot;:         rmse,\n        &quot;MAE&quot;:          mae,\n        &quot;MAPE&quot;:         mape,\n        &quot;Bias&quot;:         bias,\n    }\n\n\n# Example usage\ny_true = np.array([10.1, 10.2, 10.3, 10.4, 10.5])\ny_pred = np.array([10.0, 10.3, 10.2, 10.5, 10.4])\n\nresults = evaluate_1_to_1_line_agreement(y_true, y_pred)\nfor k, v in results.items():\n    print(f&quot;{k:&gt;15s}: {v:.6f}&quot;)\"><pre><span class=\"pl-k\">def<\/span> <span class=\"pl-en\">evaluate_1_to_1_line_agreement<\/span>(<span class=\"pl-s1\">y_true<\/span>, <span class=\"pl-s1\">y_pred<\/span>):\n    <span class=\"pl-s\">\"\"\"Evaluate 1:1-line agreement on same-physical-quantity data.\"\"\"<\/span>\n    <span class=\"pl-s1\">y_true<\/span> <span class=\"pl-c1\">=<\/span> <span class=\"pl-s1\">np<\/span>.<span class=\"pl-c1\">asarray<\/span>(<span class=\"pl-s1\">y_true<\/span>, <span class=\"pl-s1\">dtype<\/span><span class=\"pl-c1\">=<\/span><span class=\"pl-s1\">float<\/span>)\n    <span class=\"pl-s1\">y_pred<\/span> <span class=\"pl-c1\">=<\/span> <span class=\"pl-s1\">np<\/span>.<span class=\"pl-c1\">asarray<\/span>(<span class=\"pl-s1\">y_pred<\/span>, <span class=\"pl-s1\">dtype<\/span><span class=\"pl-c1\">=<\/span><span class=\"pl-s1\">float<\/span>)\n\n    <span class=\"pl-s1\">err<\/span> <span class=\"pl-c1\">=<\/span> <span class=\"pl-s1\">y_pred<\/span> <span class=\"pl-c1\">-<\/span> <span class=\"pl-s1\">y_true<\/span>\n\n    <span class=\"pl-s1\">rmse<\/span> <span class=\"pl-c1\">=<\/span> <span class=\"pl-s1\">np<\/span>.<span class=\"pl-c1\">sqrt<\/span>(<span class=\"pl-s1\">np<\/span>.<span class=\"pl-c1\">mean<\/span>(<span class=\"pl-s1\">err<\/span> <span class=\"pl-c1\">**<\/span> <span class=\"pl-c1\">2<\/span>))\n    <span class=\"pl-s1\">mae<\/span>  <span class=\"pl-c1\">=<\/span> <span class=\"pl-s1\">np<\/span>.<span class=\"pl-c1\">mean<\/span>(<span class=\"pl-s1\">np<\/span>.<span class=\"pl-c1\">abs<\/span>(<span class=\"pl-s1\">err<\/span>))                       <span class=\"pl-c\"># Mean Absolute Error<\/span>\n    <span class=\"pl-s1\">bias<\/span> <span class=\"pl-c1\">=<\/span> <span class=\"pl-s1\">np<\/span>.<span class=\"pl-c1\">mean<\/span>(<span class=\"pl-s1\">err<\/span>)                               <span class=\"pl-c\"># Mean Error (systematic bias)<\/span>\n\n    <span class=\"pl-c\"># MAPE: Mean Absolute Percentage Error (%) \u2014 undefined when y_true contains 0<\/span>\n    <span class=\"pl-s1\">mask<\/span> <span class=\"pl-c1\">=<\/span> <span class=\"pl-s1\">y_true<\/span> <span class=\"pl-c1\">!=<\/span> <span class=\"pl-c1\">0<\/span>\n    <span class=\"pl-k\">if<\/span> <span class=\"pl-s1\">mask<\/span>.<span class=\"pl-c1\">any<\/span>():\n        <span class=\"pl-s1\">mape<\/span> <span class=\"pl-c1\">=<\/span> <span class=\"pl-s1\">np<\/span>.<span class=\"pl-c1\">mean<\/span>(<span class=\"pl-s1\">np<\/span>.<span class=\"pl-c1\">abs<\/span>(<span class=\"pl-s1\">err<\/span>&#91;<span class=\"pl-s1\">mask<\/span>&#93; <span class=\"pl-c1\">\/<\/span> <span class=\"pl-s1\">y_true<\/span>&#91;<span class=\"pl-s1\">mask<\/span>&#93;)) <span class=\"pl-c1\">*<\/span> <span class=\"pl-c1\">100.0<\/span>\n    <span class=\"pl-k\">else<\/span>:\n        <span class=\"pl-s1\">mape<\/span> <span class=\"pl-c1\">=<\/span> <span class=\"pl-s1\">np<\/span>.<span class=\"pl-c1\">nan<\/span>\n\n    <span class=\"pl-k\">return<\/span> {\n        <span class=\"pl-s\">\"CenteredR2\"<\/span>:   <span class=\"pl-en\">centered_r2<\/span>(<span class=\"pl-s1\">y_true<\/span>, <span class=\"pl-s1\">y_pred<\/span>),\n        <span class=\"pl-s\">\"UncenteredR2\"<\/span>: <span class=\"pl-en\">uncentered_r2<\/span>(<span class=\"pl-s1\">y_true<\/span>, <span class=\"pl-s1\">y_pred<\/span>),\n        <span class=\"pl-s\">\"RMSE\"<\/span>:         <span class=\"pl-s1\">rmse<\/span>,\n        <span class=\"pl-s\">\"MAE\"<\/span>:          <span class=\"pl-s1\">mae<\/span>,\n        <span class=\"pl-s\">\"MAPE\"<\/span>:         <span class=\"pl-s1\">mape<\/span>,\n        <span class=\"pl-s\">\"Bias\"<\/span>:         <span class=\"pl-s1\">bias<\/span>,\n    }\n\n\n<span class=\"pl-c\"># Example usage<\/span>\n<span class=\"pl-s1\">y_true<\/span> <span class=\"pl-c1\">=<\/span> <span class=\"pl-s1\">np<\/span>.<span class=\"pl-c1\">array<\/span>(&#91;<span class=\"pl-c1\">10.1<\/span>, <span class=\"pl-c1\">10.2<\/span>, <span class=\"pl-c1\">10.3<\/span>, <span class=\"pl-c1\">10.4<\/span>, <span class=\"pl-c1\">10.5<\/span>&#93;)\n<span class=\"pl-s1\">y_pred<\/span> <span class=\"pl-c1\">=<\/span> <span class=\"pl-s1\">np<\/span>.<span class=\"pl-c1\">array<\/span>(&#91;<span class=\"pl-c1\">10.0<\/span>, <span class=\"pl-c1\">10.3<\/span>, <span class=\"pl-c1\">10.2<\/span>, <span class=\"pl-c1\">10.5<\/span>, <span class=\"pl-c1\">10.4<\/span>&#93;)\n\n<span class=\"pl-s1\">results<\/span> <span class=\"pl-c1\">=<\/span> <span class=\"pl-en\">evaluate_1_to_1_line_agreement<\/span>(<span class=\"pl-s1\">y_true<\/span>, <span class=\"pl-s1\">y_pred<\/span>)\n<span class=\"pl-k\">for<\/span> <span class=\"pl-s1\">k<\/span>, <span class=\"pl-s1\">v<\/span> <span class=\"pl-c1\">in<\/span> <span class=\"pl-s1\">results<\/span>.<span class=\"pl-c1\">items<\/span>():\n    <span class=\"pl-en\">print<\/span>(<span class=\"pl-s\">f\"<span class=\"pl-s1\"><span class=\"pl-kos\">{<\/span><span class=\"pl-s1\">k<\/span>:&gt;15s<span class=\"pl-kos\">}<\/span><\/span>: <span class=\"pl-s1\"><span class=\"pl-kos\">{<\/span><span class=\"pl-s1\">v<\/span>:.6f<span class=\"pl-kos\">}<\/span><\/span>\"<\/span>)<\/pre><\/div>\n<\/article><\/div><\/div><\/p>\n<\/div><\/div>\n<\/div><\/div><\/div>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n<div style='text-align:center' class='yasr-auto-insert-overall'><\/div><div style='text-align:center' class='yasr-auto-insert-visitor'><\/div>","protected":false},"excerpt":{"rendered":"<p>\ud83c\uddfa\ud83c\uddf8\ud83c\uddf0\ud83c\uddf7 Centered R\u00b2 measures variance explained relative to the mean, while uncentered R\u00b2 measures agreement relative to zero. This article compares the two, derives the uncentered form from the orthogonality of residuals, reads both as angles between vectors, and argues that uncentered R\u00b2 is the better metric for judging 1:1-line agreement on same-unit data.<\/p>\n","protected":false},"author":4,"featured_media":7032,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_bbp_topic_count":0,"_bbp_reply_count":0,"_bbp_total_topic_count":0,"_bbp_total_reply_count":0,"_bbp_voice_count":0,"_bbp_anonymous_reply_count":0,"_bbp_topic_count_hidden":0,"_bbp_reply_count_hidden":0,"_bbp_forum_subforum_count":0,"_kadence_starter_templates_imported_post":false,"_kad_post_transparent":"","_kad_post_title":"","_kad_post_layout":"","_kad_post_sidebar_id":"","_kad_post_content_style":"","_kad_post_vertical_padding":"","_kad_post_feature":"","_kad_post_feature_position":"","_kad_post_header":false,"_kad_post_footer":false,"_kad_post_classname":"","yasr_overall_rating":0,"yasr_post_is_review":"","yasr_auto_insert_disabled":"","yasr_review_type":"","fifu_image_url":"","fifu_image_alt":"","iawp_total_views":49,"footnotes":""},"categories":[56,369,321,431],"tags":[386,388],"class_list":["post-6438","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-data-science-slug","category-evalutaion-metric-slug","category-math-slug","category-regression-slug","tag-github-hosted","tag-r2"],"yasr_visitor_votes":{"stars_attributes":{"read_only":false,"span_bottom":false},"number_of_votes":1,"sum_votes":4},"jetpack_featured_media_url":"https:\/\/ykim.synology.me\/wordpress\/wp-content\/uploads\/2026\/09\/bondi-icebergs-ocean-pool.webp","_links":{"self":[{"href":"https:\/\/ykim.synology.me\/wordpress\/wp-json\/wp\/v2\/posts\/6438","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ykim.synology.me\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ykim.synology.me\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ykim.synology.me\/wordpress\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/ykim.synology.me\/wordpress\/wp-json\/wp\/v2\/comments?post=6438"}],"version-history":[{"count":16,"href":"https:\/\/ykim.synology.me\/wordpress\/wp-json\/wp\/v2\/posts\/6438\/revisions"}],"predecessor-version":[{"id":7476,"href":"https:\/\/ykim.synology.me\/wordpress\/wp-json\/wp\/v2\/posts\/6438\/revisions\/7476"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ykim.synology.me\/wordpress\/wp-json\/wp\/v2\/media\/7032"}],"wp:attachment":[{"href":"https:\/\/ykim.synology.me\/wordpress\/wp-json\/wp\/v2\/media?parent=6438"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ykim.synology.me\/wordpress\/wp-json\/wp\/v2\/categories?post=6438"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ykim.synology.me\/wordpress\/wp-json\/wp\/v2\/tags?post=6438"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}