{"id":6789,"date":"2026-08-16T20:07:50","date_gmt":"2026-08-17T01:07:50","guid":{"rendered":"https:\/\/ykim.synology.me\/wordpress\/?p=6789"},"modified":"2026-11-26T22:37:54","modified_gmt":"2026-11-27T04:37:54","slug":"bayesian-r%c2%b2-obtaining-r%c2%b2-as-a-distribution-instead-of-a-point","status":"publish","type":"post","link":"https:\/\/ykim.synology.me\/wordpress\/bayesian-r%c2%b2-obtaining-r%c2%b2-as-a-distribution-instead-of-a-point-6789\/","title":{"rendered":"Bayesian R\u00b2 \u2014 Obtaining R\u00b2 as a Distribution Instead of a Point"},"content":{"rendered":"\n<figure class=\"wp-block-image size-large is-resized\"><img decoding=\"async\" src=\"https:\/\/raw.githubusercontent.com\/yBarn1\/Images\/main\/pools\/georgetown-resort-pool-umbrella-patio.jpg\" alt=\"\" style=\"aspect-ratio:16\/9;object-fit:contain;width:auto;height:500px\"\/><\/figure>\n\n\n<style>.kt-tabs-id6789_fbecf2-2f > .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-id6789_fbecf2-2f > .kt-tabs-title-list li{margin-top:0px;margin-right:8px;margin-bottom:0px;margin-left:0px;}.wp-block-kadence-tabs .kt-tabs-id6789_fbecf2-2f > .kt-tabs-title-list li:last-child{margin-right:0px;}.wp-block-kadence-tabs .kt-tabs-id6789_fbecf2-2f > .kt-tabs-title-list li .kt-tab-title, .wp-block-kadence-tabs .kt-tabs-id6789_fbecf2-2f > .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-id6789_fbecf2-2f > .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-id6789_fbecf2-2f > .kt-tabs-title-list li .kt-tab-title:hover, .wp-block-kadence-tabs .kt-tabs-id6789_fbecf2-2f > .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-id6789_fbecf2-2f > .kt-tabs-title-list li.kt-tab-title-active .kt-tab-title, .wp-block-kadence-tabs .kt-tabs-id6789_fbecf2-2f > .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-id6789_fbecf2-2f > .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-id6789_fbecf2-2f > .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-id6789_fbecf2-2f kt-tabs-has-2-tabs kt-active-tab-1 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-active\"><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-inactive\"><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-tab6789_e247f2-3e\"><div class=\"kt-tab-inner-content-inner\"><p><div class=\"github-readme-container markdown-body\"><div id=\"file\" class=\"md\" data-path=\"Metrics\/R2\/Bayesian-R2\/bayesian-r2.md\"><article class=\"markdown-body entry-content container-lg\" itemprop=\"text\"><div class=\"markdown-heading\" dir=\"auto\"><h1 class=\"heading-element\" dir=\"auto\">Bayesian R\u00b2 \u2014 Obtaining R\u00b2 as a Distribution Instead of a Point<\/h1><a id=\"user-content-bayesian-r--obtaining-r-as-a-distribution-instead-of-a-point\" class=\"anchor\" aria-label=\"Permalink: Bayesian R\u00b2 \u2014 Obtaining R\u00b2 as a Distribution Instead of a Point\" href=\"#bayesian-r--obtaining-r-as-a-distribution-instead-of-a-point\"><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-05-31 | Updated: 2026-11-07 13:46 UTC<\/p>\n<ul dir=\"auto\">\n<li><a href=\"#1-motivation\">1. Motivation<\/a><\/li>\n<li><a href=\"#2-core-idea\">2. Core Idea<\/a><\/li>\n<li><a href=\"#3-definition\">3. Definition<\/a>\n<ul dir=\"auto\">\n<li><a href=\"#31-divergence-problem-of-the-standard-form\">3.1. Divergence Problem of the Standard Form<\/a><\/li>\n<li><a href=\"#32-gelman-formulation\">3.2. Gelman Formulation<\/a><\/li>\n<li><a href=\"#33-choice-of-residual-variance\">3.3. Choice of Residual Variance<\/a><\/li>\n<\/ul>\n<\/li>\n<li><a href=\"#4-computation\">4. Computation<\/a>\n<ul dir=\"auto\">\n<li><a href=\"#41-procedure\">4.1. Procedure<\/a><\/li>\n<li><a href=\"#42-implementation\">4.2. Implementation<\/a><\/li>\n<\/ul>\n<\/li>\n<li><a href=\"#5-interpretation\">5. Interpretation<\/a>\n<ul dir=\"auto\">\n<li><a href=\"#51-point-estimate-and-credible-interval\">5.1. Point Estimate and Credible Interval<\/a><\/li>\n<li><a href=\"#52-uncertainty-decomposition\">5.2. Uncertainty Decomposition<\/a><\/li>\n<\/ul>\n<\/li>\n<li><a href=\"#6-tools\">6. Tools<\/a><\/li>\n<li><a href=\"#7-prerequisites\">7. Prerequisites<\/a>\n<ul dir=\"auto\">\n<li><a href=\"#71-applicable-models\">7.1. Applicable Models<\/a><\/li>\n<li><a href=\"#72-inapplicable-models\">7.2. Inapplicable Models<\/a><\/li>\n<\/ul>\n<\/li>\n<li><a href=\"#8-comparison\">8. Comparison<\/a><\/li>\n<li><a href=\"#9-pitfalls\">9. Pitfalls<\/a><\/li>\n<li><a href=\"#10-summary\">10. Summary<\/a><\/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-worked-example\">Appendix B. Worked Example<\/a>\n<ul dir=\"auto\">\n<li><a href=\"#b1-data-and-reference-fit\">B.1. Data and Reference Fit<\/a><\/li>\n<li><a href=\"#b2-posterior-draws\">B.2. Posterior Draws<\/a><\/li>\n<li><a href=\"#b3-credible-interval\">B.3. Credible Interval<\/a><\/li>\n<li><a href=\"#b4-constructed-predictors-and-the-range-boundary\">B.4. Constructed Predictors and the Range Boundary<\/a><\/li>\n<li><a href=\"#b5-summary-of-the-comparison\">B.5. Summary of the Comparison<\/a><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<blockquote>\n<p dir=\"auto\">A note on computing one R\u00b2 per posterior draw to obtain R\u00b2 as a distribution,\norganized as definition, computation, interpretation, and applicability.<\/p>\n<\/blockquote>\n<div class=\"markdown-heading\" dir=\"auto\"><h2 class=\"heading-element\" dir=\"auto\">1. Motivation<\/h2><a id=\"user-content-1-motivation\" class=\"anchor\" aria-label=\"Permalink: 1. Motivation\" href=\"#1-motivation\"><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\">Standard R\u00b2 is the coefficient of determination <code>1 \u2212 SS_res \/ SS_tot<\/code>, where <code>SS_res<\/code>\nis the sum of squared residuals and <code>SS_tot<\/code> is the sum of squared deviations of the\nobservations from their own mean. It is computed from one single set of predictions and\ntherefore returns a single number. When a fit reports <code>R\u00b2 = 0.87<\/code>, that number alone\ndoes not say whether the value would collapse to 0.60 under a slightly different sample\nor hold firmly near 0.85. The magnitude of explanatory power and the confidence in that\nmagnitude are two different pieces of information, and standard R\u00b2 carries only the first.<\/p>\n<p dir=\"auto\">Bayesian R\u00b2 propagates the predictive uncertainty of the model into R\u00b2 itself, so\nthat R\u00b2 arrives as a distribution rather than a point. This is why the result takes\nthe form <code>0.87 &#91;0.81, 0.91&#93;<\/code>.<\/p>\n<p dir=\"auto\"><strong>Table 1. Standard R\u00b2 vs Bayesian R\u00b2<\/strong><\/p>\n<markdown-accessiblity-table><table>\n<thead>\n<tr>\n<th>Aspect<\/th>\n<th>Standard R\u00b2<\/th>\n<th>Bayesian R\u00b2<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>Output<\/td>\n<td>A single scalar<\/td>\n<td>A distribution over S draws<\/td>\n<\/tr>\n<tr>\n<td>Uncertainty<\/td>\n<td>Absent<\/td>\n<td>Expressed as an interval<\/td>\n<\/tr>\n<tr>\n<td>Range<\/td>\n<td>Can be negative, never exceeds 1<\/td>\n<td>Always within [0, 1]<\/td>\n<\/tr>\n<tr>\n<td>Input required<\/td>\n<td>One set of predictions<\/td>\n<td>S sets of posterior draws<\/td>\n<\/tr>\n<tr>\n<td>Failure mode<\/td>\n<td>Instability stays invisible<\/td>\n<td>Without draws the metric cannot be computed at all<\/td>\n<\/tr>\n<\/tbody>\n<\/table><\/markdown-accessiblity-table>\n<div class=\"markdown-heading\" dir=\"auto\"><h2 class=\"heading-element\" dir=\"auto\">2. Core Idea<\/h2><a id=\"user-content-2-core-idea\" class=\"anchor\" aria-label=\"Permalink: 2. Core Idea\" href=\"#2-core-idea\"><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 each draw s taken from the posterior distribution, one R\u00b2 is computed. With S\ndraws there are S values of R\u00b2, and that collection is the posterior distribution\nof R\u00b2. When the model parameters are uncertain, the predictions differ from draw to\ndraw, and when the predictions differ, so does the amount of variation the model\nexplains. Bayesian R\u00b2 does not erase that movement; it reports it.<\/p>\n<div class=\"markdown-heading\" dir=\"auto\"><h2 class=\"heading-element\" dir=\"auto\">3. Definition<\/h2><a id=\"user-content-3-definition\" class=\"anchor\" aria-label=\"Permalink: 3. Definition\" href=\"#3-definition\"><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. Divergence Problem of the Standard Form<\/h3><a id=\"user-content-31-divergence-problem-of-the-standard-form\" class=\"anchor\" aria-label=\"Permalink: 3.1. Divergence Problem of the Standard Form\" href=\"#31-divergence-problem-of-the-standard-form\"><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\">Applying the standard definition <code>R\u00b2 = 1 \u2212 SS_res \/ SS_tot<\/code> to individual posterior\ndraws produces values outside [0, 1]. Under a least-squares fit the residual sum of\nsquares cannot exceed the total sum of squares, but an individual posterior draw is\nnot the least-squares solution for that data. When a prior or the shrinkage of a\nhierarchical model pulls predictions away from the data, the residual sum of squares\nof a single draw can exceed the total sum of squares, and the R\u00b2 of that draw turns\nnegative. A collection of values whose sign flips from draw to draw yields neither an\ninterpretable median nor an interpretable interval. A concrete instance appears in\n<a href=\"#appendix-b-worked-example\">Appendix B. Worked Example<\/a>.<\/p>\n<div class=\"markdown-heading\" dir=\"auto\"><h3 class=\"heading-element\" dir=\"auto\">3.2. Gelman Formulation<\/h3><a id=\"user-content-32-gelman-formulation\" class=\"anchor\" aria-label=\"Permalink: 3.2. Gelman Formulation\" href=\"#32-gelman-formulation\"><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 remedy proposed by Gelman et al. [<a href=\"#ref-1\">1<\/a>] is to replace the denominator with a sum\nof two non-negative quantities. Removing the subtraction removes the place where the\nvalue could diverge.<\/p>\n<div class=\"snippet-clipboard-content notranslate position-relative overflow-auto\" data-snippet-clipboard-copy-content=\"             Var_fit^(s)                    explained variation\nR2^(s) = \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500  =  \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n         Var_fit^(s) + Var_res^(s)      explained variation + residual variation\"><pre lang=\"text\" class=\"notranslate\"><code>             Var_fit^(s)                    explained variation\nR2^(s) = \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500  =  \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n         Var_fit^(s) + Var_res^(s)      explained variation + residual variation\n<\/code><\/pre><\/div>\n<ul dir=\"auto\">\n<li><code>Var_fit<\/code> \u2014 the variance of the predictions <code>y_hat_i^(s)<\/code> of draw s taken across the data points i, which is the variation the model explains.<\/li>\n<li><code>Var_res<\/code> \u2014 the variation that draw s leaves unexplained.<\/li>\n<\/ul>\n<p dir=\"auto\">Both terms are variances and therefore non-negative, and because the denominator is\ntheir sum, the ratio is structurally confined to [0, 1]. The value is 0 when the\nnumerator vanishes and approaches 1 as <code>Var_res<\/code> approaches 0. Unlike the standard\nform, no posterior draw can push it outside its definition.<\/p>\n<p dir=\"auto\">Here <code>Var<\/code> denotes the sample variance taken over the data points i = 1 ... n.<\/p>\n<p dir=\"auto\"><math-renderer class=\"js-display-math\" style=\"display: block\" data-run-id=\"81d56063f4475cdd3db263a4598dcfb7\">$$\\mathrm{Var}(z) = \\frac{1}{n-1}\\sum_{i=1}^{n}\\left(z_i - \\bar{z}\\right)^2 \\hspace{19em} (1)$$<\/math-renderer><\/p>\n<div class=\"markdown-heading\" dir=\"auto\"><h3 class=\"heading-element\" dir=\"auto\">3.3. Choice of Residual Variance<\/h3><a id=\"user-content-33-choice-of-residual-variance\" class=\"anchor\" aria-label=\"Permalink: 3.3. Choice of Residual Variance\" href=\"#33-choice-of-residual-variance\"><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\">There are two ways to define <code>Var_res<\/code>, and the choice changes what R\u00b2 means.<\/p>\n<p dir=\"auto\"><strong>Table 2. Two choices of residual variance<\/strong><\/p>\n<markdown-accessiblity-table><table>\n<thead>\n<tr>\n<th>Variant<\/th>\n<th>Definition<\/th>\n<th>Meaning<\/th>\n<th>Note<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>Empirical<\/td>\n<td><code>Var(y_i \u2212 y_hat_i^(s))<\/code><\/td>\n<td>The variance of the residuals actually left over<\/td>\n<td>Requires the observations y and works for any model family<\/td>\n<\/tr>\n<tr>\n<td>Model-based<\/td>\n<td><code>(sigma^(s))^2<\/code><\/td>\n<td>The noise variance the model claims for itself<\/td>\n<td>Used with Gaussian likelihoods and computed without y<\/td>\n<\/tr>\n<\/tbody>\n<\/table><\/markdown-accessiblity-table>\n<p dir=\"auto\">The two values agree when the model fits well, and any gap between them is itself a\ndiagnostic. A model-based value that is visibly smaller means the model underestimates\nits own noise, and the model-based R\u00b2 then reads higher than the empirical one. The\ntwo variants should not be mixed within one document, and the choice should be stated.<\/p>\n<div class=\"markdown-heading\" dir=\"auto\"><h2 class=\"heading-element\" dir=\"auto\">4. Computation<\/h2><a id=\"user-content-4-computation\" class=\"anchor\" aria-label=\"Permalink: 4. Computation\" href=\"#4-computation\"><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. Procedure<\/h3><a id=\"user-content-41-procedure\" class=\"anchor\" aria-label=\"Permalink: 4.1. Procedure\" href=\"#41-procedure\"><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=\"1. Draw S posterior samples (MCMC, ensemble members, or dropout passes)\n2. For each sample s:\n     Var_fit  = variance of the predicted values over data points\n     Var_res  = variance of the residuals, or the model noise variance\n     R2^(s)   = Var_fit \/ (Var_fit + Var_res)\n3. Collect {R2^(1) ... R2^(S)} as the posterior distribution of R2\n     median   -&gt; point estimate\n     quantiles-&gt; credible interval\"><pre lang=\"text\" class=\"notranslate\"><code>1. Draw S posterior samples (MCMC, ensemble members, or dropout passes)\n2. For each sample s:\n     Var_fit  = variance of the predicted values over data points\n     Var_res  = variance of the residuals, or the model noise variance\n     R2^(s)   = Var_fit \/ (Var_fit + Var_res)\n3. Collect {R2^(1) ... R2^(S)} as the posterior distribution of R2\n     median   -&gt; point estimate\n     quantiles-&gt; credible interval\n<\/code><\/pre><\/div>\n<p dir=\"auto\">The input is a single matrix of shape <code>(S, n)<\/code> whose rows are posterior draws and\nwhose columns are data points. The variances run along the column direction, that is\nacross data points, never across draws. Taking the other axis measures how much the\nprediction for one point moves from draw to draw, which is a different quantity\naltogether and not R\u00b2.<\/p>\n<div class=\"markdown-heading\" dir=\"auto\"><h3 class=\"heading-element\" dir=\"auto\">4.2. Implementation<\/h3><a id=\"user-content-42-implementation\" class=\"anchor\" aria-label=\"Permalink: 4.2. Implementation\" href=\"#42-implementation\"><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=\"# Python\nimport numpy as np\n\n\ndef bayesian_r2_empirical(y_pred_draws: np.ndarray = None, y_true: np.ndarray = None) -&gt; np.ndarray:\n    &quot;&quot;&quot;Bayesian R2 using the variance of the residuals actually left over.\n\n    Args:\n        y_pred_draws: posterior draws of the predictive mean, shape (S, n).\n        y_true: observations, shape (n,).\n\n    Returns:\n        R2 draws of shape (S,), every element inside [0, 1].\n    &quot;&quot;&quot;\n    var_fit = y_pred_draws.var(axis=1, ddof=1)           # variance over data points\n    var_res = (y_true[None, :] - y_pred_draws).var(axis=1, ddof=1)\n    return var_fit \/ (var_fit + var_res)\n\n\ndef bayesian_r2_model_based(y_pred_draws: np.ndarray = None, sigma_draws: np.ndarray = None) -&gt; np.ndarray:\n    &quot;&quot;&quot;Bayesian R2 using the noise variance the model claims for itself.&quot;&quot;&quot;\n    var_fit = y_pred_draws.var(axis=1, ddof=1)\n    return var_fit \/ (var_fit + sigma_draws ** 2)\n\n\n# posterior_mean_draws: shape (S, n), y_observed: shape (n,)\nr2_draws = bayesian_r2_empirical(y_pred_draws=posterior_mean_draws, y_true=y_observed)\npoint = np.median(r2_draws)\nlower, upper = np.quantile(r2_draws, [0.05, 0.95])       # 90% credible interval\"><pre><span class=\"pl-c\"># Python<\/span>\n<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\">bayesian_r2_empirical<\/span>(<span class=\"pl-s1\">y_pred_draws<\/span>: <span class=\"pl-s1\">np<\/span>.<span class=\"pl-c1\">ndarray<\/span> <span class=\"pl-c1\">=<\/span> <span class=\"pl-c1\">None<\/span>, <span class=\"pl-s1\">y_true<\/span>: <span class=\"pl-s1\">np<\/span>.<span class=\"pl-c1\">ndarray<\/span> <span class=\"pl-c1\">=<\/span> <span class=\"pl-c1\">None<\/span>) <span class=\"pl-c1\">-&gt;<\/span> <span class=\"pl-s1\">np<\/span>.<span class=\"pl-c1\">ndarray<\/span>:\n    <span class=\"pl-s\">\"\"\"Bayesian R2 using the variance of the residuals actually left over.<\/span>\n<span class=\"pl-s\"><\/span>\n<span class=\"pl-s\">    Args:<\/span>\n<span class=\"pl-s\">        y_pred_draws: posterior draws of the predictive mean, shape (S, n).<\/span>\n<span class=\"pl-s\">        y_true: observations, shape (n,).<\/span>\n<span class=\"pl-s\"><\/span>\n<span class=\"pl-s\">    Returns:<\/span>\n<span class=\"pl-s\">        R2 draws of shape (S,), every element inside &#91;0, 1&#93;.<\/span>\n<span class=\"pl-s\">    \"\"\"<\/span>\n    <span class=\"pl-s1\">var_fit<\/span> <span class=\"pl-c1\">=<\/span> <span class=\"pl-s1\">y_pred_draws<\/span>.<span class=\"pl-c1\">var<\/span>(<span class=\"pl-s1\">axis<\/span><span class=\"pl-c1\">=<\/span><span class=\"pl-c1\">1<\/span>, <span class=\"pl-s1\">ddof<\/span><span class=\"pl-c1\">=<\/span><span class=\"pl-c1\">1<\/span>)           <span class=\"pl-c\"># variance over data points<\/span>\n    <span class=\"pl-s1\">var_res<\/span> <span class=\"pl-c1\">=<\/span> (<span class=\"pl-s1\">y_true<\/span>&#91;<span class=\"pl-c1\">None<\/span>, :&#93; <span class=\"pl-c1\">-<\/span> <span class=\"pl-s1\">y_pred_draws<\/span>).<span class=\"pl-c1\">var<\/span>(<span class=\"pl-s1\">axis<\/span><span class=\"pl-c1\">=<\/span><span class=\"pl-c1\">1<\/span>, <span class=\"pl-s1\">ddof<\/span><span class=\"pl-c1\">=<\/span><span class=\"pl-c1\">1<\/span>)\n    <span class=\"pl-k\">return<\/span> <span class=\"pl-s1\">var_fit<\/span> <span class=\"pl-c1\">\/<\/span> (<span class=\"pl-s1\">var_fit<\/span> <span class=\"pl-c1\">+<\/span> <span class=\"pl-s1\">var_res<\/span>)\n\n\n<span class=\"pl-k\">def<\/span> <span class=\"pl-en\">bayesian_r2_model_based<\/span>(<span class=\"pl-s1\">y_pred_draws<\/span>: <span class=\"pl-s1\">np<\/span>.<span class=\"pl-c1\">ndarray<\/span> <span class=\"pl-c1\">=<\/span> <span class=\"pl-c1\">None<\/span>, <span class=\"pl-s1\">sigma_draws<\/span>: <span class=\"pl-s1\">np<\/span>.<span class=\"pl-c1\">ndarray<\/span> <span class=\"pl-c1\">=<\/span> <span class=\"pl-c1\">None<\/span>) <span class=\"pl-c1\">-&gt;<\/span> <span class=\"pl-s1\">np<\/span>.<span class=\"pl-c1\">ndarray<\/span>:\n    <span class=\"pl-s\">\"\"\"Bayesian R2 using the noise variance the model claims for itself.\"\"\"<\/span>\n    <span class=\"pl-s1\">var_fit<\/span> <span class=\"pl-c1\">=<\/span> <span class=\"pl-s1\">y_pred_draws<\/span>.<span class=\"pl-c1\">var<\/span>(<span class=\"pl-s1\">axis<\/span><span class=\"pl-c1\">=<\/span><span class=\"pl-c1\">1<\/span>, <span class=\"pl-s1\">ddof<\/span><span class=\"pl-c1\">=<\/span><span class=\"pl-c1\">1<\/span>)\n    <span class=\"pl-k\">return<\/span> <span class=\"pl-s1\">var_fit<\/span> <span class=\"pl-c1\">\/<\/span> (<span class=\"pl-s1\">var_fit<\/span> <span class=\"pl-c1\">+<\/span> <span class=\"pl-s1\">sigma_draws<\/span> <span class=\"pl-c1\">**<\/span> <span class=\"pl-c1\">2<\/span>)\n\n\n<span class=\"pl-c\"># posterior_mean_draws: shape (S, n), y_observed: shape (n,)<\/span>\n<span class=\"pl-s1\">r2_draws<\/span> <span class=\"pl-c1\">=<\/span> <span class=\"pl-en\">bayesian_r2_empirical<\/span>(<span class=\"pl-s1\">y_pred_draws<\/span><span class=\"pl-c1\">=<\/span><span class=\"pl-s1\">posterior_mean_draws<\/span>, <span class=\"pl-s1\">y_true<\/span><span class=\"pl-c1\">=<\/span><span class=\"pl-s1\">y_observed<\/span>)\n<span class=\"pl-s1\">point<\/span> <span class=\"pl-c1\">=<\/span> <span class=\"pl-s1\">np<\/span>.<span class=\"pl-c1\">median<\/span>(<span class=\"pl-s1\">r2_draws<\/span>)\n<span class=\"pl-s1\">lower<\/span>, <span class=\"pl-s1\">upper<\/span> <span class=\"pl-c1\">=<\/span> <span class=\"pl-s1\">np<\/span>.<span class=\"pl-c1\">quantile<\/span>(<span class=\"pl-s1\">r2_draws<\/span>, &#91;<span class=\"pl-c1\">0.05<\/span>, <span class=\"pl-c1\">0.95<\/span>&#93;)       <span class=\"pl-c\"># 90% credible interval<\/span><\/pre><\/div>\n<p dir=\"auto\">The arithmetic is two variances and one division; the cost of the method sits entirely\nin obtaining the posterior draws. The two variants of 3.3 are two separate functions\nrather than one function with a switch, so a caller cannot silently supply the inputs of\none variant and receive the other.<\/p>\n<div class=\"markdown-heading\" dir=\"auto\"><h2 class=\"heading-element\" dir=\"auto\">5. Interpretation<\/h2><a id=\"user-content-5-interpretation\" class=\"anchor\" aria-label=\"Permalink: 5. Interpretation\" href=\"#5-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\">5.1. Point Estimate and Credible Interval<\/h3><a id=\"user-content-51-point-estimate-and-credible-interval\" class=\"anchor\" aria-label=\"Permalink: 5.1. Point Estimate and Credible Interval\" href=\"#51-point-estimate-and-credible-interval\"><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 posterior distribution of R\u00b2 is not symmetric. The closer R\u00b2 comes to 1, the more\nthe upper side is blocked by the ceiling at 1, which leaves a long tail on the left.\nIn such a distribution the mean is dragged toward the tail, so the median serves as\nthe point estimate and quantiles define the interval.<\/p>\n<p dir=\"auto\">The width of that interval is the confidence in the explanatory power.\n<code>0.87 &#91;0.85, 0.89&#93;<\/code> and <code>0.87 &#91;0.61, 0.95&#93;<\/code> share a point estimate but are entirely\ndifferent results, and the latter means the data are too thin to accept a model on the\nstrength of R\u00b2.<\/p>\n<p dir=\"auto\">This interval is a credible interval, not a confidence interval. Reading it directly as\n\"R\u00b2 lies in this interval with probability 90%\" is the property that distinguishes a\ncredible interval, defined in <a href=\"#appendix-a-terminology\">Appendix A. Terminology<\/a>.<\/p>\n<div class=\"markdown-heading\" dir=\"auto\"><h3 class=\"heading-element\" dir=\"auto\">5.2. Uncertainty Decomposition<\/h3><a id=\"user-content-52-uncertainty-decomposition\" class=\"anchor\" aria-label=\"Permalink: 5.2. Uncertainty Decomposition\" href=\"#52-uncertainty-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\">A single result carries two separable kinds of uncertainty.<\/p>\n<ul dir=\"auto\">\n<li>The width of the R\u00b2 distribution \u2014 uncertainty from not having pinned down the parameters, which shrinks as more data arrive.<\/li>\n<li>The magnitude of <code>Var_res<\/code> \u2014 noise inherent in the data, which does not shrink with more data.<\/li>\n<\/ul>\n<p dir=\"auto\">A wide interval therefore calls for a larger sample, whereas a narrow interval around a\nlow R\u00b2 calls for different input variables or a different model structure. Standard R\u00b2\ncannot separate the two and returns the same number in both situations.<\/p>\n<div class=\"markdown-heading\" dir=\"auto\"><h2 class=\"heading-element\" dir=\"auto\">6. Tools<\/h2><a id=\"user-content-6-tools\" class=\"anchor\" aria-label=\"Permalink: 6. Tools\" href=\"#6-tools\"><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\"><strong>Table 3. Available implementations<\/strong><\/p>\n<markdown-accessiblity-table><table>\n<thead>\n<tr>\n<th>Environment<\/th>\n<th>Interface<\/th>\n<th>Note<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>R<\/td>\n<td><code>bayes_R2(fit)<\/code> \u2014 rstanarm, brms<\/td>\n<td>Maintained by the authors of the paper and taken as the reference implementation<\/td>\n<\/tr>\n<tr>\n<td>R<\/td>\n<td><code>loo_R2(fit)<\/code> \u2014 rstanarm, brms<\/td>\n<td>The variant carrying an out-of-sample correction<\/td>\n<\/tr>\n<tr>\n<td>Python<\/td>\n<td><code>az.r2_score()<\/code> \u2014 ArviZ<\/td>\n<td>Takes predictive samples and observations and returns a summary<\/td>\n<\/tr>\n<tr>\n<td>Any<\/td>\n<td>Custom implementation<\/td>\n<td>Two variances and a division, so it ports with little effort<\/td>\n<\/tr>\n<\/tbody>\n<\/table><\/markdown-accessiblity-table>\n<p dir=\"auto\">A custom implementation should first be reconciled against the reference implementation\non the same data. A mismatch usually traces back to the variant chosen in 3.3 or to the\naxis direction described in 4.1.<\/p>\n<div class=\"markdown-heading\" dir=\"auto\"><h2 class=\"heading-element\" dir=\"auto\">7. Prerequisites<\/h2><a id=\"user-content-7-prerequisites\" class=\"anchor\" aria-label=\"Permalink: 7. Prerequisites\" href=\"#7-prerequisites\"><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 binding constraint lies in applicability rather than in the definition. Bayesian R\u00b2\nrequires genuine posterior draws.<\/p>\n<div class=\"markdown-heading\" dir=\"auto\"><h3 class=\"heading-element\" dir=\"auto\">7.1. Applicable Models<\/h3><a id=\"user-content-71-applicable-models\" class=\"anchor\" aria-label=\"Permalink: 7.1. Applicable Models\" href=\"#71-applicable-models\"><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\"><strong>Table 4. Model applicability<\/strong><\/p>\n<markdown-accessiblity-table><table>\n<thead>\n<tr>\n<th>Model type<\/th>\n<th>Applicable<\/th>\n<th>Reason<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>Bayesian models such as Stan, PyMC, brms<\/td>\n<td>Yes<\/td>\n<td>MCMC supplies posterior draws directly<\/td>\n<\/tr>\n<tr>\n<td>Deep ensemble<\/td>\n<td>Yes<\/td>\n<td>Each member plays the role of one draw<\/td>\n<\/tr>\n<tr>\n<td>MC dropout<\/td>\n<td>Yes<\/td>\n<td>Repeated forward passes generate the draws<\/td>\n<\/tr>\n<tr>\n<td>Bootstrap ensemble<\/td>\n<td>Yes<\/td>\n<td>Each resample is refitted to produce a draw<\/td>\n<\/tr>\n<tr>\n<td>Single Gaussian head emitting one mu and one sigma<\/td>\n<td>No<\/td>\n<td>Without draws no distribution can be formed<\/td>\n<\/tr>\n<tr>\n<td>Point-estimate models such as a plain GBM or a single network<\/td>\n<td>No<\/td>\n<td>Only one set of predictions exists<\/td>\n<\/tr>\n<\/tbody>\n<\/table><\/markdown-accessiblity-table>\n<p dir=\"auto\">Deep ensembles and MC dropout do not yield posterior draws in the strict sense, but they\nact as samples from the predictive distribution, so the same computation holds. When the\nmember count is as low as five, however, the quantiles are unstable and the interval\nshould not be read narrowly.<\/p>\n<div class=\"markdown-heading\" dir=\"auto\"><h3 class=\"heading-element\" dir=\"auto\">7.2. Inapplicable Models<\/h3><a id=\"user-content-72-inapplicable-models\" class=\"anchor\" aria-label=\"Permalink: 7.2. Inapplicable Models\" href=\"#72-inapplicable-models\"><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 model that emits a single <code>mu<\/code> and a single <code>sigma<\/code> has a predictive distribution but\nno posterior draws. The <code>sigma<\/code> expresses aleatoric uncertainty, yet the parameter\nuncertainty that would make R\u00b2 move is absent, so R\u00b2 is fixed at one value regardless.\nSuch a case calls for a metric that does not demand draws, such as the CRPS Skill Score\ndiscussed in 8. Comparison.<\/p>\n<div class=\"markdown-heading\" dir=\"auto\"><h2 class=\"heading-element\" dir=\"auto\">8. Comparison<\/h2><a id=\"user-content-8-comparison\" class=\"anchor\" aria-label=\"Permalink: 8. Comparison\" href=\"#8-comparison\"><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\"><strong>Table 5. Bayesian R\u00b2 vs CRPS Skill Score<\/strong><\/p>\n<markdown-accessiblity-table><table>\n<thead>\n<tr>\n<th>Aspect<\/th>\n<th>Bayesian R\u00b2<\/th>\n<th>CRPS Skill Score<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>Output<\/td>\n<td>Point estimate and interval<\/td>\n<td>A single score<\/td>\n<\/tr>\n<tr>\n<td>Interval<\/td>\n<td>Present<\/td>\n<td>Absent<\/td>\n<\/tr>\n<tr>\n<td>Sample requirement<\/td>\n<td>S posterior draws<\/td>\n<td>Only a predictive distribution<\/td>\n<\/tr>\n<tr>\n<td>Question answered<\/td>\n<td>How large is the explanatory power and how certain is it<\/td>\n<td>How well did the predictive distribution match<\/td>\n<\/tr>\n<tr>\n<td>Baseline<\/td>\n<td>The total variation of the data<\/td>\n<td>An explicitly designated baseline model<\/td>\n<\/tr>\n<\/tbody>\n<\/table><\/markdown-accessiblity-table>\n<p dir=\"auto\">The two metrics are not competitors; their applicability differs. Where posterior draws\ncan be obtained, Bayesian R\u00b2 carries more information because it also supplies an\ninterval, and where they cannot, the CRPS Skill Score is what remains.<\/p>\n<div class=\"markdown-heading\" dir=\"auto\"><h2 class=\"heading-element\" dir=\"auto\">9. Pitfalls<\/h2><a id=\"user-content-9-pitfalls\" class=\"anchor\" aria-label=\"Permalink: 9. Pitfalls\" href=\"#9-pitfalls\"><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\"><strong>Table 6. Common mistakes<\/strong><\/p>\n<markdown-accessiblity-table><table>\n<thead>\n<tr>\n<th>Mistake<\/th>\n<th>Consequence<\/th>\n<th>Fix<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>Feeding posterior predictive samples into <code>Var_fit<\/code><\/td>\n<td>Noise enters the numerator and inflates R\u00b2<\/td>\n<td>Use posterior draws of the predictive mean<\/td>\n<\/tr>\n<tr>\n<td>Taking the variance along the draw axis<\/td>\n<td>The result is a different quantity, not R\u00b2<\/td>\n<td>Take it along the data-point axis<\/td>\n<\/tr>\n<tr>\n<td>Using the mean as the point estimate<\/td>\n<td>Skewness drags the value downward<\/td>\n<td>Use the median<\/td>\n<\/tr>\n<tr>\n<td>Reporting a training-data value as generalization performance<\/td>\n<td>The value is optimistically biased<\/td>\n<td>Use out-of-sample data or the loo variant<\/td>\n<\/tr>\n<tr>\n<td>Reporting a narrow interval computed from few draws<\/td>\n<td>The interval itself is unstable<\/td>\n<td>Increase the draw count and confirm convergence first<\/td>\n<\/tr>\n<tr>\n<td>Mixing the two variants when comparing<\/td>\n<td>Model-to-model comparison loses meaning<\/td>\n<td>Fix one variant and state it<\/td>\n<\/tr>\n<\/tbody>\n<\/table><\/markdown-accessiblity-table>\n<p dir=\"auto\">The first row is the most frequent. Most tools expose both the posterior draws of the\npredictive mean and the posterior predictive samples that add observation noise on top,\nand <code>Var_fit<\/code> takes the former. Supplying the latter moves unexplained variation into\nthe explained term, so R\u00b2 reads higher than it is.<\/p>\n<div class=\"markdown-heading\" dir=\"auto\"><h2 class=\"heading-element\" dir=\"auto\">10. Summary<\/h2><a id=\"user-content-10-summary\" class=\"anchor\" aria-label=\"Permalink: 10. Summary\" href=\"#10-summary\"><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\">Bayesian R\u00b2 computes <code>Var_fit \/ (Var_fit + Var_res)<\/code> for each posterior draw s and thereby\nobtains R\u00b2 as a distribution. Because the denominator is a sum of two non-negative terms,\nthe divergence problem of standard R\u00b2 disappears structurally, and the method yields a\npoint estimate together with a credible interval. In exchange, it applies only to Bayesian\nmodels and ensemble-style models from which draws can be taken.<\/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] Gelman, A., Goodrich, B., Gabry, J., &amp; Vehtari, A. (2019). <a href=\"https:\/\/doi.org\/10.1080\/00031305.2018.1549100\" rel=\"nofollow\">R-squared for Bayesian Regression Models<\/a>. <em>The American Statistician<\/em>, 73(3), 307-309. Proposes the form section 3.2 uses, in which the denominator is the sum of the explained and the residual variance, so that the value stays inside [0, 1] for every posterior draw.<\/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><strong>aleatoric uncertainty<\/strong>: Uncertainty originating in the noise of the data itself, which does not shrink as more data arrive.<\/li>\n<li><strong>conjugate posterior<\/strong>: A posterior that stays in the same distribution family as the prior, so it has a closed form and can be sampled directly without MCMC.<\/li>\n<li><strong>credible interval<\/strong>: An interval defined by quantiles of the posterior distribution, read directly as the probability that the parameter lies within it.<\/li>\n<li><strong>CRPS<\/strong>: Continuous Ranked Probability Score. A score comparing an entire predictive distribution against a single observation, where smaller is better.<\/li>\n<li><strong>CRPS Skill Score<\/strong>: CRPS normalized by the CRPS of a baseline model into the form <code>1 \u2212 CRPS_model \/ CRPS_baseline<\/code>, where larger is better.<\/li>\n<li><strong>deep ensemble<\/strong>: A predictive distribution built from several networks trained independently under different initializations or data orderings.<\/li>\n<li><strong>GBM<\/strong>: Gradient Boosting Machine. A point-estimate model built as a sum of trees fitted in sequence.<\/li>\n<li><strong>LOO<\/strong>: Leave-One-Out cross-validation. Estimating out-of-sample performance by holding out one observation at a time.<\/li>\n<li><strong>MC dropout<\/strong>: Obtaining predictive samples by repeating forward passes with dropout left active at inference time.<\/li>\n<li><strong>MCMC<\/strong>: Markov Chain Monte Carlo. The standard family of algorithms for drawing samples from a posterior distribution.<\/li>\n<li><strong>OLS<\/strong>: Ordinary Least Squares. The fit minimizing the sum of squared residuals.<\/li>\n<li><strong>posterior distribution<\/strong>: The distribution of the parameters after the data have been observed.<\/li>\n<li><strong>posterior draw<\/strong>: One sample taken from the posterior distribution.<\/li>\n<li><strong>posterior predictive sample<\/strong>: A sample at the scale of an observation, generated by adding observation noise on top of a posterior draw.<\/li>\n<li><strong>reference prior<\/strong>: A prior chosen to carry as little information as possible, so the posterior is driven by the data rather than by the prior.<\/li>\n<li><strong>shrinkage<\/strong>: The pull a prior or a hierarchical structure exerts on estimates toward a common center.<\/li>\n<\/ul>\n<div class=\"markdown-heading\" dir=\"auto\"><h2 class=\"heading-element\" dir=\"auto\">Appendix B. Worked Example<\/h2><a id=\"user-content-appendix-b-worked-example\" class=\"anchor\" aria-label=\"Permalink: Appendix B. Worked Example\" href=\"#appendix-b-worked-example\"><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\">Every number in this appendix is produced by <code>bayesian_r2_example.py<\/code>, invoked as\n<code>python3 bayesian_r2_example.py --draws 4000<\/code>. The seed is fixed inside the script, so the\nvalues reproduce exactly.<\/p>\n<div class=\"markdown-heading\" dir=\"auto\"><h3 class=\"heading-element\" dir=\"auto\">B.1. Data and Reference Fit<\/h3><a id=\"user-content-b1-data-and-reference-fit\" class=\"anchor\" aria-label=\"Permalink: B.1. Data and Reference Fit\" href=\"#b1-data-and-reference-fit\"><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 dataset has n = 8 points. The OLS fit gives an intercept of \u22120.018 and a slope of\n2.051, and the residuals are the values the model failed to reproduce.<\/p>\n<p dir=\"auto\"><strong>Table 7. Worked example data and OLS fit<\/strong><\/p>\n<markdown-accessiblity-table><table>\n<thead>\n<tr>\n<th>i<\/th>\n<th>x<\/th>\n<th>y<\/th>\n<th>y_hat (OLS)<\/th>\n<th>Residual<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>1<\/td>\n<td>1<\/td>\n<td>1.8<\/td>\n<td>2.033<\/td>\n<td>\u22120.233<\/td>\n<\/tr>\n<tr>\n<td>2<\/td>\n<td>2<\/td>\n<td>4.9<\/td>\n<td>4.085<\/td>\n<td>0.815<\/td>\n<\/tr>\n<tr>\n<td>3<\/td>\n<td>3<\/td>\n<td>5.2<\/td>\n<td>6.136<\/td>\n<td>\u22120.936<\/td>\n<\/tr>\n<tr>\n<td>4<\/td>\n<td>4<\/td>\n<td>8.9<\/td>\n<td>8.187<\/td>\n<td>0.713<\/td>\n<\/tr>\n<tr>\n<td>5<\/td>\n<td>5<\/td>\n<td>9.4<\/td>\n<td>10.238<\/td>\n<td>\u22120.838<\/td>\n<\/tr>\n<tr>\n<td>6<\/td>\n<td>6<\/td>\n<td>13.6<\/td>\n<td>12.289<\/td>\n<td>1.311<\/td>\n<\/tr>\n<tr>\n<td>7<\/td>\n<td>7<\/td>\n<td>12.8<\/td>\n<td>14.340<\/td>\n<td>\u22121.540<\/td>\n<\/tr>\n<tr>\n<td>8<\/td>\n<td>8<\/td>\n<td>17.1<\/td>\n<td>16.392<\/td>\n<td>0.708<\/td>\n<\/tr>\n<\/tbody>\n<\/table><\/markdown-accessiblity-table>\n<p dir=\"auto\">The observations have a mean of 9.213 and a sample variance of 26.301, and the standard R\u00b2\nof this fit is 0.9598. That single number is the reference the rest of the appendix is\nmeasured against.<\/p>\n<div class=\"markdown-heading\" dir=\"auto\"><h3 class=\"heading-element\" dir=\"auto\">B.2. Posterior Draws<\/h3><a id=\"user-content-b2-posterior-draws\" class=\"anchor\" aria-label=\"Permalink: B.2. Posterior Draws\" href=\"#b2-posterior-draws\"><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 posterior is the conjugate posterior of the linear model under the reference prior\n<code>p(beta, sigma^2)<\/code> proportional to <code>1 \/ sigma^2<\/code>, which has a closed form and can be sampled\nexactly without MCMC. Four thousand draws are taken. Each draw is a complete model, so each\nproduces its own R\u00b2; the first five are shown in full.<\/p>\n<p dir=\"auto\"><strong>Table 8. First five posterior draws and their empirical-variant R\u00b2<\/strong><\/p>\n<markdown-accessiblity-table><table>\n<thead>\n<tr>\n<th>s<\/th>\n<th>a<\/th>\n<th>b<\/th>\n<th>sigma<\/th>\n<th>Var_fit<\/th>\n<th>Var_res<\/th>\n<th>Bayesian R\u00b2<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>1<\/td>\n<td>0.369<\/td>\n<td>1.903<\/td>\n<td>1.826<\/td>\n<td>21.740<\/td>\n<td>1.188<\/td>\n<td>0.9482<\/td>\n<\/tr>\n<tr>\n<td>2<\/td>\n<td>0.556<\/td>\n<td>1.952<\/td>\n<td>0.922<\/td>\n<td>22.857<\/td>\n<td>1.116<\/td>\n<td>0.9534<\/td>\n<\/tr>\n<tr>\n<td>3<\/td>\n<td>0.754<\/td>\n<td>1.757<\/td>\n<td>1.142<\/td>\n<td>18.524<\/td>\n<td>1.576<\/td>\n<td>0.9216<\/td>\n<\/tr>\n<tr>\n<td>4<\/td>\n<td>1.151<\/td>\n<td>1.866<\/td>\n<td>0.743<\/td>\n<td>20.900<\/td>\n<td>1.262<\/td>\n<td>0.9431<\/td>\n<\/tr>\n<tr>\n<td>5<\/td>\n<td>0.266<\/td>\n<td>2.007<\/td>\n<td>0.844<\/td>\n<td>24.164<\/td>\n<td>1.069<\/td>\n<td>0.9576<\/td>\n<\/tr>\n<\/tbody>\n<\/table><\/markdown-accessiblity-table>\n<p dir=\"auto\">Draw 1 is worked through explicitly. Its predictions are <code>0.369 + 1.903 x<\/code>, whose variance\nacross the eight points is 21.740; its residuals have variance 1.188; the ratio\n<code>21.740 \/ (21.740 + 1.188)<\/code> gives 0.9482.<\/p>\n<div class=\"markdown-heading\" dir=\"auto\"><h3 class=\"heading-element\" dir=\"auto\">B.3. Credible Interval<\/h3><a id=\"user-content-b3-credible-interval\" class=\"anchor\" aria-label=\"Permalink: B.3. Credible Interval\" href=\"#b3-credible-interval\"><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 point of the method is the interval, so the summary over all 4,000 draws is the result\nthat matters. None of the draws left [0, 1].<\/p>\n<p dir=\"auto\"><strong>Table 9. Bayesian R\u00b2 over 4,000 posterior draws<\/strong><\/p>\n<markdown-accessiblity-table><table>\n<thead>\n<tr>\n<th>Variant<\/th>\n<th>Median<\/th>\n<th>90% credible interval<\/th>\n<th>Full range of draws<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>Empirical<\/td>\n<td>0.9571<\/td>\n<td>[0.9112, 0.9613]<\/td>\n<td>[0.0983, 0.9614]<\/td>\n<\/tr>\n<tr>\n<td>Model-based<\/td>\n<td>0.9482<\/td>\n<td>[0.8294, 0.9780]<\/td>\n<td>[0.0771, 0.9893]<\/td>\n<\/tr>\n<\/tbody>\n<\/table><\/markdown-accessiblity-table>\n<p dir=\"auto\">The reported result for this dataset is therefore <code>0.9571 &#91;0.9112, 0.9613&#93;<\/code> under the\nempirical variant. The interval is what standard R\u00b2 cannot supply: the single OLS number\n0.9598 gives no indication that a posterior draw consistent with these eight points can\nexplain as little as 91% of the variation, or that the extreme tail reaches 0.10.<\/p>\n<p dir=\"auto\"><a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https:\/\/github.com\/ykim2718\/AIML\/blob\/main\/Metrics\/R2\/Bayesian-R2\/bayesian-r2_fig\/bayesian_r2_posterior.png\"><img src=\"https:\/\/ykim.synology.me\/wordpress\/wp-json\/gh-readme\/v1\/asset?user=ykim2718&#038;repo=AIML&#038;branch=main&#038;path=Metrics\/R2\/Bayesian-R2\/bayesian-r2_fig\/bayesian_r2_posterior.png&#038;sig=5872b83c1518ae35595aab635765f03dbdfc052c37076b8b1ebd377406b217a8\" alt=\"Fig 1\" style=\"max-width: 100%;\"><\/a><\/p>\n<p dir=\"auto\"><strong>Fig 1. Posterior fits and the resulting distribution of Bayesian R\u00b2<\/strong><\/p>\n<p dir=\"auto\">Panel (a) overlays 200 posterior fits on the data, and the fan of slopes is the source of\nthe spread. Panel (b) is the distribution those fits produce. Its shape confirms the claim\nof 5.1: the mass piles against a ceiling near 0.961 and trails away to the left, so the mean\nsits below the median and the median is the honest point estimate. The interval is strongly\nasymmetric for the same reason, with the lower bound 0.046 away from the median and the\nupper bound only 0.004 away.<\/p>\n<p dir=\"auto\">The two variants disagree by more than rounding. The model-based median is 0.9482 against\n0.9571, and its interval is roughly three times wider, because <code>sigma<\/code> is itself uncertain\nand that uncertainty enters the denominator directly. The direction of the gap is the\nreverse of the case sketched in 3.3: with only eight points the posterior of <code>sigma^2<\/code> is\nright-skewed and its median, 1.387, sits above the median empirical residual variance of\n1.152, so here the model claims more noise than the residuals show rather than less. A\nfigure produced under one variant cannot be set against a figure produced under the other.<\/p>\n<div class=\"markdown-heading\" dir=\"auto\"><h3 class=\"heading-element\" dir=\"auto\">B.4. Constructed Predictors and the Range Boundary<\/h3><a id=\"user-content-b4-constructed-predictors-and-the-range-boundary\" class=\"anchor\" aria-label=\"Permalink: B.4. Constructed Predictors and the Range Boundary\" href=\"#b4-constructed-predictors-and-the-range-boundary\"><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\">Four predictors are constructed by hand, ranging from well calibrated to collapsed. These\nare not posterior draws; they are chosen to move bias and scale on purpose.<\/p>\n<p dir=\"auto\"><strong>Table 10. Two definitions on hand-constructed predictors<\/strong><\/p>\n<markdown-accessiblity-table><table>\n<thead>\n<tr>\n<th>Predictor<\/th>\n<th>a<\/th>\n<th>b<\/th>\n<th>Standard R\u00b2<\/th>\n<th>Bayesian R\u00b2<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>Well calibrated<\/td>\n<td>0.10<\/td>\n<td>2.05<\/td>\n<td>0.9593<\/td>\n<td>0.9598<\/td>\n<\/tr>\n<tr>\n<td>Mildly shrunk<\/td>\n<td>1.10<\/td>\n<td>1.83<\/td>\n<td>0.9480<\/td>\n<td>0.9370<\/td>\n<\/tr>\n<tr>\n<td>Strongly shrunk<\/td>\n<td>4.60<\/td>\n<td>1.05<\/td>\n<td>0.7306<\/td>\n<td>0.4833<\/td>\n<\/tr>\n<tr>\n<td>Collapsed to a wrong center<\/td>\n<td>12.00<\/td>\n<td>0.20<\/td>\n<td>\u22120.4128<\/td>\n<td>0.0110<\/td>\n<\/tr>\n<\/tbody>\n<\/table><\/markdown-accessiblity-table>\n<p dir=\"auto\">Across the two shrunk rows the Gelman form falls faster than the standard form. Shrinking a\npredictor drains variance out of the numerator and adds it to the denominator, so Bayesian R\u00b2\nresponds through two channels, whereas the standard form holds <code>SS_tot<\/code> fixed and responds\nonly through a growing <code>SS_res<\/code>.<\/p>\n<p dir=\"auto\">The last row is where the standard form leaves its own range. Those predictions are worse\nthan simply reporting the mean of y, which drives <code>SS_res<\/code> above <code>SS_tot<\/code> and the value to\n\u22120.4128. This is the failure described in 3.1, and it is why values of a standard R\u00b2\ncomputed per draw cannot be pooled into a distribution. The Gelman form records the same\nfailure as 0.0110, near the bottom of a range it never leaves.<\/p>\n<div class=\"markdown-heading\" dir=\"auto\"><h3 class=\"heading-element\" dir=\"auto\">B.5. Summary of the Comparison<\/h3><a id=\"user-content-b5-summary-of-the-comparison\" class=\"anchor\" aria-label=\"Permalink: B.5. Summary of the Comparison\" href=\"#b5-summary-of-the-comparison\"><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\"><strong>Table 11. What each metric reports on this dataset<\/strong><\/p>\n<markdown-accessiblity-table><table>\n<thead>\n<tr>\n<th>Metric<\/th>\n<th>Value<\/th>\n<th>What it answers<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>Standard R\u00b2 on the OLS fit<\/td>\n<td>0.9598<\/td>\n<td>How much variation does the single best fit explain<\/td>\n<\/tr>\n<tr>\n<td>Bayesian R\u00b2, median<\/td>\n<td>0.9571<\/td>\n<td>How much variation does a typical posterior draw explain<\/td>\n<\/tr>\n<tr>\n<td>Bayesian R\u00b2, 90% credible interval<\/td>\n<td>[0.9112, 0.9613]<\/td>\n<td>How far can that explanatory power be from its median<\/td>\n<\/tr>\n<\/tbody>\n<\/table><\/markdown-accessiblity-table>\n<p dir=\"auto\">The two definitions agree on a well-calibrated predictor and separate as soon as the\npredictions are biased or shrunk. Only Bayesian R\u00b2 carries an interval, and on this dataset that\ninterval is the finding: eight points support a median of 0.957 but not the precision that\nthe bare number 0.9598 appears to promise.<\/p>\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-tab6789_a62516-85\"><div class=\"kt-tab-inner-content-inner\"><p><div class=\"github-readme-container markdown-body\"><div id=\"file\" class=\"md\" data-path=\"Metrics\/R2\/Bayesian-R2\/bayesian-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\">Bayesian R\u00b2 \u2014 Obtaining R\u00b2 as a Distribution Instead of a Point<\/h1><a id=\"user-content-bayesian-r--obtaining-r-as-a-distribution-instead-of-a-point\" class=\"anchor\" aria-label=\"Permalink: Bayesian R\u00b2 \u2014 Obtaining R\u00b2 as a Distribution Instead of a Point\" href=\"#bayesian-r--obtaining-r-as-a-distribution-instead-of-a-point\"><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 5 | Created: 2026-09-04 | Updated: 2026-11-07 13:46 UTC<\/p>\n<ul dir=\"auto\">\n<li><a href=\"#1-motivation\">1. Motivation<\/a><\/li>\n<li><a href=\"#2-core-idea\">2. Core Idea<\/a><\/li>\n<li><a href=\"#3-definition\">3. Definition<\/a>\n<ul dir=\"auto\">\n<li><a href=\"#31-divergence-problem-of-the-standard-form\">3.1. Divergence Problem of the Standard Form<\/a><\/li>\n<li><a href=\"#32-gelman-formulation\">3.2. Gelman Formulation<\/a><\/li>\n<li><a href=\"#33-choice-of-residual-variance\">3.3. Choice of Residual Variance<\/a><\/li>\n<\/ul>\n<\/li>\n<li><a href=\"#4-computation\">4. Computation<\/a>\n<ul dir=\"auto\">\n<li><a href=\"#41-procedure\">4.1. Procedure<\/a><\/li>\n<li><a href=\"#42-implementation\">4.2. Implementation<\/a><\/li>\n<\/ul>\n<\/li>\n<li><a href=\"#5-interpretation\">5. Interpretation<\/a>\n<ul dir=\"auto\">\n<li><a href=\"#51-point-estimate-and-credible-interval\">5.1. Point Estimate and Credible Interval<\/a><\/li>\n<li><a href=\"#52-uncertainty-decomposition\">5.2. Uncertainty Decomposition<\/a><\/li>\n<\/ul>\n<\/li>\n<li><a href=\"#6-tools\">6. Tools<\/a><\/li>\n<li><a href=\"#7-prerequisites\">7. Prerequisites<\/a>\n<ul dir=\"auto\">\n<li><a href=\"#71-applicable-models\">7.1. Applicable Models<\/a><\/li>\n<li><a href=\"#72-inapplicable-models\">7.2. Inapplicable Models<\/a><\/li>\n<\/ul>\n<\/li>\n<li><a href=\"#8-comparison\">8. Comparison<\/a><\/li>\n<li><a href=\"#9-pitfalls\">9. Pitfalls<\/a><\/li>\n<li><a href=\"#10-summary\">10. Summary<\/a><\/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-worked-example\">Appendix B. Worked Example<\/a>\n<ul dir=\"auto\">\n<li><a href=\"#b1-data-and-reference-fit\">B.1. Data and Reference Fit<\/a><\/li>\n<li><a href=\"#b2-posterior-draws\">B.2. Posterior Draws<\/a><\/li>\n<li><a href=\"#b3-credible-interval\">B.3. Credible Interval<\/a><\/li>\n<li><a href=\"#b4-constructed-predictors-and-the-range-boundary\">B.4. Constructed Predictors and the Range Boundary<\/a><\/li>\n<li><a href=\"#b5-summary-of-the-comparison\">B.5. Summary of the Comparison<\/a><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<blockquote>\n<p dir=\"auto\">Posterior draw \ub9c8\ub2e4 R\u00b2 \ub97c \ud558\ub098\uc529 \uacc4\uc0b0\ud558\uc5ec R\u00b2 \ub97c \ubd84\ud3ec\ub85c \uc5bb\ub294 \ubc29\ubc95\uc5d0 \ub300\ud55c \uae30\ub85d\uc774\uba70, \uc815\uc758, \uacc4\uc0b0,\n\ud574\uc11d, \uc801\uc6a9 \ubc94\uc704\uc758 \ucc28\ub840\ub85c \uc815\ub9ac\ud55c\ub2e4.<\/p>\n<\/blockquote>\n<div class=\"markdown-heading\" dir=\"auto\"><h2 class=\"heading-element\" dir=\"auto\">1. Motivation<\/h2><a id=\"user-content-1-motivation\" class=\"anchor\" aria-label=\"Permalink: 1. Motivation\" href=\"#1-motivation\"><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\">\ud45c\uc900 R\u00b2 \ub294 \uacb0\uc815\uacc4\uc218 <code>1 \u2212 SS_res \/ SS_tot<\/code> \uc774\uba70, \uc5ec\uae30\uc11c <code>SS_res<\/code> \ub294 \uc794\ucc28\uc81c\uacf1\ud569\uc774\uace0 <code>SS_tot<\/code> \ub294\n\uad00\uce21\uac12\uc774 \uc790\uae30 \ud3c9\uade0\uc5d0\uc11c \ubc97\uc5b4\ub09c \uc815\ub3c4\uc758 \uc81c\uacf1\ud569\uc774\ub2e4. \uc608\uce21\uac12 \ud55c \ubc8c\uc5d0\uc11c \uacc4\uc0b0\ud558\ubbc0\ub85c \uc218 \ud558\ub098\ub97c \ub3cc\ub824\uc900\ub2e4.\n\uc5b4\ub5a4 \uc801\ud569\uc774 <code>R\u00b2 = 0.87<\/code> \uc774\ub77c \ubcf4\uace0\ud560 \ub54c, \uadf8 \uc218\ub9cc\uc73c\ub85c\ub294 \ud45c\ubcf8\uc774 \uc870\uae08\ub9cc \ub2ec\ub77c\uc838\ub3c4 0.60 \uc73c\ub85c \ubb34\ub108\uc9c8\uc9c0\n0.85 \uadfc\ucc98\uc5d0\uc11c \ub2e8\ub2e8\ud788 \ubc84\ud2f8\uc9c0 \uc54c \uc218 \uc5c6\ub2e4. \uc124\uba85\ub825\uc758 \ud06c\uae30\uc640 \uadf8 \ud06c\uae30\uc5d0 \ub300\ud55c \ud655\uc2e0\uc740 \uc11c\ub85c \ub2e4\ub978 \ub450 \uac00\uc9c0\n\uc815\ubcf4\uc778\ub370, \ud45c\uc900 R\u00b2 \ub294 \uc55e\uc758 \uac83\ub9cc \uc2e3\ub294\ub2e4.<\/p>\n<p dir=\"auto\">Bayesian R\u00b2 \ub294 model \uc758 \uc608\uce21 \ubd88\ud655\uc2e4\uc131\uc744 R\u00b2 \uc790\uccb4\ub85c \uc804\ud30c\ud558\uc5ec, R\u00b2 \uac00 \uc810\uc774 \uc544\ub2c8\ub77c \ubd84\ud3ec\ub85c \ub098\uc624\uac8c \ud55c\ub2e4.\n\uacb0\uacfc\uac00 <code>0.87 &#91;0.81, 0.91&#93;<\/code> \uc758 \uaf34\uc744 \ub760\ub294 \uc774\uc720\uac00 \uc5ec\uae30\uc5d0 \uc788\ub2e4.<\/p>\n<p dir=\"auto\"><strong>Table 1. Standard R\u00b2 vs Bayesian R\u00b2<\/strong><\/p>\n<markdown-accessiblity-table><table>\n<thead>\n<tr>\n<th>Aspect<\/th>\n<th>Standard R\u00b2<\/th>\n<th>Bayesian R\u00b2<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>Output<\/td>\n<td>\uc2a4\uce7c\ub77c \ud558\ub098<\/td>\n<td>S \uac1c draw \uc5d0 \ub300\ud55c \ubd84\ud3ec<\/td>\n<\/tr>\n<tr>\n<td>Uncertainty<\/td>\n<td>\uc5c6\uc74c<\/td>\n<td>\uad6c\uac04\uc73c\ub85c \ud45c\ud604\ub428<\/td>\n<\/tr>\n<tr>\n<td>Range<\/td>\n<td>\uc74c\uc218\uac00 \ub420 \uc218 \uc788\uace0 1 \uc744 \ub118\uc9c0 \uc54a\uc74c<\/td>\n<td>\uc5b8\uc81c\ub098 [0, 1] \uc548<\/td>\n<\/tr>\n<tr>\n<td>Input required<\/td>\n<td>\uc608\uce21\uac12 \ud55c \ubc8c<\/td>\n<td>Posterior draw S \ubc8c<\/td>\n<\/tr>\n<tr>\n<td>Failure mode<\/td>\n<td>\ubd88\uc548\uc815\uc131\uc774 \ubcf4\uc774\uc9c0 \uc54a\uc74c<\/td>\n<td>Draw \uac00 \uc5c6\uc73c\uba74 \uc9c0\ud45c \uc790\uccb4\ub97c \uacc4\uc0b0\ud560 \uc218 \uc5c6\uc74c<\/td>\n<\/tr>\n<\/tbody>\n<\/table><\/markdown-accessiblity-table>\n<div class=\"markdown-heading\" dir=\"auto\"><h2 class=\"heading-element\" dir=\"auto\">2. Core Idea<\/h2><a id=\"user-content-2-core-idea\" class=\"anchor\" aria-label=\"Permalink: 2. Core Idea\" href=\"#2-core-idea\"><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\">Posterior \ubd84\ud3ec\uc5d0\uc11c \ubf51\uc740 draw s \ub9c8\ub2e4 R\u00b2 \ub97c \ud558\ub098\uc529 \uacc4\uc0b0\ud55c\ub2e4. Draw \uac00 S \uac1c\uba74 R\u00b2 \uac12\ub3c4 S \uac1c\uc774\uace0, \uadf8\n\ubaa8\uc74c\uc774 R\u00b2 \uc758 posterior \ubd84\ud3ec\uc774\ub2e4. Model parameter \uac00 \ubd88\ud655\uc2e4\ud558\uba74 \uc608\uce21\uac12\uc774 draw \ub9c8\ub2e4 \ub2ec\ub77c\uc9c0\uace0, \uc608\uce21\uac12\uc774\n\ub2ec\ub77c\uc9c0\uba74 model \uc774 \uc124\uba85\ud558\ub294 \ubcc0\ub3d9\uc758 \uc591\ub3c4 \ub2ec\ub77c\uc9c4\ub2e4. Bayesian R\u00b2 \ub294 \uadf8 \uc6c0\uc9c1\uc784\uc744 \uc9c0\uc6b0\uc9c0 \uc54a\uace0 \ubcf4\uace0\ud55c\ub2e4.<\/p>\n<div class=\"markdown-heading\" dir=\"auto\"><h2 class=\"heading-element\" dir=\"auto\">3. Definition<\/h2><a id=\"user-content-3-definition\" class=\"anchor\" aria-label=\"Permalink: 3. Definition\" href=\"#3-definition\"><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. Divergence Problem of the Standard Form<\/h3><a id=\"user-content-31-divergence-problem-of-the-standard-form\" class=\"anchor\" aria-label=\"Permalink: 3.1. Divergence Problem of the Standard Form\" href=\"#31-divergence-problem-of-the-standard-form\"><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\">\ud45c\uc900 \uc815\uc758 <code>R\u00b2 = 1 \u2212 SS_res \/ SS_tot<\/code> \ub97c \uac1c\ubcc4 posterior draw \uc5d0 \uc801\uc6a9\ud558\uba74 [0, 1] \ubc16\uc758 \uac12\uc774 \ub098\uc628\ub2e4.\n\ucd5c\uc18c\uc81c\uacf1 \uc801\ud569\uc5d0\uc11c\ub294 \uc794\ucc28\uc81c\uacf1\ud569\uc774 \ucd1d\uc81c\uacf1\ud569\uc744 \ub118\uc744 \uc218 \uc5c6\uc9c0\ub9cc, \uac1c\ubcc4 posterior draw \ub294 \uadf8 \uc790\ub8cc\uc758\n\ucd5c\uc18c\uc81c\uacf1\ud574\uac00 \uc544\ub2c8\ub2e4. Prior \ub098 \uacc4\uce35 model \uc758 shrinkage \uac00 \uc608\uce21\uac12\uc744 \uc790\ub8cc\uc5d0\uc11c \ubc00\uc5b4\ub0b4\uba74 \ud55c draw \uc758\n\uc794\ucc28\uc81c\uacf1\ud569\uc774 \ucd1d\uc81c\uacf1\ud569\uc744 \ub118\uc744 \uc218 \uc788\uace0, \uadf8 draw \uc758 R\u00b2 \ub294 \uc74c\uc218\uac00 \ub41c\ub2e4. Draw \ub9c8\ub2e4 \ubd80\ud638\uac00 \ub4a4\uc9d1\ud788\ub294 \uac12\uc758\n\ubaa8\uc74c\uc5d0\uc11c\ub294 \ud574\uc11d \uac00\ub2a5\ud55c \uc911\uc559\uac12\ub3c4 \ud574\uc11d \uac00\ub2a5\ud55c \uad6c\uac04\ub3c4 \ub098\uc624\uc9c0 \uc54a\ub294\ub2e4. \uad6c\uccb4\uc801\uc778 \uc0ac\ub840\ub294\n<a href=\"#appendix-b-worked-example\">Appendix B. Worked Example<\/a> \uc5d0 \uc788\ub2e4.<\/p>\n<div class=\"markdown-heading\" dir=\"auto\"><h3 class=\"heading-element\" dir=\"auto\">3.2. Gelman Formulation<\/h3><a id=\"user-content-32-gelman-formulation\" class=\"anchor\" aria-label=\"Permalink: 3.2. Gelman Formulation\" href=\"#32-gelman-formulation\"><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\">Gelman et al. [<a href=\"#ref-1\">1<\/a>] \uc774 \uc81c\uc548\ud55c \ud574\ubc95\uc740 \ubd84\ubaa8\ub97c \uc74c\uc774 \uc544\ub2cc \ub450 \uc591\uc758 \ud569\uc73c\ub85c \ubc14\uafb8\ub294 \uac83\uc774\ub2e4. \ube84\uc148\uc744 \uc5c6\uc560\uba74\n\uac12\uc774 \ubc1c\uc0b0\ud560 \uc218 \uc788\ub294 \uc790\ub9ac\uac00 \uc0ac\ub77c\uc9c4\ub2e4.<\/p>\n<div class=\"snippet-clipboard-content notranslate position-relative overflow-auto\" data-snippet-clipboard-copy-content=\"             Var_fit^(s)                    explained variation\nR2^(s) = \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500  =  \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n         Var_fit^(s) + Var_res^(s)      explained variation + residual variation\"><pre lang=\"text\" class=\"notranslate\"><code>             Var_fit^(s)                    explained variation\nR2^(s) = \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500  =  \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n         Var_fit^(s) + Var_res^(s)      explained variation + residual variation\n<\/code><\/pre><\/div>\n<ul dir=\"auto\">\n<li><code>Var_fit<\/code> \u2014 draw s \uc758 \uc608\uce21\uac12 <code>y_hat_i^(s)<\/code> \ub97c \uc790\ub8cc\uc810 i \uc5d0 \uac78\uccd0 \uc7b0 \ubd84\uc0b0\uc774\uba70, model \uc774 \uc124\uba85\ud558\ub294 \ubcc0\ub3d9.<\/li>\n<li><code>Var_res<\/code> \u2014 draw s \uac00 \uc124\uba85\ud558\uc9c0 \ubabb\ud558\uace0 \ub0a8\uae34 \ubcc0\ub3d9.<\/li>\n<\/ul>\n<p dir=\"auto\">\ub450 \ud56d \ubaa8\ub450 \ubd84\uc0b0\uc774\ubbc0\ub85c \uc74c\uc774 \uc544\ub2c8\uace0, \ubd84\ubaa8\uac00 \uadf8 \ud569\uc774\ubbc0\ub85c \ube44\ub294 \uad6c\uc870\uc801\uc73c\ub85c [0, 1] \uc5d0 \uac07\ud78c\ub2e4. \ubd84\uc790\uac00\n\uc0ac\ub77c\uc9c0\uba74 \uac12\uc740 0 \uc774\uace0, <code>Var_res<\/code> \uac00 0 \uc5d0 \uac00\uae4c\uc6cc\uc9c0\uba74 1 \uc5d0 \ub2e4\uac00\uac04\ub2e4. \ud45c\uc900 \uaf34\uacfc \ub2ec\ub9ac \uc5b4\ub5a4 posterior\ndraw \ub3c4 \uac12\uc744 \uc815\uc758 \ubc16\uc73c\ub85c \ubc00\uc5b4\ub0bc \uc218 \uc5c6\ub2e4.<\/p>\n<p dir=\"auto\">\uc5ec\uae30\uc11c <code>Var<\/code> \ub294 \uc790\ub8cc\uc810 i = 1 ... n \uc5d0 \uac78\uccd0 \uc7b0 \ud45c\ubcf8\ubd84\uc0b0\uc744 \ub73b\ud55c\ub2e4.<\/p>\n<p dir=\"auto\"><math-renderer class=\"js-display-math\" style=\"display: block\" data-run-id=\"c2bed16471596b27236234f1d8307413\">$$\\mathrm{Var}(z) = \\frac{1}{n-1}\\sum_{i=1}^{n}\\left(z_i - \\bar{z}\\right)^2 \\hspace{19em} (1)$$<\/math-renderer><\/p>\n<div class=\"markdown-heading\" dir=\"auto\"><h3 class=\"heading-element\" dir=\"auto\">3.3. Choice of Residual Variance<\/h3><a id=\"user-content-33-choice-of-residual-variance\" class=\"anchor\" aria-label=\"Permalink: 3.3. Choice of Residual Variance\" href=\"#33-choice-of-residual-variance\"><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\"><code>Var_res<\/code> \ub97c \uc815\uc758\ud558\ub294 \ubc29\ubc95\uc740 \ub458\uc774\uace0, \uc5b4\ub290 \ucabd\uc744 \uace0\ub974\ub294\uc9c0\uac00 R\u00b2 \uc758 \ub73b\uc744 \ubc14\uafbc\ub2e4.<\/p>\n<p dir=\"auto\"><strong>Table 2. Two choices of residual variance<\/strong><\/p>\n<markdown-accessiblity-table><table>\n<thead>\n<tr>\n<th>Variant<\/th>\n<th>Definition<\/th>\n<th>Meaning<\/th>\n<th>Note<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>Empirical<\/td>\n<td><code>Var(y_i \u2212 y_hat_i^(s))<\/code><\/td>\n<td>\uc2e4\uc81c\ub85c \ub0a8\uc740 \uc794\ucc28\uc758 \ubd84\uc0b0<\/td>\n<td>\uad00\uce21\uac12 y \uac00 \ud544\uc694\ud558\uace0 \uc5b4\ub290 model \uacc4\uc5f4\uc5d0\uc11c\ub098 \uc4f8 \uc218 \uc788\uc74c<\/td>\n<\/tr>\n<tr>\n<td>Model-based<\/td>\n<td><code>(sigma^(s))^2<\/code><\/td>\n<td>Model \uc774 \uc2a4\uc2a4\ub85c \uc8fc\uc7a5\ud558\ub294 \uc7a1\uc74c \ubd84\uc0b0<\/td>\n<td>\uc815\uaddc likelihood \uc640 \ud568\uaed8 \uc4f0\uba70 y \uc5c6\uc774 \uacc4\uc0b0\ub428<\/td>\n<\/tr>\n<\/tbody>\n<\/table><\/markdown-accessiblity-table>\n<p dir=\"auto\">Model \uc774 \uc798 \ub9de\uc73c\uba74 \ub450 \uac12\uc740 \uc77c\uce58\ud558\uace0, \ub458 \uc0ac\uc774\uc758 \uac04\uaca9 \uc790\uccb4\uac00 \uc9c4\ub2e8\uc774 \ub41c\ub2e4. Model-based \uac12\uc774 \ub208\uc5d0 \ub744\uac8c\n\uc791\ub2e4\uba74 model \uc774 \uc790\uae30 \uc7a1\uc74c\uc744 \uacfc\uc18c\ud3c9\uac00\ud55c\ub2e4\ub294 \ub73b\uc774\uace0, \uadf8\ub7ec\uba74 model-based R\u00b2 \uac00 empirical \ucabd\ubcf4\ub2e4 \ub192\uac8c\n\uc77d\ud78c\ub2e4. \ud55c \ubb38\uc11c \uc548\uc5d0\uc11c \ub450 \ubcc0\ud615\uc744 \uc11e\uc9c0 \uc54a\uc544\uc57c \ud558\uace0, \uc5b4\ub290 \ucabd\uc744 \uace8\ub790\ub294\uc9c0 \ubc1d\ud600\uc57c \ud55c\ub2e4.<\/p>\n<div class=\"markdown-heading\" dir=\"auto\"><h2 class=\"heading-element\" dir=\"auto\">4. Computation<\/h2><a id=\"user-content-4-computation\" class=\"anchor\" aria-label=\"Permalink: 4. Computation\" href=\"#4-computation\"><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. Procedure<\/h3><a id=\"user-content-41-procedure\" class=\"anchor\" aria-label=\"Permalink: 4.1. Procedure\" href=\"#41-procedure\"><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=\"1. Draw S posterior samples (MCMC, ensemble members, or dropout passes)\n2. For each sample s:\n     Var_fit  = variance of the predicted values over data points\n     Var_res  = variance of the residuals, or the model noise variance\n     R2^(s)   = Var_fit \/ (Var_fit + Var_res)\n3. Collect {R2^(1) ... R2^(S)} as the posterior distribution of R2\n     median   -&gt; point estimate\n     quantiles-&gt; credible interval\"><pre lang=\"text\" class=\"notranslate\"><code>1. Draw S posterior samples (MCMC, ensemble members, or dropout passes)\n2. For each sample s:\n     Var_fit  = variance of the predicted values over data points\n     Var_res  = variance of the residuals, or the model noise variance\n     R2^(s)   = Var_fit \/ (Var_fit + Var_res)\n3. Collect {R2^(1) ... R2^(S)} as the posterior distribution of R2\n     median   -&gt; point estimate\n     quantiles-&gt; credible interval\n<\/code><\/pre><\/div>\n<p dir=\"auto\">\uc785\ub825\uc740 \ud589\uc774 posterior draw \uc774\uace0 \uc5f4\uc774 \uc790\ub8cc\uc810\uc778 <code>(S, n)<\/code> \ubaa8\uc591\uc758 \ud589\ub82c \ud558\ub098\uc774\ub2e4. \ubd84\uc0b0\uc740 \uc5f4 \ubc29\ud5a5, \uace7\n\uc790\ub8cc\uc810\uc5d0 \uac78\uccd0 \uacc4\uc0b0\ud558\uba70 draw \uc5d0 \uac78\uccd0 \uacc4\uc0b0\ud558\uc9c0 \uc54a\ub294\ub2e4. \ub2e4\ub978 \ucd95\uc744 \uc7a1\uc73c\uba74 \ud55c \uc810\uc5d0 \ub300\ud55c \uc608\uce21\uc774 draw \ub9c8\ub2e4\n\uc5bc\ub9c8\ub098 \uc6c0\uc9c1\uc774\ub294\uc9c0\ub97c \uc7ac\uac8c \ub418\ub294\ub370, \uadf8\uac83\uc740 \uc804\ud600 \ub2e4\ub978 \uc591\uc774\uba70 R\u00b2 \uac00 \uc544\ub2c8\ub2e4.<\/p>\n<div class=\"markdown-heading\" dir=\"auto\"><h3 class=\"heading-element\" dir=\"auto\">4.2. Implementation<\/h3><a id=\"user-content-42-implementation\" class=\"anchor\" aria-label=\"Permalink: 4.2. Implementation\" href=\"#42-implementation\"><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=\"# Python\nimport numpy as np\n\n\ndef bayesian_r2_empirical(y_pred_draws: np.ndarray = None, y_true: np.ndarray = None) -&gt; np.ndarray:\n    &quot;&quot;&quot;Bayesian R2 using the variance of the residuals actually left over.\n\n    Args:\n        y_pred_draws: posterior draws of the predictive mean, shape (S, n).\n        y_true: observations, shape (n,).\n\n    Returns:\n        R2 draws of shape (S,), every element inside [0, 1].\n    &quot;&quot;&quot;\n    var_fit = y_pred_draws.var(axis=1, ddof=1)           # variance over data points\n    var_res = (y_true[None, :] - y_pred_draws).var(axis=1, ddof=1)\n    return var_fit \/ (var_fit + var_res)\n\n\ndef bayesian_r2_model_based(y_pred_draws: np.ndarray = None, sigma_draws: np.ndarray = None) -&gt; np.ndarray:\n    &quot;&quot;&quot;Bayesian R2 using the noise variance the model claims for itself.&quot;&quot;&quot;\n    var_fit = y_pred_draws.var(axis=1, ddof=1)\n    return var_fit \/ (var_fit + sigma_draws ** 2)\n\n\n# posterior_mean_draws: shape (S, n), y_observed: shape (n,)\nr2_draws = bayesian_r2_empirical(y_pred_draws=posterior_mean_draws, y_true=y_observed)\npoint = np.median(r2_draws)\nlower, upper = np.quantile(r2_draws, [0.05, 0.95])       # 90% credible interval\"><pre><span class=\"pl-c\"># Python<\/span>\n<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\">bayesian_r2_empirical<\/span>(<span class=\"pl-s1\">y_pred_draws<\/span>: <span class=\"pl-s1\">np<\/span>.<span class=\"pl-c1\">ndarray<\/span> <span class=\"pl-c1\">=<\/span> <span class=\"pl-c1\">None<\/span>, <span class=\"pl-s1\">y_true<\/span>: <span class=\"pl-s1\">np<\/span>.<span class=\"pl-c1\">ndarray<\/span> <span class=\"pl-c1\">=<\/span> <span class=\"pl-c1\">None<\/span>) <span class=\"pl-c1\">-&gt;<\/span> <span class=\"pl-s1\">np<\/span>.<span class=\"pl-c1\">ndarray<\/span>:\n    <span class=\"pl-s\">\"\"\"Bayesian R2 using the variance of the residuals actually left over.<\/span>\n<span class=\"pl-s\"><\/span>\n<span class=\"pl-s\">    Args:<\/span>\n<span class=\"pl-s\">        y_pred_draws: posterior draws of the predictive mean, shape (S, n).<\/span>\n<span class=\"pl-s\">        y_true: observations, shape (n,).<\/span>\n<span class=\"pl-s\"><\/span>\n<span class=\"pl-s\">    Returns:<\/span>\n<span class=\"pl-s\">        R2 draws of shape (S,), every element inside &#91;0, 1&#93;.<\/span>\n<span class=\"pl-s\">    \"\"\"<\/span>\n    <span class=\"pl-s1\">var_fit<\/span> <span class=\"pl-c1\">=<\/span> <span class=\"pl-s1\">y_pred_draws<\/span>.<span class=\"pl-c1\">var<\/span>(<span class=\"pl-s1\">axis<\/span><span class=\"pl-c1\">=<\/span><span class=\"pl-c1\">1<\/span>, <span class=\"pl-s1\">ddof<\/span><span class=\"pl-c1\">=<\/span><span class=\"pl-c1\">1<\/span>)           <span class=\"pl-c\"># variance over data points<\/span>\n    <span class=\"pl-s1\">var_res<\/span> <span class=\"pl-c1\">=<\/span> (<span class=\"pl-s1\">y_true<\/span>&#91;<span class=\"pl-c1\">None<\/span>, :&#93; <span class=\"pl-c1\">-<\/span> <span class=\"pl-s1\">y_pred_draws<\/span>).<span class=\"pl-c1\">var<\/span>(<span class=\"pl-s1\">axis<\/span><span class=\"pl-c1\">=<\/span><span class=\"pl-c1\">1<\/span>, <span class=\"pl-s1\">ddof<\/span><span class=\"pl-c1\">=<\/span><span class=\"pl-c1\">1<\/span>)\n    <span class=\"pl-k\">return<\/span> <span class=\"pl-s1\">var_fit<\/span> <span class=\"pl-c1\">\/<\/span> (<span class=\"pl-s1\">var_fit<\/span> <span class=\"pl-c1\">+<\/span> <span class=\"pl-s1\">var_res<\/span>)\n\n\n<span class=\"pl-k\">def<\/span> <span class=\"pl-en\">bayesian_r2_model_based<\/span>(<span class=\"pl-s1\">y_pred_draws<\/span>: <span class=\"pl-s1\">np<\/span>.<span class=\"pl-c1\">ndarray<\/span> <span class=\"pl-c1\">=<\/span> <span class=\"pl-c1\">None<\/span>, <span class=\"pl-s1\">sigma_draws<\/span>: <span class=\"pl-s1\">np<\/span>.<span class=\"pl-c1\">ndarray<\/span> <span class=\"pl-c1\">=<\/span> <span class=\"pl-c1\">None<\/span>) <span class=\"pl-c1\">-&gt;<\/span> <span class=\"pl-s1\">np<\/span>.<span class=\"pl-c1\">ndarray<\/span>:\n    <span class=\"pl-s\">\"\"\"Bayesian R2 using the noise variance the model claims for itself.\"\"\"<\/span>\n    <span class=\"pl-s1\">var_fit<\/span> <span class=\"pl-c1\">=<\/span> <span class=\"pl-s1\">y_pred_draws<\/span>.<span class=\"pl-c1\">var<\/span>(<span class=\"pl-s1\">axis<\/span><span class=\"pl-c1\">=<\/span><span class=\"pl-c1\">1<\/span>, <span class=\"pl-s1\">ddof<\/span><span class=\"pl-c1\">=<\/span><span class=\"pl-c1\">1<\/span>)\n    <span class=\"pl-k\">return<\/span> <span class=\"pl-s1\">var_fit<\/span> <span class=\"pl-c1\">\/<\/span> (<span class=\"pl-s1\">var_fit<\/span> <span class=\"pl-c1\">+<\/span> <span class=\"pl-s1\">sigma_draws<\/span> <span class=\"pl-c1\">**<\/span> <span class=\"pl-c1\">2<\/span>)\n\n\n<span class=\"pl-c\"># posterior_mean_draws: shape (S, n), y_observed: shape (n,)<\/span>\n<span class=\"pl-s1\">r2_draws<\/span> <span class=\"pl-c1\">=<\/span> <span class=\"pl-en\">bayesian_r2_empirical<\/span>(<span class=\"pl-s1\">y_pred_draws<\/span><span class=\"pl-c1\">=<\/span><span class=\"pl-s1\">posterior_mean_draws<\/span>, <span class=\"pl-s1\">y_true<\/span><span class=\"pl-c1\">=<\/span><span class=\"pl-s1\">y_observed<\/span>)\n<span class=\"pl-s1\">point<\/span> <span class=\"pl-c1\">=<\/span> <span class=\"pl-s1\">np<\/span>.<span class=\"pl-c1\">median<\/span>(<span class=\"pl-s1\">r2_draws<\/span>)\n<span class=\"pl-s1\">lower<\/span>, <span class=\"pl-s1\">upper<\/span> <span class=\"pl-c1\">=<\/span> <span class=\"pl-s1\">np<\/span>.<span class=\"pl-c1\">quantile<\/span>(<span class=\"pl-s1\">r2_draws<\/span>, &#91;<span class=\"pl-c1\">0.05<\/span>, <span class=\"pl-c1\">0.95<\/span>&#93;)       <span class=\"pl-c\"># 90% credible interval<\/span><\/pre><\/div>\n<p dir=\"auto\">\uc0b0\uc220\uc740 \ubd84\uc0b0 \ub458\uacfc \ub098\ub217\uc148 \ud558\ub098\ubfd0\uc774\uace0, \uc774 \ubc29\ubc95\uc758 \ube44\uc6a9\uc740 \uc804\uc801\uc73c\ub85c posterior draw \ub97c \uc5bb\ub294 \ub370 \uc788\ub2e4. 3.3 \uc758\n\ub450 \ubcc0\ud615\uc740 switch \ub97c \ub454 \ud568\uc218 \ud558\ub098\uac00 \uc544\ub2c8\ub77c \ubcc4\uac1c\uc758 \ud568\uc218 \ub458\uc774\ubbc0\ub85c, \ubd80\ub974\ub294 \ucabd\uc774 \ud55c \ubcc0\ud615\uc758 \uc785\ub825\uc744 \uc870\uc6a9\ud788\n\ub123\uace0 \ub2e4\ub978 \ubcc0\ud615\uc758 \uacb0\uacfc\ub97c \ubc1b\ub294 \uc77c\uc774 \uc0dd\uae30\uc9c0 \uc54a\ub294\ub2e4.<\/p>\n<div class=\"markdown-heading\" dir=\"auto\"><h2 class=\"heading-element\" dir=\"auto\">5. Interpretation<\/h2><a id=\"user-content-5-interpretation\" class=\"anchor\" aria-label=\"Permalink: 5. Interpretation\" href=\"#5-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\">5.1. Point Estimate and Credible Interval<\/h3><a id=\"user-content-51-point-estimate-and-credible-interval\" class=\"anchor\" aria-label=\"Permalink: 5.1. Point Estimate and Credible Interval\" href=\"#51-point-estimate-and-credible-interval\"><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\">R\u00b2 \uc758 posterior \ubd84\ud3ec\ub294 \ub300\uce6d\uc774 \uc544\ub2c8\ub2e4. R\u00b2 \uac00 1 \uc5d0 \uac00\uae4c\uc6b8\uc218\ub85d \uc704\ucabd\uc774 1 \uc774\ub77c\ub294 \ucc9c\uc7a5\uc5d0 \ub9c9\ud788\uace0, \uadf8\ub9cc\ud07c\n\uc67c\ucabd\uc5d0 \uae34 \uaf2c\ub9ac\uac00 \ub0a8\ub294\ub2e4. \uadf8\ub7f0 \ubd84\ud3ec\uc5d0\uc11c\ub294 \ud3c9\uade0\uc774 \uaf2c\ub9ac \ucabd\uc73c\ub85c \ub04c\ub824\uac00\ubbc0\ub85c \uc911\uc559\uac12\uc744 \uc810\ucd94\uc815\uac12\uc73c\ub85c \uc0bc\uace0\n\ubd84\uc704\uc218\ub85c \uad6c\uac04\uc744 \uc815\ud55c\ub2e4.<\/p>\n<p dir=\"auto\">\uadf8 \uad6c\uac04\uc758 \ud3ed\uc774 \uc124\uba85\ub825\uc5d0 \ub300\ud55c \ud655\uc2e0\uc774\ub2e4. <code>0.87 &#91;0.85, 0.89&#93;<\/code> \uc640 <code>0.87 &#91;0.61, 0.95&#93;<\/code> \ub294 \uc810\ucd94\uc815\uac12\uc774\n\uac19\uc9c0\ub9cc \uc804\ud600 \ub2e4\ub978 \uacb0\uacfc\uc774\uba70, \ub4a4\uc758 \uac83\uc740 R\u00b2 \ub97c \uadfc\uac70\ub85c model \uc744 \ubc1b\uc544\ub4e4\uc774\uae30\uc5d0\ub294 \uc790\ub8cc\uac00 \ub108\ubb34 \uc587\ub2e4\ub294 \ub73b\uc774\ub2e4.<\/p>\n<p dir=\"auto\">\uc774 \uad6c\uac04\uc740 confidence interval \uc774 \uc544\ub2c8\ub77c credible interval \uc774\ub2e4. \"R\u00b2 \uac00 90% \uc758 \ud655\ub960\ub85c \uc774 \uad6c\uac04\uc5d0\n\uc788\ub2e4\" \uace0 \uadf8\ub300\ub85c \uc77d\ub294 \uac83\uc774 credible interval \uc744 \uad6c\ubcc4\uc9d3\ub294 \uc131\uc9c8\uc774\uba70, \uadf8 \uc815\uc758\ub294\n<a href=\"#appendix-a-terminology\">Appendix A. Terminology<\/a> \uc5d0 \uc788\ub2e4.<\/p>\n<div class=\"markdown-heading\" dir=\"auto\"><h3 class=\"heading-element\" dir=\"auto\">5.2. Uncertainty Decomposition<\/h3><a id=\"user-content-52-uncertainty-decomposition\" class=\"anchor\" aria-label=\"Permalink: 5.2. Uncertainty Decomposition\" href=\"#52-uncertainty-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\">\uacb0\uacfc \ud558\ub098\uc5d0\ub294 \uac08\ub77c \ubcfc \uc218 \uc788\ub294 \ub450 \uc885\ub958\uc758 \ubd88\ud655\uc2e4\uc131\uc774 \uc2e4\ub9b0\ub2e4.<\/p>\n<ul dir=\"auto\">\n<li>R\u00b2 \ubd84\ud3ec\uc758 \ud3ed \u2014 parameter \ub97c \uc544\uc9c1 \uc881\ud788\uc9c0 \ubabb\ud55c \ub370\uc11c \uc624\ub294 \ubd88\ud655\uc2e4\uc131\uc774\uba70, \uc790\ub8cc\uac00 \ub298\uba74 \uc904\uc5b4\ub4e0\ub2e4.<\/li>\n<li><code>Var_res<\/code> \uc758 \ud06c\uae30 \u2014 \uc790\ub8cc\uc5d0 \ubcf8\ub798 \uc788\ub294 \uc7a1\uc74c\uc774\uba70, \uc790\ub8cc\uac00 \ub298\uc5b4\ub3c4 \uc904\uc9c0 \uc54a\ub294\ub2e4.<\/li>\n<\/ul>\n<p dir=\"auto\">\ub530\ub77c\uc11c \uad6c\uac04\uc774 \ub113\ub2e4\uba74 \ud45c\ubcf8\uc744 \ub354 \ubaa8\uc544\uc57c \ud558\uace0, \ub0ae\uc740 R\u00b2 \ub458\ub808\uc758 \uad6c\uac04\uc774 \uc881\ub2e4\uba74 \ub2e4\ub978 \uc785\ub825 \ubcc0\uc218\ub098 \ub2e4\ub978\nmodel \uad6c\uc870\uac00 \ud544\uc694\ud558\ub2e4. \ud45c\uc900 R\u00b2 \ub294 \uc774 \ub458\uc744 \uac08\ub77c\ub0b4\uc9c0 \ubabb\ud558\uace0 \ub450 \uc0c1\ud669 \ubaa8\ub450\uc5d0\uc11c \uac19\uc740 \uc218\ub97c \ub3cc\ub824\uc900\ub2e4.<\/p>\n<div class=\"markdown-heading\" dir=\"auto\"><h2 class=\"heading-element\" dir=\"auto\">6. Tools<\/h2><a id=\"user-content-6-tools\" class=\"anchor\" aria-label=\"Permalink: 6. Tools\" href=\"#6-tools\"><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\"><strong>Table 3. Available implementations<\/strong><\/p>\n<markdown-accessiblity-table><table>\n<thead>\n<tr>\n<th>Environment<\/th>\n<th>Interface<\/th>\n<th>Note<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>R<\/td>\n<td><code>bayes_R2(fit)<\/code> \u2014 rstanarm, brms<\/td>\n<td>\ub17c\ubb38 \uc800\uc790\ub4e4\uc774 \uc720\uc9c0\ud558\uba70 \uae30\uc900 \uad6c\ud604\uc73c\ub85c \uc0bc\uc74c<\/td>\n<\/tr>\n<tr>\n<td>R<\/td>\n<td><code>loo_R2(fit)<\/code> \u2014 rstanarm, brms<\/td>\n<td>Out-of-sample \ubcf4\uc815\uc744 \uc9c0\ub2cc \ubcc0\ud615<\/td>\n<\/tr>\n<tr>\n<td>Python<\/td>\n<td><code>az.r2_score()<\/code> \u2014 ArviZ<\/td>\n<td>\uc608\uce21 \ud45c\ubcf8\uacfc \uad00\uce21\uac12\uc744 \ubc1b\uc544 \uc694\uc57d\uc744 \ub3cc\ub824\uc90c<\/td>\n<\/tr>\n<tr>\n<td>Any<\/td>\n<td>Custom implementation<\/td>\n<td>\ubd84\uc0b0 \ub458\uacfc \ub098\ub217\uc148\uc774\ubbc0\ub85c \uc62e\uae30\ub294 \ub370 \ud488\uc774 \uac70\uc758 \ub4e4\uc9c0 \uc54a\uc74c<\/td>\n<\/tr>\n<\/tbody>\n<\/table><\/markdown-accessiblity-table>\n<p dir=\"auto\">\uc9c1\uc811 \uad6c\ud604\ud55c \uac83\uc740 \uba3c\uc800 \uac19\uc740 \uc790\ub8cc\uc5d0\uc11c \uae30\uc900 \uad6c\ud604\uacfc \ub9de\ucd94\uc5b4 \ubcf4\uc544\uc57c \ud55c\ub2e4. \uc5b4\uae0b\ub09c\ub2e4\uba74 \ub300\uac1c 3.3 \uc5d0\uc11c \uace0\ub978\n\ubcc0\ud615\uc774\ub098 4.1 \uc774 \uae30\uc220\ud55c \ucd95 \ubc29\ud5a5\uc73c\ub85c \uac70\uc2ac\ub7ec \uc62c\ub77c\uac04\ub2e4.<\/p>\n<div class=\"markdown-heading\" dir=\"auto\"><h2 class=\"heading-element\" dir=\"auto\">7. Prerequisites<\/h2><a id=\"user-content-7-prerequisites\" class=\"anchor\" aria-label=\"Permalink: 7. Prerequisites\" href=\"#7-prerequisites\"><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\">\ubc1c\ubaa9\uc744 \uc7a1\ub294 \uc81c\uc57d\uc740 \uc815\uc758\uac00 \uc544\ub2c8\ub77c \uc801\uc6a9 \ubc94\uc704\uc5d0 \uc788\ub2e4. Bayesian R\u00b2 \uc5d0\ub294 \uc9c4\uc9dc posterior draw \uac00 \ud544\uc694\ud558\ub2e4.<\/p>\n<div class=\"markdown-heading\" dir=\"auto\"><h3 class=\"heading-element\" dir=\"auto\">7.1. Applicable Models<\/h3><a id=\"user-content-71-applicable-models\" class=\"anchor\" aria-label=\"Permalink: 7.1. Applicable Models\" href=\"#71-applicable-models\"><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\"><strong>Table 4. Model applicability<\/strong><\/p>\n<markdown-accessiblity-table><table>\n<thead>\n<tr>\n<th>Model type<\/th>\n<th>Applicable<\/th>\n<th>Reason<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>Bayesian models such as Stan, PyMC, brms<\/td>\n<td>Yes<\/td>\n<td>MCMC \uac00 posterior draw \ub97c \ubc14\ub85c \uacf5\uae09\ud568<\/td>\n<\/tr>\n<tr>\n<td>Deep ensemble<\/td>\n<td>Yes<\/td>\n<td>\uad6c\uc131\uc6d0 \ud558\ub098\uac00 draw \ud558\ub098\uc758 \uc5ed\ud560\uc744 \ud568<\/td>\n<\/tr>\n<tr>\n<td>MC dropout<\/td>\n<td>Yes<\/td>\n<td>Forward pass \ub97c \ub418\ud480\uc774\ud574 draw \ub97c \ub9cc\ub4e6<\/td>\n<\/tr>\n<tr>\n<td>Bootstrap ensemble<\/td>\n<td>Yes<\/td>\n<td>\uc7ac\ud45c\ubcf8\ub9c8\ub2e4 \ub2e4\uc2dc \uc801\ud569\ud558\uc5ec draw \ub97c \ub9cc\ub4e6<\/td>\n<\/tr>\n<tr>\n<td>Single Gaussian head emitting one mu and one sigma<\/td>\n<td>No<\/td>\n<td>Draw \uac00 \uc5c6\uc73c\uba74 \ubd84\ud3ec\ub97c \ub9cc\ub4e4 \uc218 \uc5c6\uc74c<\/td>\n<\/tr>\n<tr>\n<td>Point-estimate models such as a plain GBM or a single network<\/td>\n<td>No<\/td>\n<td>\uc608\uce21\uac12\uc774 \ud55c \ubc8c\ubfd0\uc784<\/td>\n<\/tr>\n<\/tbody>\n<\/table><\/markdown-accessiblity-table>\n<p dir=\"auto\">Deep ensemble \uacfc MC dropout \uc740 \uc5c4\ubc00\ud55c \ub73b\uc758 posterior draw \ub97c \uc8fc\uc9c0\ub294 \uc54a\uc9c0\ub9cc \uc608\uce21 \ubd84\ud3ec\uc5d0\uc11c \ubf51\uc740 \ud45c\ubcf8\n\uad6c\uc2e4\uc744 \ud558\ubbc0\ub85c \uac19\uc740 \uacc4\uc0b0\uc774 \uc131\ub9bd\ud55c\ub2e4. \ub2e4\ub9cc \uad6c\uc131\uc6d0\uc774 \ub2e4\uc12f \uc815\ub3c4\ub85c \uc801\uc73c\uba74 \ubd84\uc704\uc218\uac00 \ubd88\uc548\uc815\ud558\ubbc0\ub85c \uad6c\uac04\uc744\n\uc881\uac8c \uc77d\uc5b4\uc11c\ub294 \uc548 \ub41c\ub2e4.<\/p>\n<div class=\"markdown-heading\" dir=\"auto\"><h3 class=\"heading-element\" dir=\"auto\">7.2. Inapplicable Models<\/h3><a id=\"user-content-72-inapplicable-models\" class=\"anchor\" aria-label=\"Permalink: 7.2. Inapplicable Models\" href=\"#72-inapplicable-models\"><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\"><code>mu<\/code> \ud558\ub098\uc640 <code>sigma<\/code> \ud558\ub098\ub97c \ub0b4\ub193\ub294 model \uc740 \uc608\uce21 \ubd84\ud3ec\ub294 \uac00\uc84c\uc9c0\ub9cc posterior draw \uac00 \uc5c6\ub2e4. \uadf8 <code>sigma<\/code>\n\ub294 aleatoric uncertainty \ub97c \ub098\ud0c0\ub0bc \ubfd0\uc774\uace0, R\u00b2 \ub97c \uc6c0\uc9c1\uc774\uac8c \ud560 parameter \ubd88\ud655\uc2e4\uc131\uc774 \uc5c6\uc73c\ubbc0\ub85c R\u00b2 \ub294\n\uc5b4\ub5bb\uac8c \ud574\ub3c4 \ud55c \uac12\uc5d0 \uace0\uc815\ub41c\ub2e4. \uadf8\ub7f0 \uacbd\uc6b0\uc5d0\ub294 draw \ub97c \uc694\uad6c\ud558\uc9c0 \uc54a\ub294 \uc9c0\ud45c, \uace7 8. Comparison \uc5d0\uc11c \ub2e4\ub8e8\ub294\nCRPS Skill Score \uac19\uc740 \uac83\uc774 \ud544\uc694\ud558\ub2e4.<\/p>\n<div class=\"markdown-heading\" dir=\"auto\"><h2 class=\"heading-element\" dir=\"auto\">8. Comparison<\/h2><a id=\"user-content-8-comparison\" class=\"anchor\" aria-label=\"Permalink: 8. Comparison\" href=\"#8-comparison\"><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\"><strong>Table 5. Bayesian R\u00b2 vs CRPS Skill Score<\/strong><\/p>\n<markdown-accessiblity-table><table>\n<thead>\n<tr>\n<th>Aspect<\/th>\n<th>Bayesian R\u00b2<\/th>\n<th>CRPS Skill Score<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>Output<\/td>\n<td>\uc810\ucd94\uc815\uac12\uacfc \uad6c\uac04<\/td>\n<td>\uc810\uc218 \ud558\ub098<\/td>\n<\/tr>\n<tr>\n<td>Interval<\/td>\n<td>\uc788\uc74c<\/td>\n<td>\uc5c6\uc74c<\/td>\n<\/tr>\n<tr>\n<td>Sample requirement<\/td>\n<td>Posterior draw S \uac1c<\/td>\n<td>\uc608\uce21 \ubd84\ud3ec\ub9cc<\/td>\n<\/tr>\n<tr>\n<td>Question answered<\/td>\n<td>\uc124\uba85\ub825\uc774 \uc5bc\ub9c8\ub098 \ud06c\uace0 \uc5bc\ub9c8\ub098 \ud655\uc2e4\ud55c\uac00<\/td>\n<td>\uc608\uce21 \ubd84\ud3ec\uac00 \uc5bc\ub9c8\ub098 \uc798 \ub9de\uc558\ub294\uac00<\/td>\n<\/tr>\n<tr>\n<td>Baseline<\/td>\n<td>\uc790\ub8cc\uc758 \ucd1d\ubcc0\ub3d9<\/td>\n<td>\uba85\uc2dc\uc801\uc73c\ub85c \uc9c0\uc815\ud55c \uae30\uc900 model<\/td>\n<\/tr>\n<\/tbody>\n<\/table><\/markdown-accessiblity-table>\n<p dir=\"auto\">\ub450 \uc9c0\ud45c\ub294 \uacbd\uc7c1 \uad00\uacc4\uac00 \uc544\ub2c8\ub77c \uc801\uc6a9 \ubc94\uc704\uac00 \ub2e4\ub974\ub2e4. Posterior draw \ub97c \uc5bb\uc744 \uc218 \uc788\ub294 \uacf3\uc5d0\uc11c\ub294 \uad6c\uac04\uae4c\uc9c0\n\uc8fc\ub294 Bayesian R\u00b2 \uac00 \ub354 \ub9ce\uc740 \uc815\ubcf4\ub97c \uc2e3\uace0, \uc5bb\uc744 \uc218 \uc5c6\ub294 \uacf3\uc5d0\ub294 CRPS Skill Score \uac00 \ub0a8\ub294\ub2e4.<\/p>\n<div class=\"markdown-heading\" dir=\"auto\"><h2 class=\"heading-element\" dir=\"auto\">9. Pitfalls<\/h2><a id=\"user-content-9-pitfalls\" class=\"anchor\" aria-label=\"Permalink: 9. Pitfalls\" href=\"#9-pitfalls\"><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\"><strong>Table 6. Common mistakes<\/strong><\/p>\n<markdown-accessiblity-table><table>\n<thead>\n<tr>\n<th>Mistake<\/th>\n<th>Consequence<\/th>\n<th>Fix<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>Feeding posterior predictive samples into <code>Var_fit<\/code><\/td>\n<td>\uc7a1\uc74c\uc774 \ubd84\uc790\ub85c \ub4e4\uc5b4\uac00 R\u00b2 \ub97c \ubd80\ud480\ub9bc<\/td>\n<td>\uc608\uce21 \ud3c9\uade0\uc758 posterior draw \ub97c \uc500<\/td>\n<\/tr>\n<tr>\n<td>Taking the variance along the draw axis<\/td>\n<td>\uacb0\uacfc\uac00 R\u00b2 \uac00 \uc544\ub2cc \ub2e4\ub978 \uc591\uc774 \ub428<\/td>\n<td>\uc790\ub8cc\uc810 \ucd95\uc73c\ub85c \uacc4\uc0b0\ud568<\/td>\n<\/tr>\n<tr>\n<td>Using the mean as the point estimate<\/td>\n<td>\uc65c\ub3c4\uac00 \uac12\uc744 \uc544\ub798\ub85c \ub04c\uc5b4\ub0b4\ub9bc<\/td>\n<td>\uc911\uc559\uac12\uc744 \uc500<\/td>\n<\/tr>\n<tr>\n<td>Reporting a training-data value as generalization performance<\/td>\n<td>\uac12\uc774 \ub099\uad00\uc801\uc73c\ub85c \uce58\uc6b0\uce68<\/td>\n<td>Out-of-sample \uc790\ub8cc\ub098 loo \ubcc0\ud615\uc744 \uc500<\/td>\n<\/tr>\n<tr>\n<td>Reporting a narrow interval computed from few draws<\/td>\n<td>\uad6c\uac04 \uc790\uccb4\uac00 \ubd88\uc548\uc815\ud568<\/td>\n<td>Draw \uc218\ub97c \ub298\ub9ac\uace0 \uc218\ub834\uc744 \uba3c\uc800 \ud655\uc778\ud568<\/td>\n<\/tr>\n<tr>\n<td>Mixing the two variants when comparing<\/td>\n<td>Model \uc0ac\uc774\uc758 \ube44\uad50\uac00 \ub73b\uc744 \uc783\uc74c<\/td>\n<td>\ud55c \ubcc0\ud615\uc73c\ub85c \uace0\uc815\ud558\uace0 \ubc1d\ud798<\/td>\n<\/tr>\n<\/tbody>\n<\/table><\/markdown-accessiblity-table>\n<p dir=\"auto\">\uccab \ud589\uc774 \uac00\uc7a5 \uc7a6\ub2e4. \ub300\ubd80\ubd84\uc758 \ub3c4\uad6c\ub294 \uc608\uce21 \ud3c9\uade0\uc758 posterior draw \uc640 \uadf8 \uc704\uc5d0 \uad00\uce21 \uc7a1\uc74c\uc744 \ub354\ud55c posterior\npredictive sample \uc744 \ud568\uaed8 \ub0b4\ub193\ub294\ub370, <code>Var_fit<\/code> \uc774 \ubc1b\uc544\uc57c \ud560 \uac83\uc740 \uc55e\uc758 \uac83\uc774\ub2e4. \ub4a4\uc758 \uac83\uc744 \ub123\uc73c\uba74 \uc124\uba85\ub418\uc9c0\n\uc54a\uc740 \ubcc0\ub3d9\uc774 \uc124\uba85\ub41c \ud56d\uc73c\ub85c \uc62e\uaca8 \uac00\ubbc0\ub85c R\u00b2 \uac00 \uc2e4\uc81c\ubcf4\ub2e4 \ub192\uac8c \uc77d\ud78c\ub2e4.<\/p>\n<div class=\"markdown-heading\" dir=\"auto\"><h2 class=\"heading-element\" dir=\"auto\">10. Summary<\/h2><a id=\"user-content-10-summary\" class=\"anchor\" aria-label=\"Permalink: 10. Summary\" href=\"#10-summary\"><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\">Bayesian R\u00b2 \ub294 posterior draw s \ub9c8\ub2e4 <code>Var_fit \/ (Var_fit + Var_res)<\/code> \ub97c \uacc4\uc0b0\ud558\uc5ec R\u00b2 \ub97c \ubd84\ud3ec\ub85c \uc5bb\ub294\ub2e4.\n\ubd84\ubaa8\uac00 \uc74c\uc774 \uc544\ub2cc \ub450 \ud56d\uc758 \ud569\uc774\ubbc0\ub85c \ud45c\uc900 R\u00b2 \uc758 \ubc1c\uc0b0 \ubb38\uc81c\uac00 \uad6c\uc870\uc801\uc73c\ub85c \uc0ac\ub77c\uc9c0\uace0, \uc810\ucd94\uc815\uac12\uacfc credible\ninterval \uc744 \ud568\uaed8 \uc900\ub2e4. \uadf8 \ub300\uac00\ub85c draw \ub97c \ubf51\uc744 \uc218 \uc788\ub294 Bayesian model \uacfc ensemble \uacc4\uc5f4 model \uc5d0\ub9cc\n\uc4f8 \uc218 \uc788\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] Gelman, A., Goodrich, B., Gabry, J., &amp; Vehtari, A. (2019). <a href=\"https:\/\/doi.org\/10.1080\/00031305.2018.1549100\" rel=\"nofollow\">R-squared for Bayesian Regression Models<\/a>. <em>The American Statistician<\/em>, 73(3), 307-309. Section 3.2 \uac00 \uc4f0\ub294 \uaf34, \uace7 \ubd84\ubaa8\ub97c \uc124\uba85\ub41c \ubd84\uc0b0\uacfc \uc794\ucc28 \ubd84\uc0b0\uc758 \ud569\uc73c\ub85c \ub450\uc5b4 \ubaa8\ub4e0 posterior draw \uc5d0\uc11c \uac12\uc774 [0, 1] \uc548\uc5d0 \uba38\ubb3c\uac8c \ud558\ub294 \ud615\ud0dc\ub97c \uc81c\uc548\ud55c\ub2e4.<\/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><strong>aleatoric uncertainty<\/strong>: \uc790\ub8cc \uc790\uccb4\uc758 \uc7a1\uc74c\uc5d0\uc11c \ube44\ub86f\ud55c \ubd88\ud655\uc2e4\uc131\uc774\uba70, \uc790\ub8cc\uac00 \ub298\uc5b4\ub3c4 \uc904\uc9c0 \uc54a\ub294\ub2e4.<\/li>\n<li><strong>conjugate posterior<\/strong>: Prior \uc640 \uac19\uc740 \ubd84\ud3ec\uc871\uc5d0 \uba38\ubb34\ub294 posterior \uc774\uba70, \ub2eb\ud78c \uaf34\uc774 \uc788\uc5b4 MCMC \uc5c6\uc774 \ubc14\ub85c \ud45c\ubcf8\uc744 \ubf51\uc744 \uc218 \uc788\ub2e4.<\/li>\n<li><strong>credible interval<\/strong>: Posterior \ubd84\ud3ec\uc758 \ubd84\uc704\uc218\ub85c \uc815\uc758\ud55c \uad6c\uac04\uc774\uba70, parameter \uac00 \uadf8 \uc548\uc5d0 \uc788\uc744 \ud655\ub960\ub85c \uadf8\ub300\ub85c \uc77d\ub294\ub2e4.<\/li>\n<li><strong>CRPS<\/strong>: Continuous Ranked Probability Score. \uc608\uce21 \ubd84\ud3ec \uc804\uccb4\ub97c \uad00\uce21\uac12 \ud558\ub098\uc5d0 \uacac\uc8fc\ub294 \uc810\uc218\uc774\uba70, \uc791\uc744\uc218\ub85d \uc88b\ub2e4.<\/li>\n<li><strong>CRPS Skill Score<\/strong>: CRPS \ub97c \uae30\uc900 model \uc758 CRPS \ub85c \uc815\uaddc\ud654\ud558\uc5ec <code>1 \u2212 CRPS_model \/ CRPS_baseline<\/code> \uc758 \uaf34\ub85c \ub9cc\ub4e0 \uac83\uc774\uba70, \ud074\uc218\ub85d \uc88b\ub2e4.<\/li>\n<li><strong>deep ensemble<\/strong>: \ucd08\uae30\uac12\uc774\ub098 \uc790\ub8cc \uc21c\uc11c\ub97c \ub2ec\ub9ac\ud558\uc5ec \ub530\ub85c \ud559\uc2b5\ud55c \uc5ec\ub7ec network \ub85c \ub9cc\ub4e0 \uc608\uce21 \ubd84\ud3ec.<\/li>\n<li><strong>GBM<\/strong>: Gradient Boosting Machine. \ucc28\ub840\ub85c \uc801\ud569\ud55c tree \uc758 \ud569\uc73c\ub85c \ub9cc\ub4e0 \uc810\ucd94\uc815 model.<\/li>\n<li><strong>LOO<\/strong>: Leave-One-Out cross-validation. \uad00\uce21\uac12\uc744 \ud558\ub098\uc529 \ube7c \uac00\uba70 out-of-sample \uc131\ub2a5\uc744 \ucd94\uc815\ud558\ub294 \uac83.<\/li>\n<li><strong>MC dropout<\/strong>: \ucd94\ub860 \uc2dc\uc810\uc5d0\ub3c4 dropout \uc744 \ucf1c \ub454 \ucc44 forward pass \ub97c \ub418\ud480\uc774\ud574 \uc608\uce21 \ud45c\ubcf8\uc744 \uc5bb\ub294 \uac83.<\/li>\n<li><strong>MCMC<\/strong>: Markov Chain Monte Carlo. Posterior \ubd84\ud3ec\uc5d0\uc11c \ud45c\ubcf8\uc744 \ubf51\ub294 \ud45c\uc900 algorithm \uacc4\uc5f4.<\/li>\n<li><strong>OLS<\/strong>: Ordinary Least Squares. \uc794\ucc28\uc81c\uacf1\ud569\uc744 \ucd5c\uc18c\ud654\ud558\ub294 \uc801\ud569.<\/li>\n<li><strong>posterior distribution<\/strong>: \uc790\ub8cc\ub97c \uad00\uce21\ud55c \ub4a4\uc758 parameter \ubd84\ud3ec.<\/li>\n<li><strong>posterior draw<\/strong>: Posterior \ubd84\ud3ec\uc5d0\uc11c \ubf51\uc740 \ud45c\ubcf8 \ud558\ub098.<\/li>\n<li><strong>posterior predictive sample<\/strong>: Posterior draw \uc704\uc5d0 \uad00\uce21 \uc7a1\uc74c\uc744 \ub354\ud574 \ub9cc\ub4e0, \uad00\uce21\uac12 \ucc99\ub3c4\uc758 \ud45c\ubcf8.<\/li>\n<li><strong>reference prior<\/strong>: \uc815\ubcf4\ub97c \ub418\ub3c4\ub85d \uc801\uac8c \uc2e3\ub3c4\ub85d \uace0\ub978 prior \uc774\uba70, posterior \uac00 prior \uac00 \uc544\ub2c8\ub77c \uc790\ub8cc\uc5d0 \uc774\ub04c\ub9ac\uac8c \ud55c\ub2e4.<\/li>\n<li><strong>shrinkage<\/strong>: Prior \ub098 \uacc4\uce35 \uad6c\uc870\uac00 \ucd94\uc815\uac12\uc744 \uacf5\ud1b5\uc758 \uc911\uc2ec \ucabd\uc73c\ub85c \ub04c\uc5b4\ub2f9\uae30\ub294 \ud798.<\/li>\n<\/ul>\n<div class=\"markdown-heading\" dir=\"auto\"><h2 class=\"heading-element\" dir=\"auto\">Appendix B. Worked Example<\/h2><a id=\"user-content-appendix-b-worked-example\" class=\"anchor\" aria-label=\"Permalink: Appendix B. Worked Example\" href=\"#appendix-b-worked-example\"><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\">\uc774 appendix \uc758 \ubaa8\ub4e0 \uc218\ub294 <code>bayesian_r2_example.py<\/code> \ub97c <code>python3 bayesian_r2_example.py --draws 4000<\/code>\n\uc73c\ub85c \uc2e4\ud589\ud558\uc5ec \uc5bb\uc740 \uac83\uc774\ub2e4. Seed \uac00 script \uc548\uc5d0 \uace0\uc815\ub418\uc5b4 \uc788\uc73c\ubbc0\ub85c \uac12\uc774 \uadf8\ub300\ub85c \uc7ac\ud604\ub41c\ub2e4.<\/p>\n<div class=\"markdown-heading\" dir=\"auto\"><h3 class=\"heading-element\" dir=\"auto\">B.1. Data and Reference Fit<\/h3><a id=\"user-content-b1-data-and-reference-fit\" class=\"anchor\" aria-label=\"Permalink: B.1. Data and Reference Fit\" href=\"#b1-data-and-reference-fit\"><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\">\uc790\ub8cc\ub294 n = 8 \uac1c\uc758 \uc810\uc774\ub2e4. OLS \uc801\ud569\uc740 \uc808\ud3b8 \u22120.018 \uacfc \uae30\uc6b8\uae30 2.051 \uc744 \uc8fc\uba70, \uc794\ucc28\ub294 model \uc774 \uc7ac\ud604\ud558\uc9c0\n\ubabb\ud55c \uac12\uc774\ub2e4.<\/p>\n<p dir=\"auto\"><strong>Table 7. Worked example data and OLS fit<\/strong><\/p>\n<markdown-accessiblity-table><table>\n<thead>\n<tr>\n<th>i<\/th>\n<th>x<\/th>\n<th>y<\/th>\n<th>y_hat (OLS)<\/th>\n<th>Residual<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>1<\/td>\n<td>1<\/td>\n<td>1.8<\/td>\n<td>2.033<\/td>\n<td>\u22120.233<\/td>\n<\/tr>\n<tr>\n<td>2<\/td>\n<td>2<\/td>\n<td>4.9<\/td>\n<td>4.085<\/td>\n<td>0.815<\/td>\n<\/tr>\n<tr>\n<td>3<\/td>\n<td>3<\/td>\n<td>5.2<\/td>\n<td>6.136<\/td>\n<td>\u22120.936<\/td>\n<\/tr>\n<tr>\n<td>4<\/td>\n<td>4<\/td>\n<td>8.9<\/td>\n<td>8.187<\/td>\n<td>0.713<\/td>\n<\/tr>\n<tr>\n<td>5<\/td>\n<td>5<\/td>\n<td>9.4<\/td>\n<td>10.238<\/td>\n<td>\u22120.838<\/td>\n<\/tr>\n<tr>\n<td>6<\/td>\n<td>6<\/td>\n<td>13.6<\/td>\n<td>12.289<\/td>\n<td>1.311<\/td>\n<\/tr>\n<tr>\n<td>7<\/td>\n<td>7<\/td>\n<td>12.8<\/td>\n<td>14.340<\/td>\n<td>\u22121.540<\/td>\n<\/tr>\n<tr>\n<td>8<\/td>\n<td>8<\/td>\n<td>17.1<\/td>\n<td>16.392<\/td>\n<td>0.708<\/td>\n<\/tr>\n<\/tbody>\n<\/table><\/markdown-accessiblity-table>\n<p dir=\"auto\">\uad00\uce21\uac12\uc758 \ud3c9\uade0\uc740 9.213 \uc774\uace0 \ud45c\ubcf8\ubd84\uc0b0\uc740 26.301 \uc774\uba70, \uc774 \uc801\ud569\uc758 \ud45c\uc900 R\u00b2 \ub294 0.9598 \uc774\ub2e4. \uadf8 \uc218 \ud558\ub098\uac00\n\uc774 appendix \uc758 \ub098\uba38\uc9c0\ub97c \uacac\uc8fc\ub294 \uae30\uc900\uc774\ub2e4.<\/p>\n<div class=\"markdown-heading\" dir=\"auto\"><h3 class=\"heading-element\" dir=\"auto\">B.2. Posterior Draws<\/h3><a id=\"user-content-b2-posterior-draws\" class=\"anchor\" aria-label=\"Permalink: B.2. Posterior Draws\" href=\"#b2-posterior-draws\"><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\">Posterior \ub294 reference prior <code>p(beta, sigma^2)<\/code> \uac00 <code>1 \/ sigma^2<\/code> \uc5d0 \ube44\ub840\ud558\ub294 \uc120\ud615 model \uc758\nconjugate posterior \uc774\uba70, \ub2eb\ud78c \uaf34\uc774 \uc788\uc5b4 MCMC \uc5c6\uc774 \uc815\ud655\ud788 \ud45c\ubcf8\uc744 \ubf51\uc744 \uc218 \uc788\ub2e4. Draw \ub294 4,000 \uac1c\ub97c\n\ubf51\ub294\ub2e4. Draw \ud558\ub098\uac00 \uace7 \uc644\uc804\ud55c model \uc774\ubbc0\ub85c \uac01\uc790 \uc790\uae30 R\u00b2 \ub97c \ub0b4\uba70, \ucc98\uc74c \ub2e4\uc12f \uac1c\ub97c \uadf8\ub300\ub85c \ubcf4\uc778\ub2e4.<\/p>\n<p dir=\"auto\"><strong>Table 8. First five posterior draws and their empirical-variant R\u00b2<\/strong><\/p>\n<markdown-accessiblity-table><table>\n<thead>\n<tr>\n<th>s<\/th>\n<th>a<\/th>\n<th>b<\/th>\n<th>sigma<\/th>\n<th>Var_fit<\/th>\n<th>Var_res<\/th>\n<th>Bayesian R\u00b2<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>1<\/td>\n<td>0.369<\/td>\n<td>1.903<\/td>\n<td>1.826<\/td>\n<td>21.740<\/td>\n<td>1.188<\/td>\n<td>0.9482<\/td>\n<\/tr>\n<tr>\n<td>2<\/td>\n<td>0.556<\/td>\n<td>1.952<\/td>\n<td>0.922<\/td>\n<td>22.857<\/td>\n<td>1.116<\/td>\n<td>0.9534<\/td>\n<\/tr>\n<tr>\n<td>3<\/td>\n<td>0.754<\/td>\n<td>1.757<\/td>\n<td>1.142<\/td>\n<td>18.524<\/td>\n<td>1.576<\/td>\n<td>0.9216<\/td>\n<\/tr>\n<tr>\n<td>4<\/td>\n<td>1.151<\/td>\n<td>1.866<\/td>\n<td>0.743<\/td>\n<td>20.900<\/td>\n<td>1.262<\/td>\n<td>0.9431<\/td>\n<\/tr>\n<tr>\n<td>5<\/td>\n<td>0.266<\/td>\n<td>2.007<\/td>\n<td>0.844<\/td>\n<td>24.164<\/td>\n<td>1.069<\/td>\n<td>0.9576<\/td>\n<\/tr>\n<\/tbody>\n<\/table><\/markdown-accessiblity-table>\n<p dir=\"auto\">Draw 1 \uc744 \ud558\ub098\ud558\ub098 \uc9da\uc5b4 \ubcf8\ub2e4. \uadf8 \uc608\uce21\uac12\uc740 <code>0.369 + 1.903 x<\/code> \uc774\uace0 \uc5ec\ub35f \uc810\uc5d0 \uac78\uce5c \ubd84\uc0b0\uc774 21.740 \uc774\uba70,\n\uc794\ucc28\uc758 \ubd84\uc0b0\uc740 1.188 \uc774\uace0, \ube44 <code>21.740 \/ (21.740 + 1.188)<\/code> \uc774 0.9482 \ub97c \uc900\ub2e4.<\/p>\n<div class=\"markdown-heading\" dir=\"auto\"><h3 class=\"heading-element\" dir=\"auto\">B.3. Credible Interval<\/h3><a id=\"user-content-b3-credible-interval\" class=\"anchor\" aria-label=\"Permalink: B.3. Credible Interval\" href=\"#b3-credible-interval\"><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\">\uc774 \ubc29\ubc95\uc758 \uc694\uc810\uc740 \uad6c\uac04\uc774\ubbc0\ub85c, 4,000 \uac1c draw \uc804\uccb4\uc758 \uc694\uc57d\uc774 \uc815\uc791 \uc911\uc694\ud55c \uacb0\uacfc\uc774\ub2e4. \uc5b4\ub290 draw \ub3c4 [0, 1]\n\uc744 \ubc97\uc5b4\ub098\uc9c0 \uc54a\uc558\ub2e4.<\/p>\n<p dir=\"auto\"><strong>Table 9. Bayesian R\u00b2 over 4,000 posterior draws<\/strong><\/p>\n<markdown-accessiblity-table><table>\n<thead>\n<tr>\n<th>Variant<\/th>\n<th>Median<\/th>\n<th>90% credible interval<\/th>\n<th>Full range of draws<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>Empirical<\/td>\n<td>0.9571<\/td>\n<td>[0.9112, 0.9613]<\/td>\n<td>[0.0983, 0.9614]<\/td>\n<\/tr>\n<tr>\n<td>Model-based<\/td>\n<td>0.9482<\/td>\n<td>[0.8294, 0.9780]<\/td>\n<td>[0.0771, 0.9893]<\/td>\n<\/tr>\n<\/tbody>\n<\/table><\/markdown-accessiblity-table>\n<p dir=\"auto\">\ub530\ub77c\uc11c \uc774 \uc790\ub8cc\uc5d0 \ub300\ud574 \ubcf4\uace0\ud560 \uacb0\uacfc\ub294 empirical \ubcc0\ud615\uc5d0\uc11c <code>0.9571 &#91;0.9112, 0.9613&#93;<\/code> \uc774\ub2e4. \uad6c\uac04\uc774\uc57c\ub9d0\ub85c\n\ud45c\uc900 R\u00b2 \uac00 \uc904 \uc218 \uc5c6\ub294 \uac83\uc774\ub2e4. OLS \uc758 \uc218 0.9598 \ud558\ub098\ub85c\ub294 \uc774 \uc5ec\ub35f \uc810\uacfc \uc5b4\uc6b8\ub9ac\ub294 posterior draw \uac00\n\ubcc0\ub3d9\uc758 91% \ubc16\uc5d0 \uc124\uba85\ud558\uc9c0 \ubabb\ud560 \uc218\ub3c4 \uc788\ub2e4\ub294 \uac83\ub3c4, \uadf9\ub2e8\uc758 \uaf2c\ub9ac\uac00 0.10 \uae4c\uc9c0 \ub2ff\ub294\ub2e4\ub294 \uac83\ub3c4 \uc54c \uc218 \uc5c6\ub2e4.<\/p>\n<p dir=\"auto\"><a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https:\/\/github.com\/ykim2718\/AIML\/blob\/main\/Metrics\/R2\/Bayesian-R2\/bayesian-r2_fig\/bayesian_r2_posterior.png\"><img src=\"https:\/\/ykim.synology.me\/wordpress\/wp-json\/gh-readme\/v1\/asset?user=ykim2718&#038;repo=AIML&#038;branch=main&#038;path=Metrics\/R2\/Bayesian-R2\/bayesian-r2_fig\/bayesian_r2_posterior.png&#038;sig=5872b83c1518ae35595aab635765f03dbdfc052c37076b8b1ebd377406b217a8\" alt=\"Fig 1\" style=\"max-width: 100%;\"><\/a><\/p>\n<p dir=\"auto\"><strong>Fig 1. Posterior fits and the resulting distribution of Bayesian R\u00b2<\/strong><\/p>\n<p dir=\"auto\">Panel (a) \ub294 \uc790\ub8cc \uc704\uc5d0 posterior \uc801\ud569 200 \uac1c\ub97c \uacb9\uccd0 \uadf8\ub9b0 \uac83\uc774\uba70, \ubd80\ucc57\uc0b4\ucc98\ub7fc \ubc8c\uc5b4\uc9c4 \uae30\uc6b8\uae30\uac00 \uc0b0\ud3ec\uc758\n\uadfc\uc6d0\uc774\ub2e4. Panel (b) \ub294 \uadf8 \uc801\ud569\ub4e4\uc774 \ub9cc\ub4dc\ub294 \ubd84\ud3ec\uc774\ub2e4. \uadf8 \ubaa8\uc591\uc774 5.1 \uc758 \uc8fc\uc7a5\uc744 \ud655\uc778\ud574 \uc900\ub2e4. \uc9c8\ub7c9\uc774\n0.961 \uadfc\ucc98\uc758 \ucc9c\uc7a5\uc5d0 \ubab0\ub824 \uc67c\ucabd\uc73c\ub85c \ud758\ub7ec \ub0b4\ub824\uac00\ubbc0\ub85c \ud3c9\uade0\uc774 \uc911\uc559\uac12 \uc544\ub798\uc5d0 \uc549\uace0, \uc815\uc9c1\ud55c \uc810\ucd94\uc815\uac12\uc740\n\uc911\uc559\uac12\uc774\ub2e4. \uad6c\uac04\uc774 \ud06c\uac8c \ube44\ub300\uce6d\uc778 \uac83\ub3c4 \uac19\uc740 \uc774\uc720\uc774\uba70, \uc544\ub798 \ub05d\uc740 \uc911\uc559\uac12\uc5d0\uc11c 0.046 \ub5a8\uc5b4\uc838 \uc788\uace0 \uc704 \ub05d\uc740\n0.004 \ubc16\uc5d0 \ub5a8\uc5b4\uc838 \uc788\uc9c0 \uc54a\ub2e4.<\/p>\n<p dir=\"auto\">\ub450 \ubcc0\ud615\uc740 \ubc18\uc62c\ub9bc \uc774\uc0c1\uc73c\ub85c \uc5b4\uae0b\ub09c\ub2e4. Model-based \uc911\uc559\uac12\uc740 0.9571 \uc5d0 \ub300\ud574 0.9482 \uc774\uace0 \uad6c\uac04\uc740 \ub300\ub7b5 \uc138\n\ubc30 \ub113\uc740\ub370, <code>sigma<\/code> \uc790\uccb4\uac00 \ubd88\ud655\uc2e4\ud558\uace0 \uadf8 \ubd88\ud655\uc2e4\uc131\uc774 \ubd84\ubaa8\ub85c \uace7\uc7a5 \ub4e4\uc5b4\uac00\uae30 \ub54c\ubb38\uc774\ub2e4. \uac04\uaca9\uc758 \ubc29\ud5a5\uc740\n3.3 \uc774 \uadf8\ub9b0 \uacbd\uc6b0\uc640 \ubc18\ub300\uc774\ub2e4. \uc810\uc774 \uc5ec\ub35f \uac1c\ubfd0\uc774\ub77c <code>sigma^2<\/code> \uc758 posterior \uac00 \uc624\ub978\ucabd\uc73c\ub85c \uce58\uc6b0\uccd0 \uadf8\n\uc911\uc559\uac12 1.387 \uc774 empirical \uc794\ucc28\ubd84\uc0b0\uc758 \uc911\uc559\uac12 1.152 \ubcf4\ub2e4 \uc704\uc5d0 \uc549\uc73c\ubbc0\ub85c, \uc5ec\uae30\uc11c\ub294 model \uc774 \uc794\ucc28\uac00\n\ubcf4\uc5ec \uc8fc\ub294 \uac83\ubcf4\ub2e4 \uc7a1\uc74c\uc774 \uc801\ub2e4\uace0 \ud558\ub294 \ub300\uc2e0 \ub9ce\ub2e4\uace0 \uc8fc\uc7a5\ud55c\ub2e4. \ud55c \ubcc0\ud615\uc73c\ub85c \ub9cc\ub4e0 \uc218\uce58\ub97c \ub2e4\ub978 \ubcc0\ud615\uc73c\ub85c \ub9cc\ub4e0\n\uc218\uce58\uc5d0 \uacac\uc904 \uc218 \uc5c6\ub2e4.<\/p>\n<div class=\"markdown-heading\" dir=\"auto\"><h3 class=\"heading-element\" dir=\"auto\">B.4. Constructed Predictors and the Range Boundary<\/h3><a id=\"user-content-b4-constructed-predictors-and-the-range-boundary\" class=\"anchor\" aria-label=\"Permalink: B.4. Constructed Predictors and the Range Boundary\" href=\"#b4-constructed-predictors-and-the-range-boundary\"><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\">\uc798 \ub9de\uc740 \uac83\uc5d0\uc11c \ubb34\ub108\uc9c4 \uac83\uae4c\uc9c0, \uc608\uce21\uae30 \ub137\uc744 \uc190\uc73c\ub85c \ub9cc\ub4e0\ub2e4. \uc774\uac83\ub4e4\uc740 posterior draw \uac00 \uc544\ub2c8\ub77c \uce58\uc6b0\uce68\uacfc\n\ucc99\ub3c4\ub97c \uc77c\ubd80\ub7ec \uc6c0\uc9c1\uc774\ub824\uace0 \uace0\ub978 \uac83\uc774\ub2e4.<\/p>\n<p dir=\"auto\"><strong>Table 10. Two definitions on hand-constructed predictors<\/strong><\/p>\n<markdown-accessiblity-table><table>\n<thead>\n<tr>\n<th>Predictor<\/th>\n<th>a<\/th>\n<th>b<\/th>\n<th>Standard R\u00b2<\/th>\n<th>Bayesian R\u00b2<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>Well calibrated<\/td>\n<td>0.10<\/td>\n<td>2.05<\/td>\n<td>0.9593<\/td>\n<td>0.9598<\/td>\n<\/tr>\n<tr>\n<td>Mildly shrunk<\/td>\n<td>1.10<\/td>\n<td>1.83<\/td>\n<td>0.9480<\/td>\n<td>0.9370<\/td>\n<\/tr>\n<tr>\n<td>Strongly shrunk<\/td>\n<td>4.60<\/td>\n<td>1.05<\/td>\n<td>0.7306<\/td>\n<td>0.4833<\/td>\n<\/tr>\n<tr>\n<td>Collapsed to a wrong center<\/td>\n<td>12.00<\/td>\n<td>0.20<\/td>\n<td>\u22120.4128<\/td>\n<td>0.0110<\/td>\n<\/tr>\n<\/tbody>\n<\/table><\/markdown-accessiblity-table>\n<p dir=\"auto\">Shrink \ub41c \ub450 \ud589\uc5d0\uc11c Gelman \uaf34\uc774 \ud45c\uc900 \uaf34\ubcf4\ub2e4 \ube68\ub9ac \ub5a8\uc5b4\uc9c4\ub2e4. \uc608\uce21\uae30\ub97c shrink \ud558\uba74 \ubd84\uc0b0\uc774 \ubd84\uc790\uc5d0\uc11c\n\ube60\uc838 \ubd84\ubaa8\ub85c \ub354\ud574\uc9c0\ubbc0\ub85c Bayesian R\u00b2 \ub294 \ub450 \uacbd\ub85c\ub85c \ubc18\uc751\ud558\ub294 \ubc18\uba74, \ud45c\uc900 \uaf34\uc740 <code>SS_tot<\/code> \ub97c \uace0\uc815\ud55c \ucc44\n\ucee4\uc9c0\ub294 <code>SS_res<\/code> \ud558\ub098\ub85c\ub9cc \ubc18\uc751\ud55c\ub2e4.<\/p>\n<p dir=\"auto\">\ub9c8\uc9c0\ub9c9 \ud589\uc774 \ud45c\uc900 \uaf34\uc774 \uc790\uae30 \ubc94\uc704\ub97c \ubc97\uc5b4\ub098\ub294 \uc790\ub9ac\uc774\ub2e4. \uadf8 \uc608\uce21\uc740 y \uc758 \ud3c9\uade0\uc744 \uadf8\ub0e5 \ubcf4\uace0\ud558\ub294 \uac83\ubcf4\ub2e4\ub3c4\n\ub098\ube60\uc11c <code>SS_res<\/code> \uac00 <code>SS_tot<\/code> \ub97c \ub118\uace0 \uac12\uc774 \u22120.4128 \ub85c \ub0b4\ub824\uac04\ub2e4. \uc774\uac83\uc774 3.1 \uc774 \uae30\uc220\ud55c \uc2e4\ud328\uc774\uba70, draw\n\ub9c8\ub2e4 \uacc4\uc0b0\ud55c \ud45c\uc900 R\u00b2 \uac12\uc744 \ubaa8\uc544 \ubd84\ud3ec\ub85c \ub9cc\ub4e4 \uc218 \uc5c6\ub294 \uc774\uc720\uc774\ub2e4. Gelman \uaf34\uc740 \uac19\uc740 \uc2e4\ud328\ub97c \uacb0\ucf54 \ubc97\uc5b4\ub098\uc9c0\n\uc54a\ub294 \ubc94\uc704\uc758 \ubc14\ub2e5 \uac00\uae4c\uc774\uc778 0.0110 \uc73c\ub85c \uae30\ub85d\ud55c\ub2e4.<\/p>\n<div class=\"markdown-heading\" dir=\"auto\"><h3 class=\"heading-element\" dir=\"auto\">B.5. Summary of the Comparison<\/h3><a id=\"user-content-b5-summary-of-the-comparison\" class=\"anchor\" aria-label=\"Permalink: B.5. Summary of the Comparison\" href=\"#b5-summary-of-the-comparison\"><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\"><strong>Table 11. What each metric reports on this dataset<\/strong><\/p>\n<markdown-accessiblity-table><table>\n<thead>\n<tr>\n<th>Metric<\/th>\n<th>Value<\/th>\n<th>What it answers<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>Standard R\u00b2 on the OLS fit<\/td>\n<td>0.9598<\/td>\n<td>\ub2e8 \ud558\ub098\uc758 \ucd5c\uc801 \uc801\ud569\uc774 \ubcc0\ub3d9\uc744 \uc5bc\ub9c8\ub098 \uc124\uba85\ud558\ub294\uac00<\/td>\n<\/tr>\n<tr>\n<td>Bayesian R\u00b2, median<\/td>\n<td>0.9571<\/td>\n<td>\uc804\ud615\uc801\uc778 posterior draw \uac00 \ubcc0\ub3d9\uc744 \uc5bc\ub9c8\ub098 \uc124\uba85\ud558\ub294\uac00<\/td>\n<\/tr>\n<tr>\n<td>Bayesian R\u00b2, 90% credible interval<\/td>\n<td>[0.9112, 0.9613]<\/td>\n<td>\uadf8 \uc124\uba85\ub825\uc774 \uc911\uc559\uac12\uc5d0\uc11c \uc5bc\ub9c8\ub098 \ub5a8\uc5b4\uc9c8 \uc218 \uc788\ub294\uac00<\/td>\n<\/tr>\n<\/tbody>\n<\/table><\/markdown-accessiblity-table>\n<p dir=\"auto\">\ub450 \uc815\uc758\ub294 \uc798 \ub9de\uc740 \uc608\uce21\uae30\uc5d0\uc11c\ub294 \uc77c\uce58\ud558\uace0, \uc608\uce21\uc774 \uce58\uc6b0\uce58\uac70\ub098 shrink \ub418\ub294 \uc21c\uac04 \uac08\ub77c\uc9c4\ub2e4. \uad6c\uac04\uc744 \uc2e3\ub294\n\uac83\uc740 Bayesian R\u00b2 \ubfd0\uc774\uba70, \uc774 \uc790\ub8cc\uc5d0\uc11c\ub294 \uadf8 \uad6c\uac04\uc774 \uace7 \ubc1c\uacac\uc774\ub2e4. \uc5ec\ub35f \uac1c\uc758 \uc810\uc740 0.957 \uc774\ub77c\ub294 \uc911\uc559\uac12\uc740\n\ubc1b\uccd0 \uc8fc\uc9c0\ub9cc, 0.9598 \uc774\ub77c\ub294 \ub9e8 \uc218\uac00 \uc57d\uc18d\ud558\ub294 \ub4ef\ud55c \uc815\ubc00\ub3c4\ub294 \ubc1b\uccd0 \uc8fc\uc9c0 \uc54a\ub294\ub2e4.<\/p>\n<\/article><\/div><\/div><\/p>\n<\/div><\/div>\n<\/div><\/div><\/div>\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 Standard R\u00b2 returns a single number with no sense of how firmly it holds. Bayesian R\u00b2 computes Var_fit \/ (Var_fit + Var_res) for every posterior draw, yielding a distribution bounded in [0, 1] \u2014 a median plus a credible interval. Covers the Gelman formulation, both residual-variance variants, applicable models, and common pitfalls.<\/p>\n","protected":false},"author":4,"featured_media":6790,"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":2.7,"yasr_post_is_review":"","yasr_auto_insert_disabled":"","yasr_review_type":"","fifu_image_url":"","fifu_image_alt":"","iawp_total_views":12,"footnotes":""},"categories":[56,369,321,431],"tags":[386,388],"class_list":["post-6789","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":0,"sum_votes":0},"jetpack_featured_media_url":"https:\/\/ykim.synology.me\/wordpress\/wp-content\/uploads\/2026\/08\/georgetown-resort-pool-umbrella-patio.jpg","_links":{"self":[{"href":"https:\/\/ykim.synology.me\/wordpress\/wp-json\/wp\/v2\/posts\/6789","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=6789"}],"version-history":[{"count":5,"href":"https:\/\/ykim.synology.me\/wordpress\/wp-json\/wp\/v2\/posts\/6789\/revisions"}],"predecessor-version":[{"id":7461,"href":"https:\/\/ykim.synology.me\/wordpress\/wp-json\/wp\/v2\/posts\/6789\/revisions\/7461"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ykim.synology.me\/wordpress\/wp-json\/wp\/v2\/media\/6790"}],"wp:attachment":[{"href":"https:\/\/ykim.synology.me\/wordpress\/wp-json\/wp\/v2\/media?parent=6789"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ykim.synology.me\/wordpress\/wp-json\/wp\/v2\/categories?post=6789"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ykim.synology.me\/wordpress\/wp-json\/wp\/v2\/tags?post=6789"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}