diff --git a/404.html b/404.html index edda0838..9dd71062 100644 --- a/404.html +++ b/404.html @@ -11,7 +11,7 @@ - + diff --git a/assets/js/60c4aef6.df20c7dd.js b/assets/js/60c4aef6.df20c7dd.js deleted file mode 100644 index 44bf2f7c..00000000 --- a/assets/js/60c4aef6.df20c7dd.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkbpd_reference=self.webpackChunkbpd_reference||[]).push([[6142],{3071:(s,e,a)=>{a.r(e),a.d(e,{assets:()=>c,contentTitle:()=>l,default:()=>d,frontMatter:()=>t,metadata:()=>r,toc:()=>m});var n=a(4848),i=a(8453);a(8597),a(5158);const t={sidebar_position:5,sidebar_label:"Observed & Test Statistic",title:"Observed & Test Statistic"},l=void 0,r={id:"statistical-inference/obs_and_test_stats",title:"Observed & Test Statistic",description:"Concept",source:"@site/docs/statistical-inference/obs_and_test_stats.md",sourceDirName:"statistical-inference",slug:"/statistical-inference/obs_and_test_stats",permalink:"/bpd-reference/docs/statistical-inference/obs_and_test_stats",draft:!1,unlisted:!1,editUrl:"https://github.com/dsc-courses/bpd-reference/tree/main/docs/statistical-inference/obs_and_test_stats.md",tags:[],version:"current",sidebarPosition:5,frontMatter:{sidebar_position:5,sidebar_label:"Observed & Test Statistic",title:"Observed & Test Statistic"},sidebar:"statsSidebar",previous:{title:"Null & Alternative Hypothesis",permalink:"/bpd-reference/docs/statistical-inference/null_and_alt"},next:{title:"P-value",permalink:"/bpd-reference/docs/statistical-inference/p_value"}},c={},m=[{value:"Concept",id:"concept",level:2},{value:"Common Test Statistics \ud83c\udf1f",id:"common-test-statistics-",level:2},{value:"1. Absolute Difference",id:"1-absolute-difference",level:3},{value:"2. Difference",id:"2-difference",level:3},{value:"3. Total Variation Distance (TVD)",id:"3-total-variation-distance-tvd",level:3}];function h(s){const e={a:"a",admonition:"admonition",annotation:"annotation",br:"br",code:"code",em:"em",h2:"h2",h3:"h3",li:"li",math:"math",mfrac:"mfrac",mi:"mi",mn:"mn",mo:"mo",mrow:"mrow",msub:"msub",mtext:"mtext",ol:"ol",p:"p",pre:"pre",semantics:"semantics",span:"span",strong:"strong",ul:"ul",...(0,i.R)(),...s.components};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(e.h2,{id:"concept",children:"Concept"}),"\n",(0,n.jsxs)(e.admonition,{title:"Terminology",type:"info",children:[(0,n.jsxs)(e.p,{children:[(0,n.jsx)(e.strong,{children:"Experiment"}),": A process whose outcome is random."]}),(0,n.jsxs)(e.ul,{children:["\n",(0,n.jsx)(e.li,{children:"Example: Flipping 100 coins."}),"\n"]}),(0,n.jsxs)(e.p,{children:[(0,n.jsx)(e.strong,{children:"Observed Statistic"}),": A statistic computed from the observed data."]}),(0,n.jsxs)(e.ul,{children:["\n",(0,n.jsx)(e.li,{children:"Example: The number of heads observed."}),"\n"]}),(0,n.jsxs)(e.p,{children:[(0,n.jsx)(e.strong,{children:"Test Statistic"}),": A statistic computed from a sample generated under the assumption that the null hypothesis is true."]}),(0,n.jsxs)(e.ul,{children:["\n",(0,n.jsx)(e.li,{children:"Think of the test statistic a number you write down each time you perform an experiment."}),"\n",(0,n.jsx)(e.li,{children:"The test statistic should be such that high observed values lean towards one hypothesis and low observed values lean towards the other."}),"\n"]})]}),"\n",(0,n.jsx)(e.h2,{id:"common-test-statistics-",children:"Common Test Statistics \ud83c\udf1f"}),"\n",(0,n.jsx)(e.h3,{id:"1-absolute-difference",children:"1. Absolute Difference"}),"\n",(0,n.jsx)(e.p,{children:"Absolute difference in group mean/median/number of times a certain event happens."}),"\n",(0,n.jsxs)(e.ul,{children:["\n",(0,n.jsxs)(e.li,{children:["\u2705 Used for measuring how different two ",(0,n.jsx)(e.strong,{children:"numerical distributions"})," are, and when the alternative hypothesis is ",(0,n.jsx)(e.strong,{children:(0,n.jsx)(e.em,{children:"not equal to"})}),'. For example, "the coin is biased" or "the probability of tossing a head is 0.5".']}),"\n",(0,n.jsxs)(e.li,{children:["\ud83d\udcbb ",(0,n.jsx)(e.a,{href:"https://dsc-courses.github.io/bpd-reference/docs/statistical-inference/permutation_test#code-example-absolute-difference",children:"Example"})," of using absolute difference as the test statistic in a permutation test."]}),"\n"]}),"\n",(0,n.jsx)(e.h3,{id:"2-difference",children:"2. Difference"}),"\n",(0,n.jsx)(e.p,{children:"Difference in group mean/median/number of times a certain event happens."}),"\n",(0,n.jsxs)(e.ul,{children:["\n",(0,n.jsxs)(e.li,{children:["\u2705 Used for measuring how different two ",(0,n.jsx)(e.strong,{children:"numerical distributions"})," are, and the alternative hypothesis is ",(0,n.jsx)(e.strong,{children:(0,n.jsx)(e.em,{children:"less than"})})," or ",(0,n.jsx)(e.strong,{children:(0,n.jsx)(e.em,{children:"greater than"})}),'. For example, "the coin is biased towards heads" or "the probability of tossing a head is greater then 0.5".']}),"\n",(0,n.jsxs)(e.li,{children:["\ud83d\udcbb ",(0,n.jsx)(e.a,{href:"https://dsc-courses.github.io/bpd-reference/docs/statistical-inference/hypothesis_test#code-example-1-difference",children:"Example"})," of using difference as the test statistic in a hypothesis test."]}),"\n"]}),"\n",(0,n.jsx)(e.h3,{id:"3-total-variation-distance-tvd",children:"3. Total Variation Distance (TVD)"}),"\n",(0,n.jsxs)(e.p,{children:["A test statistic that quantifies how different ",(0,n.jsx)(e.strong,{children:"two categorical distributions"})," are by calculating the sum of the absolute differences of their proportions, all divided by 2."]}),"\n",(0,n.jsxs)(e.ul,{children:["\n",(0,n.jsx)(e.li,{children:"\u274c\ufe0f The TVD is not used for permutation tests."}),"\n",(0,n.jsxs)(e.li,{children:['\u2705 Used for assessing whether an "observed sample" was drawn randomly from a known ',(0,n.jsx)(e.strong,{children:"categorical distribution"}),"."]}),"\n",(0,n.jsxs)(e.li,{children:["\ud83d\udcbb ",(0,n.jsx)(e.a,{href:"https://dsc-courses.github.io/bpd-reference/docs/statistical-inference/hypothesis_test/#code-example-2-tvd",children:"Example"})," of using TVD as the test statistic in a hypothesis test."]}),"\n"]}),"\n",(0,n.jsx)(e.pre,{children:(0,n.jsx)(e.code,{className:"language-python",children:"#code implementation\ndef tvd(dist1, dist2):\n '''Computes the TVD between two categorical distributions, \n assuming the categories appear in the same order.'''\n return np.abs(dist1 - dist2).sum() / 2\n"})}),"\n",(0,n.jsxs)(e.admonition,{type:"note",children:[(0,n.jsxs)(e.p,{children:[(0,n.jsx)(e.strong,{children:"3 Ways of Manually Computing TVD:"})," \ud83e\uddee"]}),(0,n.jsx)(e.p,{children:"to do: use an example"}),(0,n.jsx)(e.p,{children:(0,n.jsxs)(e.em,{children:["Assume ",(0,n.jsxs)(e.span,{className:"katex",children:[(0,n.jsx)(e.span,{className:"katex-mathml",children:(0,n.jsx)(e.math,{xmlns:"http://www.w3.org/1998/Math/MathML",children:(0,n.jsxs)(e.semantics,{children:[(0,n.jsx)(e.mrow,{children:(0,n.jsxs)(e.msub,{children:[(0,n.jsx)(e.mi,{children:"P"}),(0,n.jsx)(e.mi,{children:"i"})]})}),(0,n.jsx)(e.annotation,{encoding:"application/x-tex",children:"P_i"})]})})}),(0,n.jsx)(e.span,{className:"katex-html","aria-hidden":"true",children:(0,n.jsxs)(e.span,{className:"base",children:[(0,n.jsx)(e.span,{className:"strut",style:{height:"0.8333em",verticalAlign:"-0.15em"}}),(0,n.jsxs)(e.span,{className:"mord",children:[(0,n.jsx)(e.span,{className:"mord mathnormal",style:{marginRight:"0.13889em"},children:"P"}),(0,n.jsx)(e.span,{className:"msupsub",children:(0,n.jsxs)(e.span,{className:"vlist-t vlist-t2",children:[(0,n.jsxs)(e.span,{className:"vlist-r",children:[(0,n.jsx)(e.span,{className:"vlist",style:{height:"0.3117em"},children:(0,n.jsxs)(e.span,{style:{top:"-2.55em",marginLeft:"-0.1389em",marginRight:"0.05em"},children:[(0,n.jsx)(e.span,{className:"pstrut",style:{height:"2.7em"}}),(0,n.jsx)(e.span,{className:"sizing reset-size6 size3 mtight",children:(0,n.jsx)(e.span,{className:"mord mathnormal mtight",children:"i"})})]})}),(0,n.jsx)(e.span,{className:"vlist-s",children:"\u200b"})]}),(0,n.jsx)(e.span,{className:"vlist-r",children:(0,n.jsx)(e.span,{className:"vlist",style:{height:"0.15em"},children:(0,n.jsx)(e.span,{})})})]})})]})]})})]})," is one distribution and ",(0,n.jsxs)(e.span,{className:"katex",children:[(0,n.jsx)(e.span,{className:"katex-mathml",children:(0,n.jsx)(e.math,{xmlns:"http://www.w3.org/1998/Math/MathML",children:(0,n.jsxs)(e.semantics,{children:[(0,n.jsx)(e.mrow,{children:(0,n.jsxs)(e.msub,{children:[(0,n.jsx)(e.mi,{children:"Q"}),(0,n.jsx)(e.mi,{children:"i"})]})}),(0,n.jsx)(e.annotation,{encoding:"application/x-tex",children:"Q_i"})]})})}),(0,n.jsx)(e.span,{className:"katex-html","aria-hidden":"true",children:(0,n.jsxs)(e.span,{className:"base",children:[(0,n.jsx)(e.span,{className:"strut",style:{height:"0.8778em",verticalAlign:"-0.1944em"}}),(0,n.jsxs)(e.span,{className:"mord",children:[(0,n.jsx)(e.span,{className:"mord mathnormal",children:"Q"}),(0,n.jsx)(e.span,{className:"msupsub",children:(0,n.jsxs)(e.span,{className:"vlist-t vlist-t2",children:[(0,n.jsxs)(e.span,{className:"vlist-r",children:[(0,n.jsx)(e.span,{className:"vlist",style:{height:"0.3117em"},children:(0,n.jsxs)(e.span,{style:{top:"-2.55em",marginLeft:"0em",marginRight:"0.05em"},children:[(0,n.jsx)(e.span,{className:"pstrut",style:{height:"2.7em"}}),(0,n.jsx)(e.span,{className:"sizing reset-size6 size3 mtight",children:(0,n.jsx)(e.span,{className:"mord mathnormal mtight",children:"i"})})]})}),(0,n.jsx)(e.span,{className:"vlist-s",children:"\u200b"})]}),(0,n.jsx)(e.span,{className:"vlist-r",children:(0,n.jsx)(e.span,{className:"vlist",style:{height:"0.15em"},children:(0,n.jsx)(e.span,{})})})]})})]})]})})]})," is the other, and the categories appear in the same order"]})}),(0,n.jsxs)(e.ol,{children:["\n",(0,n.jsxs)(e.li,{children:["\n",(0,n.jsxs)(e.p,{children:[(0,n.jsx)(e.strong,{children:"Follow the definition:"})," Calculate the sum of the absolute differences of the two distributions' proportions, all divided by 2. ",(0,n.jsx)(e.br,{}),"\n",(0,n.jsxs)(e.span,{className:"katex",children:[(0,n.jsx)(e.span,{className:"katex-mathml",children:(0,n.jsx)(e.math,{xmlns:"http://www.w3.org/1998/Math/MathML",children:(0,n.jsxs)(e.semantics,{children:[(0,n.jsxs)(e.mrow,{children:[(0,n.jsx)(e.mtext,{children:"TVD"}),(0,n.jsx)(e.mo,{children:"="}),(0,n.jsxs)(e.mfrac,{children:[(0,n.jsx)(e.mn,{children:"1"}),(0,n.jsx)(e.mn,{children:"2"})]}),(0,n.jsx)(e.mo,{children:"\u2211"}),(0,n.jsx)(e.mo,{children:"\u2223"}),(0,n.jsxs)(e.msub,{children:[(0,n.jsx)(e.mi,{children:"P"}),(0,n.jsx)(e.mi,{children:"i"})]}),(0,n.jsx)(e.mo,{children:"\u2212"}),(0,n.jsxs)(e.msub,{children:[(0,n.jsx)(e.mi,{children:"Q"}),(0,n.jsx)(e.mi,{children:"i"})]}),(0,n.jsx)(e.mo,{children:"\u2223"})]}),(0,n.jsx)(e.annotation,{encoding:"application/x-tex",children:"\\text{TVD}=\\frac{1}{2}\\sum \\mid P_i - Q_i\\mid"})]})})}),(0,n.jsxs)(e.span,{className:"katex-html","aria-hidden":"true",children:[(0,n.jsxs)(e.span,{className:"base",children:[(0,n.jsx)(e.span,{className:"strut",style:{height:"0.6833em"}}),(0,n.jsx)(e.span,{className:"mord text",children:(0,n.jsx)(e.span,{className:"mord",children:"TVD"})}),(0,n.jsx)(e.span,{className:"mspace",style:{marginRight:"0.2778em"}}),(0,n.jsx)(e.span,{className:"mrel",children:"="}),(0,n.jsx)(e.span,{className:"mspace",style:{marginRight:"0.2778em"}})]}),(0,n.jsxs)(e.span,{className:"base",children:[(0,n.jsx)(e.span,{className:"strut",style:{height:"1.1901em",verticalAlign:"-0.345em"}}),(0,n.jsxs)(e.span,{className:"mord",children:[(0,n.jsx)(e.span,{className:"mopen nulldelimiter"}),(0,n.jsx)(e.span,{className:"mfrac",children:(0,n.jsxs)(e.span,{className:"vlist-t vlist-t2",children:[(0,n.jsxs)(e.span,{className:"vlist-r",children:[(0,n.jsxs)(e.span,{className:"vlist",style:{height:"0.8451em"},children:[(0,n.jsxs)(e.span,{style:{top:"-2.655em"},children:[(0,n.jsx)(e.span,{className:"pstrut",style:{height:"3em"}}),(0,n.jsx)(e.span,{className:"sizing reset-size6 size3 mtight",children:(0,n.jsx)(e.span,{className:"mord mtight",children:(0,n.jsx)(e.span,{className:"mord mtight",children:"2"})})})]}),(0,n.jsxs)(e.span,{style:{top:"-3.23em"},children:[(0,n.jsx)(e.span,{className:"pstrut",style:{height:"3em"}}),(0,n.jsx)(e.span,{className:"frac-line",style:{borderBottomWidth:"0.04em"}})]}),(0,n.jsxs)(e.span,{style:{top:"-3.394em"},children:[(0,n.jsx)(e.span,{className:"pstrut",style:{height:"3em"}}),(0,n.jsx)(e.span,{className:"sizing reset-size6 size3 mtight",children:(0,n.jsx)(e.span,{className:"mord mtight",children:(0,n.jsx)(e.span,{className:"mord mtight",children:"1"})})})]})]}),(0,n.jsx)(e.span,{className:"vlist-s",children:"\u200b"})]}),(0,n.jsx)(e.span,{className:"vlist-r",children:(0,n.jsx)(e.span,{className:"vlist",style:{height:"0.345em"},children:(0,n.jsx)(e.span,{})})})]})}),(0,n.jsx)(e.span,{className:"mclose nulldelimiter"})]}),(0,n.jsx)(e.span,{className:"mspace",style:{marginRight:"0.1667em"}}),(0,n.jsx)(e.span,{className:"mop op-symbol small-op",style:{position:"relative",top:"0em"},children:"\u2211"}),(0,n.jsx)(e.span,{className:"mspace",style:{marginRight:"0.2778em"}}),(0,n.jsx)(e.span,{className:"mrel",children:"\u2223"}),(0,n.jsx)(e.span,{className:"mspace",style:{marginRight:"0.2778em"}})]}),(0,n.jsxs)(e.span,{className:"base",children:[(0,n.jsx)(e.span,{className:"strut",style:{height:"0.8333em",verticalAlign:"-0.15em"}}),(0,n.jsxs)(e.span,{className:"mord",children:[(0,n.jsx)(e.span,{className:"mord mathnormal",style:{marginRight:"0.13889em"},children:"P"}),(0,n.jsx)(e.span,{className:"msupsub",children:(0,n.jsxs)(e.span,{className:"vlist-t vlist-t2",children:[(0,n.jsxs)(e.span,{className:"vlist-r",children:[(0,n.jsx)(e.span,{className:"vlist",style:{height:"0.3117em"},children:(0,n.jsxs)(e.span,{style:{top:"-2.55em",marginLeft:"-0.1389em",marginRight:"0.05em"},children:[(0,n.jsx)(e.span,{className:"pstrut",style:{height:"2.7em"}}),(0,n.jsx)(e.span,{className:"sizing reset-size6 size3 mtight",children:(0,n.jsx)(e.span,{className:"mord mathnormal mtight",children:"i"})})]})}),(0,n.jsx)(e.span,{className:"vlist-s",children:"\u200b"})]}),(0,n.jsx)(e.span,{className:"vlist-r",children:(0,n.jsx)(e.span,{className:"vlist",style:{height:"0.15em"},children:(0,n.jsx)(e.span,{})})})]})})]}),(0,n.jsx)(e.span,{className:"mspace",style:{marginRight:"0.2222em"}}),(0,n.jsx)(e.span,{className:"mbin",children:"\u2212"}),(0,n.jsx)(e.span,{className:"mspace",style:{marginRight:"0.2222em"}})]}),(0,n.jsxs)(e.span,{className:"base",children:[(0,n.jsx)(e.span,{className:"strut",style:{height:"1em",verticalAlign:"-0.25em"}}),(0,n.jsxs)(e.span,{className:"mord",children:[(0,n.jsx)(e.span,{className:"mord mathnormal",children:"Q"}),(0,n.jsx)(e.span,{className:"msupsub",children:(0,n.jsxs)(e.span,{className:"vlist-t vlist-t2",children:[(0,n.jsxs)(e.span,{className:"vlist-r",children:[(0,n.jsx)(e.span,{className:"vlist",style:{height:"0.3117em"},children:(0,n.jsxs)(e.span,{style:{top:"-2.55em",marginLeft:"0em",marginRight:"0.05em"},children:[(0,n.jsx)(e.span,{className:"pstrut",style:{height:"2.7em"}}),(0,n.jsx)(e.span,{className:"sizing reset-size6 size3 mtight",children:(0,n.jsx)(e.span,{className:"mord mathnormal mtight",children:"i"})})]})}),(0,n.jsx)(e.span,{className:"vlist-s",children:"\u200b"})]}),(0,n.jsx)(e.span,{className:"vlist-r",children:(0,n.jsx)(e.span,{className:"vlist",style:{height:"0.15em"},children:(0,n.jsx)(e.span,{})})})]})})]}),(0,n.jsx)(e.span,{className:"mspace",style:{marginRight:"0.2778em"}}),(0,n.jsx)(e.span,{className:"mrel",children:"\u2223"})]})]})]})]}),"\n"]}),"\n",(0,n.jsxs)(e.li,{children:["\n",(0,n.jsxs)(e.p,{children:[(0,n.jsx)(e.strong,{children:"Sum of positive differences:"})," Add only the values where one distribution (e.g. P_i) is greater than the other (e.g. Q_i) . This essentially sums the excessive probabilities in one distribution over the other. ",(0,n.jsx)(e.br,{}),"\n",(0,n.jsxs)(e.span,{className:"katex",children:[(0,n.jsx)(e.span,{className:"katex-mathml",children:(0,n.jsx)(e.math,{xmlns:"http://www.w3.org/1998/Math/MathML",children:(0,n.jsxs)(e.semantics,{children:[(0,n.jsxs)(e.mrow,{children:[(0,n.jsx)(e.mtext,{children:"TVD"}),(0,n.jsx)(e.mo,{children:"="}),(0,n.jsx)(e.mo,{children:"\u2211"}),(0,n.jsx)(e.mi,{children:"m"}),(0,n.jsx)(e.mi,{children:"a"}),(0,n.jsx)(e.mi,{children:"x"}),(0,n.jsx)(e.mo,{stretchy:"false",children:"("}),(0,n.jsxs)(e.msub,{children:[(0,n.jsx)(e.mi,{children:"P"}),(0,n.jsx)(e.mi,{children:"i"})]}),(0,n.jsx)(e.mo,{children:"\u2212"}),(0,n.jsxs)(e.msub,{children:[(0,n.jsx)(e.mi,{children:"Q"}),(0,n.jsx)(e.mi,{children:"i"})]}),(0,n.jsx)(e.mo,{separator:"true",children:","}),(0,n.jsx)(e.mn,{children:"0"}),(0,n.jsx)(e.mo,{stretchy:"false",children:")"})]}),(0,n.jsx)(e.annotation,{encoding:"application/x-tex",children:"\\text{TVD}=\\sum max(P_i-Q_i,0)"})]})})}),(0,n.jsxs)(e.span,{className:"katex-html","aria-hidden":"true",children:[(0,n.jsxs)(e.span,{className:"base",children:[(0,n.jsx)(e.span,{className:"strut",style:{height:"0.6833em"}}),(0,n.jsx)(e.span,{className:"mord text",children:(0,n.jsx)(e.span,{className:"mord",children:"TVD"})}),(0,n.jsx)(e.span,{className:"mspace",style:{marginRight:"0.2778em"}}),(0,n.jsx)(e.span,{className:"mrel",children:"="}),(0,n.jsx)(e.span,{className:"mspace",style:{marginRight:"0.2778em"}})]}),(0,n.jsxs)(e.span,{className:"base",children:[(0,n.jsx)(e.span,{className:"strut",style:{height:"1em",verticalAlign:"-0.25em"}}),(0,n.jsx)(e.span,{className:"mop op-symbol small-op",style:{position:"relative",top:"0em"},children:"\u2211"}),(0,n.jsx)(e.span,{className:"mspace",style:{marginRight:"0.1667em"}}),(0,n.jsx)(e.span,{className:"mord mathnormal",children:"ma"}),(0,n.jsx)(e.span,{className:"mord mathnormal",children:"x"}),(0,n.jsx)(e.span,{className:"mopen",children:"("}),(0,n.jsxs)(e.span,{className:"mord",children:[(0,n.jsx)(e.span,{className:"mord mathnormal",style:{marginRight:"0.13889em"},children:"P"}),(0,n.jsx)(e.span,{className:"msupsub",children:(0,n.jsxs)(e.span,{className:"vlist-t vlist-t2",children:[(0,n.jsxs)(e.span,{className:"vlist-r",children:[(0,n.jsx)(e.span,{className:"vlist",style:{height:"0.3117em"},children:(0,n.jsxs)(e.span,{style:{top:"-2.55em",marginLeft:"-0.1389em",marginRight:"0.05em"},children:[(0,n.jsx)(e.span,{className:"pstrut",style:{height:"2.7em"}}),(0,n.jsx)(e.span,{className:"sizing reset-size6 size3 mtight",children:(0,n.jsx)(e.span,{className:"mord mathnormal mtight",children:"i"})})]})}),(0,n.jsx)(e.span,{className:"vlist-s",children:"\u200b"})]}),(0,n.jsx)(e.span,{className:"vlist-r",children:(0,n.jsx)(e.span,{className:"vlist",style:{height:"0.15em"},children:(0,n.jsx)(e.span,{})})})]})})]}),(0,n.jsx)(e.span,{className:"mspace",style:{marginRight:"0.2222em"}}),(0,n.jsx)(e.span,{className:"mbin",children:"\u2212"}),(0,n.jsx)(e.span,{className:"mspace",style:{marginRight:"0.2222em"}})]}),(0,n.jsxs)(e.span,{className:"base",children:[(0,n.jsx)(e.span,{className:"strut",style:{height:"1em",verticalAlign:"-0.25em"}}),(0,n.jsxs)(e.span,{className:"mord",children:[(0,n.jsx)(e.span,{className:"mord mathnormal",children:"Q"}),(0,n.jsx)(e.span,{className:"msupsub",children:(0,n.jsxs)(e.span,{className:"vlist-t vlist-t2",children:[(0,n.jsxs)(e.span,{className:"vlist-r",children:[(0,n.jsx)(e.span,{className:"vlist",style:{height:"0.3117em"},children:(0,n.jsxs)(e.span,{style:{top:"-2.55em",marginLeft:"0em",marginRight:"0.05em"},children:[(0,n.jsx)(e.span,{className:"pstrut",style:{height:"2.7em"}}),(0,n.jsx)(e.span,{className:"sizing reset-size6 size3 mtight",children:(0,n.jsx)(e.span,{className:"mord mathnormal mtight",children:"i"})})]})}),(0,n.jsx)(e.span,{className:"vlist-s",children:"\u200b"})]}),(0,n.jsx)(e.span,{className:"vlist-r",children:(0,n.jsx)(e.span,{className:"vlist",style:{height:"0.15em"},children:(0,n.jsx)(e.span,{})})})]})})]}),(0,n.jsx)(e.span,{className:"mpunct",children:","}),(0,n.jsx)(e.span,{className:"mspace",style:{marginRight:"0.1667em"}}),(0,n.jsx)(e.span,{className:"mord",children:"0"}),(0,n.jsx)(e.span,{className:"mclose",children:")"})]})]})]})]}),"\n"]}),"\n"]}),(0,n.jsx)(e.p,{children:"to do: replace formula with example DataFrame visualization"}),(0,n.jsxs)(e.ol,{start:"3",children:["\n",(0,n.jsxs)(e.li,{children:[(0,n.jsx)(e.strong,{children:"Sum of negative differences:"})," Add only the absolute values where the selected distribution (e.g. P_i) is less than the other (e.g. Q_i). This essentially sums the deficient probabilities in one distribution relative to the other. ",(0,n.jsx)(e.br,{}),"\n",(0,n.jsxs)(e.span,{className:"katex",children:[(0,n.jsx)(e.span,{className:"katex-mathml",children:(0,n.jsx)(e.math,{xmlns:"http://www.w3.org/1998/Math/MathML",children:(0,n.jsxs)(e.semantics,{children:[(0,n.jsxs)(e.mrow,{children:[(0,n.jsx)(e.mtext,{children:"TVD"}),(0,n.jsx)(e.mo,{children:"="}),(0,n.jsx)(e.mo,{children:"\u2211"}),(0,n.jsx)(e.mi,{children:"a"}),(0,n.jsx)(e.mi,{children:"b"}),(0,n.jsx)(e.mi,{children:"s"}),(0,n.jsx)(e.mo,{stretchy:"false",children:"("}),(0,n.jsx)(e.mi,{children:"m"}),(0,n.jsx)(e.mi,{children:"i"}),(0,n.jsx)(e.mi,{children:"n"}),(0,n.jsx)(e.mo,{stretchy:"false",children:"("}),(0,n.jsxs)(e.msub,{children:[(0,n.jsx)(e.mi,{children:"P"}),(0,n.jsx)(e.mi,{children:"i"})]}),(0,n.jsx)(e.mo,{children:"\u2212"}),(0,n.jsxs)(e.msub,{children:[(0,n.jsx)(e.mi,{children:"Q"}),(0,n.jsx)(e.mi,{children:"i"})]}),(0,n.jsx)(e.mo,{separator:"true",children:","}),(0,n.jsx)(e.mn,{children:"0"}),(0,n.jsx)(e.mo,{stretchy:"false",children:")"}),(0,n.jsx)(e.mo,{stretchy:"false",children:")"}),(0,n.jsx)(e.mtext,{children:"\xa0or\xa0TVD"}),(0,n.jsx)(e.mo,{children:"="}),(0,n.jsx)(e.mo,{children:"\u2211"}),(0,n.jsx)(e.mi,{children:"m"}),(0,n.jsx)(e.mi,{children:"a"}),(0,n.jsx)(e.mi,{children:"x"}),(0,n.jsx)(e.mo,{stretchy:"false",children:"("}),(0,n.jsxs)(e.msub,{children:[(0,n.jsx)(e.mi,{children:"Q"}),(0,n.jsx)(e.mi,{children:"i"})]}),(0,n.jsx)(e.mo,{children:"\u2212"}),(0,n.jsxs)(e.msub,{children:[(0,n.jsx)(e.mi,{children:"P"}),(0,n.jsx)(e.mi,{children:"i"})]}),(0,n.jsx)(e.mo,{separator:"true",children:","}),(0,n.jsx)(e.mn,{children:"0"}),(0,n.jsx)(e.mo,{stretchy:"false",children:")"})]}),(0,n.jsx)(e.annotation,{encoding:"application/x-tex",children:"\\text{TVD}=\\sum abs(min(P_i-Q_i,0)) \\ \\text{or} \\ \\text{TVD}=\\sum max(Q_i-P_i,0)"})]})})}),(0,n.jsxs)(e.span,{className:"katex-html","aria-hidden":"true",children:[(0,n.jsxs)(e.span,{className:"base",children:[(0,n.jsx)(e.span,{className:"strut",style:{height:"0.6833em"}}),(0,n.jsx)(e.span,{className:"mord text",children:(0,n.jsx)(e.span,{className:"mord",children:"TVD"})}),(0,n.jsx)(e.span,{className:"mspace",style:{marginRight:"0.2778em"}}),(0,n.jsx)(e.span,{className:"mrel",children:"="}),(0,n.jsx)(e.span,{className:"mspace",style:{marginRight:"0.2778em"}})]}),(0,n.jsxs)(e.span,{className:"base",children:[(0,n.jsx)(e.span,{className:"strut",style:{height:"1em",verticalAlign:"-0.25em"}}),(0,n.jsx)(e.span,{className:"mop op-symbol small-op",style:{position:"relative",top:"0em"},children:"\u2211"}),(0,n.jsx)(e.span,{className:"mspace",style:{marginRight:"0.1667em"}}),(0,n.jsx)(e.span,{className:"mord mathnormal",children:"ab"}),(0,n.jsx)(e.span,{className:"mord mathnormal",children:"s"}),(0,n.jsx)(e.span,{className:"mopen",children:"("}),(0,n.jsx)(e.span,{className:"mord mathnormal",children:"min"}),(0,n.jsx)(e.span,{className:"mopen",children:"("}),(0,n.jsxs)(e.span,{className:"mord",children:[(0,n.jsx)(e.span,{className:"mord mathnormal",style:{marginRight:"0.13889em"},children:"P"}),(0,n.jsx)(e.span,{className:"msupsub",children:(0,n.jsxs)(e.span,{className:"vlist-t vlist-t2",children:[(0,n.jsxs)(e.span,{className:"vlist-r",children:[(0,n.jsx)(e.span,{className:"vlist",style:{height:"0.3117em"},children:(0,n.jsxs)(e.span,{style:{top:"-2.55em",marginLeft:"-0.1389em",marginRight:"0.05em"},children:[(0,n.jsx)(e.span,{className:"pstrut",style:{height:"2.7em"}}),(0,n.jsx)(e.span,{className:"sizing reset-size6 size3 mtight",children:(0,n.jsx)(e.span,{className:"mord mathnormal mtight",children:"i"})})]})}),(0,n.jsx)(e.span,{className:"vlist-s",children:"\u200b"})]}),(0,n.jsx)(e.span,{className:"vlist-r",children:(0,n.jsx)(e.span,{className:"vlist",style:{height:"0.15em"},children:(0,n.jsx)(e.span,{})})})]})})]}),(0,n.jsx)(e.span,{className:"mspace",style:{marginRight:"0.2222em"}}),(0,n.jsx)(e.span,{className:"mbin",children:"\u2212"}),(0,n.jsx)(e.span,{className:"mspace",style:{marginRight:"0.2222em"}})]}),(0,n.jsxs)(e.span,{className:"base",children:[(0,n.jsx)(e.span,{className:"strut",style:{height:"1em",verticalAlign:"-0.25em"}}),(0,n.jsxs)(e.span,{className:"mord",children:[(0,n.jsx)(e.span,{className:"mord mathnormal",children:"Q"}),(0,n.jsx)(e.span,{className:"msupsub",children:(0,n.jsxs)(e.span,{className:"vlist-t vlist-t2",children:[(0,n.jsxs)(e.span,{className:"vlist-r",children:[(0,n.jsx)(e.span,{className:"vlist",style:{height:"0.3117em"},children:(0,n.jsxs)(e.span,{style:{top:"-2.55em",marginLeft:"0em",marginRight:"0.05em"},children:[(0,n.jsx)(e.span,{className:"pstrut",style:{height:"2.7em"}}),(0,n.jsx)(e.span,{className:"sizing reset-size6 size3 mtight",children:(0,n.jsx)(e.span,{className:"mord mathnormal mtight",children:"i"})})]})}),(0,n.jsx)(e.span,{className:"vlist-s",children:"\u200b"})]}),(0,n.jsx)(e.span,{className:"vlist-r",children:(0,n.jsx)(e.span,{className:"vlist",style:{height:"0.15em"},children:(0,n.jsx)(e.span,{})})})]})})]}),(0,n.jsx)(e.span,{className:"mpunct",children:","}),(0,n.jsx)(e.span,{className:"mspace",style:{marginRight:"0.1667em"}}),(0,n.jsx)(e.span,{className:"mord",children:"0"}),(0,n.jsx)(e.span,{className:"mclose",children:"))"}),(0,n.jsx)(e.span,{className:"mspace",children:"\xa0"}),(0,n.jsx)(e.span,{className:"mord text",children:(0,n.jsx)(e.span,{className:"mord",children:"or"})}),(0,n.jsx)(e.span,{className:"mspace",children:"\xa0"}),(0,n.jsx)(e.span,{className:"mord text",children:(0,n.jsx)(e.span,{className:"mord",children:"TVD"})}),(0,n.jsx)(e.span,{className:"mspace",style:{marginRight:"0.2778em"}}),(0,n.jsx)(e.span,{className:"mrel",children:"="}),(0,n.jsx)(e.span,{className:"mspace",style:{marginRight:"0.2778em"}})]}),(0,n.jsxs)(e.span,{className:"base",children:[(0,n.jsx)(e.span,{className:"strut",style:{height:"1em",verticalAlign:"-0.25em"}}),(0,n.jsx)(e.span,{className:"mop op-symbol small-op",style:{position:"relative",top:"0em"},children:"\u2211"}),(0,n.jsx)(e.span,{className:"mspace",style:{marginRight:"0.1667em"}}),(0,n.jsx)(e.span,{className:"mord mathnormal",children:"ma"}),(0,n.jsx)(e.span,{className:"mord mathnormal",children:"x"}),(0,n.jsx)(e.span,{className:"mopen",children:"("}),(0,n.jsxs)(e.span,{className:"mord",children:[(0,n.jsx)(e.span,{className:"mord mathnormal",children:"Q"}),(0,n.jsx)(e.span,{className:"msupsub",children:(0,n.jsxs)(e.span,{className:"vlist-t vlist-t2",children:[(0,n.jsxs)(e.span,{className:"vlist-r",children:[(0,n.jsx)(e.span,{className:"vlist",style:{height:"0.3117em"},children:(0,n.jsxs)(e.span,{style:{top:"-2.55em",marginLeft:"0em",marginRight:"0.05em"},children:[(0,n.jsx)(e.span,{className:"pstrut",style:{height:"2.7em"}}),(0,n.jsx)(e.span,{className:"sizing reset-size6 size3 mtight",children:(0,n.jsx)(e.span,{className:"mord mathnormal mtight",children:"i"})})]})}),(0,n.jsx)(e.span,{className:"vlist-s",children:"\u200b"})]}),(0,n.jsx)(e.span,{className:"vlist-r",children:(0,n.jsx)(e.span,{className:"vlist",style:{height:"0.15em"},children:(0,n.jsx)(e.span,{})})})]})})]}),(0,n.jsx)(e.span,{className:"mspace",style:{marginRight:"0.2222em"}}),(0,n.jsx)(e.span,{className:"mbin",children:"\u2212"}),(0,n.jsx)(e.span,{className:"mspace",style:{marginRight:"0.2222em"}})]}),(0,n.jsxs)(e.span,{className:"base",children:[(0,n.jsx)(e.span,{className:"strut",style:{height:"1em",verticalAlign:"-0.25em"}}),(0,n.jsxs)(e.span,{className:"mord",children:[(0,n.jsx)(e.span,{className:"mord mathnormal",style:{marginRight:"0.13889em"},children:"P"}),(0,n.jsx)(e.span,{className:"msupsub",children:(0,n.jsxs)(e.span,{className:"vlist-t vlist-t2",children:[(0,n.jsxs)(e.span,{className:"vlist-r",children:[(0,n.jsx)(e.span,{className:"vlist",style:{height:"0.3117em"},children:(0,n.jsxs)(e.span,{style:{top:"-2.55em",marginLeft:"-0.1389em",marginRight:"0.05em"},children:[(0,n.jsx)(e.span,{className:"pstrut",style:{height:"2.7em"}}),(0,n.jsx)(e.span,{className:"sizing reset-size6 size3 mtight",children:(0,n.jsx)(e.span,{className:"mord mathnormal mtight",children:"i"})})]})}),(0,n.jsx)(e.span,{className:"vlist-s",children:"\u200b"})]}),(0,n.jsx)(e.span,{className:"vlist-r",children:(0,n.jsx)(e.span,{className:"vlist",style:{height:"0.15em"},children:(0,n.jsx)(e.span,{})})})]})})]}),(0,n.jsx)(e.span,{className:"mpunct",children:","}),(0,n.jsx)(e.span,{className:"mspace",style:{marginRight:"0.1667em"}}),(0,n.jsx)(e.span,{className:"mord",children:"0"}),(0,n.jsx)(e.span,{className:"mclose",children:")"})]})]})]})]}),"\n"]}),(0,n.jsx)(e.p,{children:"to do: replace formula with example DataFrame visualization"})]})]})}function d(s={}){const{wrapper:e}={...(0,i.R)(),...s.components};return e?(0,n.jsx)(e,{...s,children:(0,n.jsx)(h,{...s})}):h(s)}},8597:(s,e,a)=>{a.d(e,{A:()=>i});a(6540);var n=a(4848);const i=s=>{let{data:e}=s,a=[],i=[],t="",l=[];if(e){const s=JSON.parse(e);a=s.columns||[],i=s.data||[],t=s.indexName||"Index",l=s.index||[]}return(0,n.jsx)("div",{className:"dataframe-container",children:(0,n.jsxs)("table",{className:"dataframe-table",children:[(0,n.jsx)("thead",{children:(0,n.jsxs)("tr",{children:[(0,n.jsx)("th",{children:t}),a.map(((s,e)=>(0,n.jsx)("th",{children:s},e)))]})}),(0,n.jsx)("tbody",{children:i.map(((s,e)=>(0,n.jsxs)("tr",{children:[(0,n.jsx)("td",{className:"index-value",children:l[e]}),s.map(((s,e)=>{return(0,n.jsx)("td",{children:(a=s,"boolean"==typeof a?a.toString().charAt(0).toUpperCase()+a.toString().slice(1):a)},e);var a}))]},e)))})]})})}},5158:(s,e,a)=>{a.d(e,{A:()=>t});var n=a(6540),i=a(4848);const t=function(s){let{src:e,sourceLink:a,aspectRatio:t=16/9}=s;const[l,r]=(0,n.useState)(0),[c,m]=(0,n.useState)(0),h=(0,n.useRef)(null);return(0,n.useEffect)((()=>{const s=()=>{if(h.current){const s=h.current.offsetWidth;m(s/t)}};return s(),window.addEventListener("resize",s),()=>window.removeEventListener("resize",s)}),[t]),(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("div",{ref:h,style:{width:"100%",position:"relative",maxWidth:"100%",backgroundColor:"white"},children:(0,i.jsx)("iframe",{src:e,style:{width:"100%",height:`${c}px`,border:"0",allowFullScreen:!0}},l)}),(0,i.jsx)("div",{style:{display:"flex",justifyContent:"center",margin:"20px 0"},children:(0,i.jsx)("a",{href:a,target:"_blank",rel:"noopener noreferrer",children:"(Source)"})}),(0,i.jsx)("div",{style:{display:"flex",justifyContent:"center",margin:"10px 0"},children:(0,i.jsx)("button",{onClick:()=>{r((s=>s+1))},style:{backgroundColor:"#4CAF50",color:"white",padding:"10px 20px",border:"none",borderRadius:"5px",cursor:"pointer",outline:"none",fontSize:"16px",fontWeight:"bold",boxShadow:"0 4px 8px rgba(0,0,0,0.1)",transition:"background-color 0.3s"},onMouseOver:s=>s.currentTarget.style.backgroundColor="#45a049",onMouseOut:s=>s.currentTarget.style.backgroundColor="#4CAF50",children:"Restart Diagram"})})]})}},8453:(s,e,a)=>{a.d(e,{R:()=>l,x:()=>r});var n=a(6540);const i={},t=n.createContext(i);function l(s){const e=n.useContext(t);return n.useMemo((function(){return"function"==typeof s?s(e):{...e,...s}}),[e,s])}function r(s){let e;return e=s.disableParentContext?"function"==typeof s.components?s.components(i):s.components||i:l(s.components),n.createElement(t.Provider,{value:e},s.children)}}}]); \ No newline at end of file diff --git a/assets/js/60c4aef6.f5ab945a.js b/assets/js/60c4aef6.f5ab945a.js new file mode 100644 index 00000000..b40c15e6 --- /dev/null +++ b/assets/js/60c4aef6.f5ab945a.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkbpd_reference=self.webpackChunkbpd_reference||[]).push([[6142],{3071:(s,e,a)=>{a.r(e),a.d(e,{assets:()=>m,contentTitle:()=>r,default:()=>x,frontMatter:()=>t,metadata:()=>c,toc:()=>h});var n=a(4848),l=a(8453),i=a(8597);a(5158);const t={sidebar_position:5,sidebar_label:"Observed & Test Statistic",title:"Observed & Test Statistic"},r=void 0,c={id:"statistical-inference/obs_and_test_stats",title:"Observed & Test Statistic",description:"Concept",source:"@site/docs/statistical-inference/obs_and_test_stats.md",sourceDirName:"statistical-inference",slug:"/statistical-inference/obs_and_test_stats",permalink:"/bpd-reference/docs/statistical-inference/obs_and_test_stats",draft:!1,unlisted:!1,editUrl:"https://github.com/dsc-courses/bpd-reference/tree/main/docs/statistical-inference/obs_and_test_stats.md",tags:[],version:"current",sidebarPosition:5,frontMatter:{sidebar_position:5,sidebar_label:"Observed & Test Statistic",title:"Observed & Test Statistic"},sidebar:"statsSidebar",previous:{title:"Null & Alternative Hypothesis",permalink:"/bpd-reference/docs/statistical-inference/null_and_alt"},next:{title:"P-value",permalink:"/bpd-reference/docs/statistical-inference/p_value"}},m={},h=[{value:"Concept",id:"concept",level:2},{value:"Common Test Statistics \ud83c\udf1f",id:"common-test-statistics-",level:2},{value:"1. Absolute Difference",id:"1-absolute-difference",level:3},{value:"2. Difference",id:"2-difference",level:3},{value:"3. Total Variation Distance (TVD)",id:"3-total-variation-distance-tvd",level:3}];function d(s){const e={a:"a",admonition:"admonition",annotation:"annotation",br:"br",code:"code",em:"em",h2:"h2",h3:"h3",li:"li",math:"math",mfrac:"mfrac",mi:"mi",mn:"mn",mo:"mo",mrow:"mrow",mstyle:"mstyle",msub:"msub",mtable:"mtable",mtd:"mtd",mtext:"mtext",mtr:"mtr",ol:"ol",p:"p",pre:"pre",semantics:"semantics",span:"span",strong:"strong",ul:"ul",...(0,l.R)(),...s.components};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(e.h2,{id:"concept",children:"Concept"}),"\n",(0,n.jsxs)(e.admonition,{title:"Terminology",type:"info",children:[(0,n.jsxs)(e.p,{children:[(0,n.jsx)(e.strong,{children:"Experiment"}),": A process whose outcome is random."]}),(0,n.jsxs)(e.ul,{children:["\n",(0,n.jsx)(e.li,{children:"Example: Flipping 100 coins."}),"\n"]}),(0,n.jsxs)(e.p,{children:[(0,n.jsx)(e.strong,{children:"Observed Statistic"}),": A statistic computed from the observed data."]}),(0,n.jsxs)(e.ul,{children:["\n",(0,n.jsx)(e.li,{children:"Example: The number of heads observed."}),"\n"]}),(0,n.jsxs)(e.p,{children:[(0,n.jsx)(e.strong,{children:"Test Statistic"}),": A statistic computed from a sample generated under the assumption that the null hypothesis is true."]}),(0,n.jsxs)(e.ul,{children:["\n",(0,n.jsx)(e.li,{children:"Think of the test statistic a number you write down each time you perform an experiment."}),"\n",(0,n.jsx)(e.li,{children:"The test statistic should be such that high observed values lean towards one hypothesis and low observed values lean towards the other."}),"\n"]})]}),"\n",(0,n.jsx)(e.h2,{id:"common-test-statistics-",children:"Common Test Statistics \ud83c\udf1f"}),"\n",(0,n.jsx)(e.h3,{id:"1-absolute-difference",children:"1. Absolute Difference"}),"\n",(0,n.jsx)(e.p,{children:"Absolute difference in group mean/median/number of times a certain event happens."}),"\n",(0,n.jsxs)(e.ul,{children:["\n",(0,n.jsxs)(e.li,{children:["\u2705 Used for measuring how different two ",(0,n.jsx)(e.strong,{children:"numerical distributions"})," are, and when the alternative hypothesis is ",(0,n.jsx)(e.strong,{children:(0,n.jsx)(e.em,{children:"not equal to"})}),'. For example, "the coin is biased" or "the probability of tossing a head is 0.5".']}),"\n",(0,n.jsxs)(e.li,{children:["\ud83d\udcbb ",(0,n.jsx)(e.a,{href:"https://dsc-courses.github.io/bpd-reference/docs/statistical-inference/permutation_test#code-example-absolute-difference",children:"Example"})," of using absolute difference as the test statistic in a permutation test."]}),"\n"]}),"\n",(0,n.jsx)(e.h3,{id:"2-difference",children:"2. Difference"}),"\n",(0,n.jsx)(e.p,{children:"Difference in group mean/median/number of times a certain event happens."}),"\n",(0,n.jsxs)(e.ul,{children:["\n",(0,n.jsxs)(e.li,{children:["\u2705 Used for measuring how different two ",(0,n.jsx)(e.strong,{children:"numerical distributions"})," are, and the alternative hypothesis is ",(0,n.jsx)(e.strong,{children:(0,n.jsx)(e.em,{children:"less than"})})," or ",(0,n.jsx)(e.strong,{children:(0,n.jsx)(e.em,{children:"greater than"})}),'. For example, "the coin is biased towards heads" or "the probability of tossing a head is greater then 0.5".']}),"\n",(0,n.jsxs)(e.li,{children:["\ud83d\udcbb ",(0,n.jsx)(e.a,{href:"https://dsc-courses.github.io/bpd-reference/docs/statistical-inference/hypothesis_test#code-example-1-difference",children:"Example"})," of using difference as the test statistic in a hypothesis test."]}),"\n"]}),"\n",(0,n.jsx)(e.h3,{id:"3-total-variation-distance-tvd",children:"3. Total Variation Distance (TVD)"}),"\n",(0,n.jsxs)(e.p,{children:["A test statistic that quantifies how different ",(0,n.jsx)(e.strong,{children:"two categorical distributions"})," are by calculating the sum of the absolute differences of their proportions, all divided by 2."]}),"\n",(0,n.jsxs)(e.ul,{children:["\n",(0,n.jsx)(e.li,{children:"\u274c\ufe0f The TVD is not used for permutation tests."}),"\n",(0,n.jsxs)(e.li,{children:['\u2705 Used for assessing whether an "observed sample" was drawn randomly from a known ',(0,n.jsx)(e.strong,{children:"categorical distribution"}),"."]}),"\n",(0,n.jsxs)(e.li,{children:["\ud83d\udcbb ",(0,n.jsx)(e.a,{href:"https://dsc-courses.github.io/bpd-reference/docs/statistical-inference/hypothesis_test/#code-example-2-tvd",children:"Example"})," of using TVD as the test statistic in a hypothesis test."]}),"\n"]}),"\n",(0,n.jsx)(e.pre,{children:(0,n.jsx)(e.code,{className:"language-python",children:"#code implementation\ndef tvd(dist1, dist2):\n '''Computes the TVD between two categorical distributions, \n assuming the categories appear in the same order.'''\n return np.abs(dist1 - dist2).sum() / 2\n"})}),"\n",(0,n.jsxs)(e.admonition,{type:"note",children:[(0,n.jsxs)(e.p,{children:[(0,n.jsx)(e.strong,{children:"3 Ways of Manually Computing TVD:"})," \ud83e\uddee"]}),(0,n.jsx)(e.p,{children:"Let's use an example to show how TVD can be computed in three ways."}),(0,n.jsxs)(e.p,{children:["In the ",(0,n.jsx)(e.code,{children:"full_pets"})," DataFrame, we found that the color distribution of dogs seems different from that of all pets."]}),(0,n.jsx)(i.A,{data:'{"columns":["Pets_Dist","Dogs_Dist"],"index":["black","golden","white"],"data":[[0.53,0.44],[0.21,0.12],[0.26,0.44]]}'}),(0,n.jsx)(e.p,{children:(0,n.jsxs)(e.em,{children:["Assume ",(0,n.jsxs)(e.span,{className:"katex",children:[(0,n.jsx)(e.span,{className:"katex-mathml",children:(0,n.jsx)(e.math,{xmlns:"http://www.w3.org/1998/Math/MathML",children:(0,n.jsxs)(e.semantics,{children:[(0,n.jsx)(e.mrow,{children:(0,n.jsx)(e.mi,{children:"P"})}),(0,n.jsx)(e.annotation,{encoding:"application/x-tex",children:"P"})]})})}),(0,n.jsx)(e.span,{className:"katex-html","aria-hidden":"true",children:(0,n.jsxs)(e.span,{className:"base",children:[(0,n.jsx)(e.span,{className:"strut",style:{height:"0.6833em"}}),(0,n.jsx)(e.span,{className:"mord mathnormal",style:{marginRight:"0.13889em"},children:"P"})]})})]})," is one distribution and ",(0,n.jsxs)(e.span,{className:"katex",children:[(0,n.jsx)(e.span,{className:"katex-mathml",children:(0,n.jsx)(e.math,{xmlns:"http://www.w3.org/1998/Math/MathML",children:(0,n.jsxs)(e.semantics,{children:[(0,n.jsx)(e.mrow,{children:(0,n.jsx)(e.mi,{children:"Q"})}),(0,n.jsx)(e.annotation,{encoding:"application/x-tex",children:"Q"})]})})}),(0,n.jsx)(e.span,{className:"katex-html","aria-hidden":"true",children:(0,n.jsxs)(e.span,{className:"base",children:[(0,n.jsx)(e.span,{className:"strut",style:{height:"0.8778em",verticalAlign:"-0.1944em"}}),(0,n.jsx)(e.span,{className:"mord mathnormal",children:"Q"})]})})]})," is the other, and the categories appear in the same order."]})}),(0,n.jsxs)(e.ol,{children:["\n",(0,n.jsxs)(e.li,{children:["\n",(0,n.jsxs)(e.p,{children:[(0,n.jsx)(e.strong,{children:"Follow the definition:"})," Calculate the sum of the absolute differences of the proportions of the two distributions (P and Q), all divided by 2."]}),"\n",(0,n.jsx)(e.span,{className:"katex-display",children:(0,n.jsxs)(e.span,{className:"katex",children:[(0,n.jsx)(e.span,{className:"katex-mathml",children:(0,n.jsx)(e.math,{xmlns:"http://www.w3.org/1998/Math/MathML",display:"block",children:(0,n.jsxs)(e.semantics,{children:[(0,n.jsxs)(e.mtable,{rowspacing:"0.25em",columnalign:"right left",columnspacing:"0em",children:[(0,n.jsxs)(e.mtr,{children:[(0,n.jsx)(e.mtd,{children:(0,n.jsx)(e.mstyle,{scriptlevel:"0",displaystyle:"true",children:(0,n.jsx)(e.mtext,{children:"TVD"})})}),(0,n.jsx)(e.mtd,{children:(0,n.jsx)(e.mstyle,{scriptlevel:"0",displaystyle:"true",children:(0,n.jsxs)(e.mrow,{children:[(0,n.jsx)(e.mrow,{}),(0,n.jsx)(e.mo,{children:"="}),(0,n.jsxs)(e.mfrac,{children:[(0,n.jsx)(e.mn,{children:"1"}),(0,n.jsx)(e.mn,{children:"2"})]}),(0,n.jsx)(e.mo,{stretchy:"false",children:"("}),(0,n.jsx)(e.mi,{mathvariant:"normal",children:"\u2223"}),(0,n.jsx)(e.mn,{children:"0.53"}),(0,n.jsx)(e.mo,{children:"\u2212"}),(0,n.jsx)(e.mn,{children:"0.44"}),(0,n.jsx)(e.mi,{mathvariant:"normal",children:"\u2223"}),(0,n.jsx)(e.mo,{children:"+"}),(0,n.jsx)(e.mi,{mathvariant:"normal",children:"\u2223"}),(0,n.jsx)(e.mn,{children:"0.21"}),(0,n.jsx)(e.mo,{children:"\u2212"}),(0,n.jsx)(e.mn,{children:"0.12"}),(0,n.jsx)(e.mi,{mathvariant:"normal",children:"\u2223"}),(0,n.jsx)(e.mo,{children:"+"}),(0,n.jsx)(e.mi,{mathvariant:"normal",children:"\u2223"}),(0,n.jsx)(e.mn,{children:"0.26"}),(0,n.jsx)(e.mo,{children:"\u2212"}),(0,n.jsx)(e.mn,{children:"0.44"}),(0,n.jsx)(e.mi,{mathvariant:"normal",children:"\u2223"}),(0,n.jsx)(e.mo,{stretchy:"false",children:")"})]})})})]}),(0,n.jsxs)(e.mtr,{children:[(0,n.jsx)(e.mtd,{children:(0,n.jsx)(e.mstyle,{scriptlevel:"0",displaystyle:"true",children:(0,n.jsx)(e.mrow,{})})}),(0,n.jsx)(e.mtd,{children:(0,n.jsx)(e.mstyle,{scriptlevel:"0",displaystyle:"true",children:(0,n.jsxs)(e.mrow,{children:[(0,n.jsx)(e.mrow,{}),(0,n.jsx)(e.mo,{children:"="}),(0,n.jsxs)(e.mfrac,{children:[(0,n.jsx)(e.mn,{children:"1"}),(0,n.jsx)(e.mn,{children:"2"})]}),(0,n.jsx)(e.mo,{stretchy:"false",children:"("}),(0,n.jsx)(e.mn,{children:"0.09"}),(0,n.jsx)(e.mo,{children:"+"}),(0,n.jsx)(e.mn,{children:"0.09"}),(0,n.jsx)(e.mo,{children:"+"}),(0,n.jsx)(e.mn,{children:"0.18"}),(0,n.jsx)(e.mo,{stretchy:"false",children:")"})]})})})]}),(0,n.jsxs)(e.mtr,{children:[(0,n.jsx)(e.mtd,{children:(0,n.jsx)(e.mstyle,{scriptlevel:"0",displaystyle:"true",children:(0,n.jsx)(e.mrow,{})})}),(0,n.jsx)(e.mtd,{children:(0,n.jsx)(e.mstyle,{scriptlevel:"0",displaystyle:"true",children:(0,n.jsxs)(e.mrow,{children:[(0,n.jsx)(e.mrow,{}),(0,n.jsx)(e.mo,{children:"="}),(0,n.jsx)(e.mn,{children:"0.18"})]})})})]})]}),(0,n.jsx)(e.annotation,{encoding:"application/x-tex",children:"\\begin{align*} \n\\text{TVD}\n&= \\frac{1}{2}(|0.53-0.44|+|0.21-0.12|+|0.26-0.44|) \\\\\n&= \\frac{1}{2}(0.09+0.09+0.18) \\\\\n&= 0.18\n\\end{align*} "})]})})}),(0,n.jsx)(e.span,{className:"katex-html","aria-hidden":"true",children:(0,n.jsxs)(e.span,{className:"base",children:[(0,n.jsx)(e.span,{className:"strut",style:{height:"6.1149em",verticalAlign:"-2.8074em"}}),(0,n.jsx)(e.span,{className:"mord",children:(0,n.jsxs)(e.span,{className:"mtable",children:[(0,n.jsx)(e.span,{className:"col-align-r",children:(0,n.jsxs)(e.span,{className:"vlist-t vlist-t2",children:[(0,n.jsxs)(e.span,{className:"vlist-r",children:[(0,n.jsxs)(e.span,{className:"vlist",style:{height:"3.3074em"},children:[(0,n.jsxs)(e.span,{style:{top:"-5.3074em"},children:[(0,n.jsx)(e.span,{className:"pstrut",style:{height:"3.3214em"}}),(0,n.jsx)(e.span,{className:"mord",children:(0,n.jsx)(e.span,{className:"mord text",children:(0,n.jsx)(e.span,{className:"mord",children:"TVD"})})})]}),(0,n.jsxs)(e.span,{style:{top:"-3em"},children:[(0,n.jsx)(e.span,{className:"pstrut",style:{height:"3.3214em"}}),(0,n.jsx)(e.span,{className:"mord"})]}),(0,n.jsxs)(e.span,{style:{top:"-1.174em"},children:[(0,n.jsx)(e.span,{className:"pstrut",style:{height:"3.3214em"}}),(0,n.jsx)(e.span,{className:"mord"})]})]}),(0,n.jsx)(e.span,{className:"vlist-s",children:"\u200b"})]}),(0,n.jsx)(e.span,{className:"vlist-r",children:(0,n.jsx)(e.span,{className:"vlist",style:{height:"2.8074em"},children:(0,n.jsx)(e.span,{})})})]})}),(0,n.jsx)(e.span,{className:"col-align-l",children:(0,n.jsxs)(e.span,{className:"vlist-t vlist-t2",children:[(0,n.jsxs)(e.span,{className:"vlist-r",children:[(0,n.jsxs)(e.span,{className:"vlist",style:{height:"3.3074em"},children:[(0,n.jsxs)(e.span,{style:{top:"-5.3074em"},children:[(0,n.jsx)(e.span,{className:"pstrut",style:{height:"3.3214em"}}),(0,n.jsxs)(e.span,{className:"mord",children:[(0,n.jsx)(e.span,{className:"mord"}),(0,n.jsx)(e.span,{className:"mspace",style:{marginRight:"0.2778em"}}),(0,n.jsx)(e.span,{className:"mrel",children:"="}),(0,n.jsx)(e.span,{className:"mspace",style:{marginRight:"0.2778em"}}),(0,n.jsxs)(e.span,{className:"mord",children:[(0,n.jsx)(e.span,{className:"mopen nulldelimiter"}),(0,n.jsx)(e.span,{className:"mfrac",children:(0,n.jsxs)(e.span,{className:"vlist-t vlist-t2",children:[(0,n.jsxs)(e.span,{className:"vlist-r",children:[(0,n.jsxs)(e.span,{className:"vlist",style:{height:"1.3214em"},children:[(0,n.jsxs)(e.span,{style:{top:"-2.314em"},children:[(0,n.jsx)(e.span,{className:"pstrut",style:{height:"3em"}}),(0,n.jsx)(e.span,{className:"mord",children:(0,n.jsx)(e.span,{className:"mord",children:"2"})})]}),(0,n.jsxs)(e.span,{style:{top:"-3.23em"},children:[(0,n.jsx)(e.span,{className:"pstrut",style:{height:"3em"}}),(0,n.jsx)(e.span,{className:"frac-line",style:{borderBottomWidth:"0.04em"}})]}),(0,n.jsxs)(e.span,{style:{top:"-3.677em"},children:[(0,n.jsx)(e.span,{className:"pstrut",style:{height:"3em"}}),(0,n.jsx)(e.span,{className:"mord",children:(0,n.jsx)(e.span,{className:"mord",children:"1"})})]})]}),(0,n.jsx)(e.span,{className:"vlist-s",children:"\u200b"})]}),(0,n.jsx)(e.span,{className:"vlist-r",children:(0,n.jsx)(e.span,{className:"vlist",style:{height:"0.686em"},children:(0,n.jsx)(e.span,{})})})]})}),(0,n.jsx)(e.span,{className:"mclose nulldelimiter"})]}),(0,n.jsx)(e.span,{className:"mopen",children:"("}),(0,n.jsx)(e.span,{className:"mord",children:"\u22230.53"}),(0,n.jsx)(e.span,{className:"mspace",style:{marginRight:"0.2222em"}}),(0,n.jsx)(e.span,{className:"mbin",children:"\u2212"}),(0,n.jsx)(e.span,{className:"mspace",style:{marginRight:"0.2222em"}}),(0,n.jsx)(e.span,{className:"mord",children:"0.44\u2223"}),(0,n.jsx)(e.span,{className:"mspace",style:{marginRight:"0.2222em"}}),(0,n.jsx)(e.span,{className:"mbin",children:"+"}),(0,n.jsx)(e.span,{className:"mspace",style:{marginRight:"0.2222em"}}),(0,n.jsx)(e.span,{className:"mord",children:"\u22230.21"}),(0,n.jsx)(e.span,{className:"mspace",style:{marginRight:"0.2222em"}}),(0,n.jsx)(e.span,{className:"mbin",children:"\u2212"}),(0,n.jsx)(e.span,{className:"mspace",style:{marginRight:"0.2222em"}}),(0,n.jsx)(e.span,{className:"mord",children:"0.12\u2223"}),(0,n.jsx)(e.span,{className:"mspace",style:{marginRight:"0.2222em"}}),(0,n.jsx)(e.span,{className:"mbin",children:"+"}),(0,n.jsx)(e.span,{className:"mspace",style:{marginRight:"0.2222em"}}),(0,n.jsx)(e.span,{className:"mord",children:"\u22230.26"}),(0,n.jsx)(e.span,{className:"mspace",style:{marginRight:"0.2222em"}}),(0,n.jsx)(e.span,{className:"mbin",children:"\u2212"}),(0,n.jsx)(e.span,{className:"mspace",style:{marginRight:"0.2222em"}}),(0,n.jsx)(e.span,{className:"mord",children:"0.44\u2223"}),(0,n.jsx)(e.span,{className:"mclose",children:")"})]})]}),(0,n.jsxs)(e.span,{style:{top:"-3em"},children:[(0,n.jsx)(e.span,{className:"pstrut",style:{height:"3.3214em"}}),(0,n.jsxs)(e.span,{className:"mord",children:[(0,n.jsx)(e.span,{className:"mord"}),(0,n.jsx)(e.span,{className:"mspace",style:{marginRight:"0.2778em"}}),(0,n.jsx)(e.span,{className:"mrel",children:"="}),(0,n.jsx)(e.span,{className:"mspace",style:{marginRight:"0.2778em"}}),(0,n.jsxs)(e.span,{className:"mord",children:[(0,n.jsx)(e.span,{className:"mopen nulldelimiter"}),(0,n.jsx)(e.span,{className:"mfrac",children:(0,n.jsxs)(e.span,{className:"vlist-t vlist-t2",children:[(0,n.jsxs)(e.span,{className:"vlist-r",children:[(0,n.jsxs)(e.span,{className:"vlist",style:{height:"1.3214em"},children:[(0,n.jsxs)(e.span,{style:{top:"-2.314em"},children:[(0,n.jsx)(e.span,{className:"pstrut",style:{height:"3em"}}),(0,n.jsx)(e.span,{className:"mord",children:(0,n.jsx)(e.span,{className:"mord",children:"2"})})]}),(0,n.jsxs)(e.span,{style:{top:"-3.23em"},children:[(0,n.jsx)(e.span,{className:"pstrut",style:{height:"3em"}}),(0,n.jsx)(e.span,{className:"frac-line",style:{borderBottomWidth:"0.04em"}})]}),(0,n.jsxs)(e.span,{style:{top:"-3.677em"},children:[(0,n.jsx)(e.span,{className:"pstrut",style:{height:"3em"}}),(0,n.jsx)(e.span,{className:"mord",children:(0,n.jsx)(e.span,{className:"mord",children:"1"})})]})]}),(0,n.jsx)(e.span,{className:"vlist-s",children:"\u200b"})]}),(0,n.jsx)(e.span,{className:"vlist-r",children:(0,n.jsx)(e.span,{className:"vlist",style:{height:"0.686em"},children:(0,n.jsx)(e.span,{})})})]})}),(0,n.jsx)(e.span,{className:"mclose nulldelimiter"})]}),(0,n.jsx)(e.span,{className:"mopen",children:"("}),(0,n.jsx)(e.span,{className:"mord",children:"0.09"}),(0,n.jsx)(e.span,{className:"mspace",style:{marginRight:"0.2222em"}}),(0,n.jsx)(e.span,{className:"mbin",children:"+"}),(0,n.jsx)(e.span,{className:"mspace",style:{marginRight:"0.2222em"}}),(0,n.jsx)(e.span,{className:"mord",children:"0.09"}),(0,n.jsx)(e.span,{className:"mspace",style:{marginRight:"0.2222em"}}),(0,n.jsx)(e.span,{className:"mbin",children:"+"}),(0,n.jsx)(e.span,{className:"mspace",style:{marginRight:"0.2222em"}}),(0,n.jsx)(e.span,{className:"mord",children:"0.18"}),(0,n.jsx)(e.span,{className:"mclose",children:")"})]})]}),(0,n.jsxs)(e.span,{style:{top:"-1.174em"},children:[(0,n.jsx)(e.span,{className:"pstrut",style:{height:"3.3214em"}}),(0,n.jsxs)(e.span,{className:"mord",children:[(0,n.jsx)(e.span,{className:"mord"}),(0,n.jsx)(e.span,{className:"mspace",style:{marginRight:"0.2778em"}}),(0,n.jsx)(e.span,{className:"mrel",children:"="}),(0,n.jsx)(e.span,{className:"mspace",style:{marginRight:"0.2778em"}}),(0,n.jsx)(e.span,{className:"mord",children:"0.18"})]})]})]}),(0,n.jsx)(e.span,{className:"vlist-s",children:"\u200b"})]}),(0,n.jsx)(e.span,{className:"vlist-r",children:(0,n.jsx)(e.span,{className:"vlist",style:{height:"2.8074em"},children:(0,n.jsx)(e.span,{})})})]})})]})})]})})]})}),"\n"]}),"\n",(0,n.jsxs)(e.li,{children:["\n",(0,n.jsxs)(e.p,{children:[(0,n.jsx)(e.strong,{children:"Sum of positive differences:"})," Add only the values where one distribution (e.g. P_i) is greater than the other (e.g. Q_i) . This essentially sums the excessive probabilities in one distribution over the other. ",(0,n.jsx)(e.br,{}),"\n",(0,n.jsxs)(e.span,{className:"katex",children:[(0,n.jsx)(e.span,{className:"katex-mathml",children:(0,n.jsx)(e.math,{xmlns:"http://www.w3.org/1998/Math/MathML",children:(0,n.jsxs)(e.semantics,{children:[(0,n.jsxs)(e.mrow,{children:[(0,n.jsx)(e.mtext,{children:"TVD"}),(0,n.jsx)(e.mo,{children:"="}),(0,n.jsx)(e.mo,{children:"\u2211"}),(0,n.jsx)(e.mi,{children:"m"}),(0,n.jsx)(e.mi,{children:"a"}),(0,n.jsx)(e.mi,{children:"x"}),(0,n.jsx)(e.mo,{stretchy:"false",children:"("}),(0,n.jsxs)(e.msub,{children:[(0,n.jsx)(e.mi,{children:"P"}),(0,n.jsx)(e.mi,{children:"i"})]}),(0,n.jsx)(e.mo,{children:"\u2212"}),(0,n.jsxs)(e.msub,{children:[(0,n.jsx)(e.mi,{children:"Q"}),(0,n.jsx)(e.mi,{children:"i"})]}),(0,n.jsx)(e.mo,{separator:"true",children:","}),(0,n.jsx)(e.mn,{children:"0"}),(0,n.jsx)(e.mo,{stretchy:"false",children:")"})]}),(0,n.jsx)(e.annotation,{encoding:"application/x-tex",children:"\\text{TVD}=\\sum max(P_i-Q_i,0)"})]})})}),(0,n.jsxs)(e.span,{className:"katex-html","aria-hidden":"true",children:[(0,n.jsxs)(e.span,{className:"base",children:[(0,n.jsx)(e.span,{className:"strut",style:{height:"0.6833em"}}),(0,n.jsx)(e.span,{className:"mord text",children:(0,n.jsx)(e.span,{className:"mord",children:"TVD"})}),(0,n.jsx)(e.span,{className:"mspace",style:{marginRight:"0.2778em"}}),(0,n.jsx)(e.span,{className:"mrel",children:"="}),(0,n.jsx)(e.span,{className:"mspace",style:{marginRight:"0.2778em"}})]}),(0,n.jsxs)(e.span,{className:"base",children:[(0,n.jsx)(e.span,{className:"strut",style:{height:"1em",verticalAlign:"-0.25em"}}),(0,n.jsx)(e.span,{className:"mop op-symbol small-op",style:{position:"relative",top:"0em"},children:"\u2211"}),(0,n.jsx)(e.span,{className:"mspace",style:{marginRight:"0.1667em"}}),(0,n.jsx)(e.span,{className:"mord mathnormal",children:"ma"}),(0,n.jsx)(e.span,{className:"mord mathnormal",children:"x"}),(0,n.jsx)(e.span,{className:"mopen",children:"("}),(0,n.jsxs)(e.span,{className:"mord",children:[(0,n.jsx)(e.span,{className:"mord mathnormal",style:{marginRight:"0.13889em"},children:"P"}),(0,n.jsx)(e.span,{className:"msupsub",children:(0,n.jsxs)(e.span,{className:"vlist-t vlist-t2",children:[(0,n.jsxs)(e.span,{className:"vlist-r",children:[(0,n.jsx)(e.span,{className:"vlist",style:{height:"0.3117em"},children:(0,n.jsxs)(e.span,{style:{top:"-2.55em",marginLeft:"-0.1389em",marginRight:"0.05em"},children:[(0,n.jsx)(e.span,{className:"pstrut",style:{height:"2.7em"}}),(0,n.jsx)(e.span,{className:"sizing reset-size6 size3 mtight",children:(0,n.jsx)(e.span,{className:"mord mathnormal mtight",children:"i"})})]})}),(0,n.jsx)(e.span,{className:"vlist-s",children:"\u200b"})]}),(0,n.jsx)(e.span,{className:"vlist-r",children:(0,n.jsx)(e.span,{className:"vlist",style:{height:"0.15em"},children:(0,n.jsx)(e.span,{})})})]})})]}),(0,n.jsx)(e.span,{className:"mspace",style:{marginRight:"0.2222em"}}),(0,n.jsx)(e.span,{className:"mbin",children:"\u2212"}),(0,n.jsx)(e.span,{className:"mspace",style:{marginRight:"0.2222em"}})]}),(0,n.jsxs)(e.span,{className:"base",children:[(0,n.jsx)(e.span,{className:"strut",style:{height:"1em",verticalAlign:"-0.25em"}}),(0,n.jsxs)(e.span,{className:"mord",children:[(0,n.jsx)(e.span,{className:"mord mathnormal",children:"Q"}),(0,n.jsx)(e.span,{className:"msupsub",children:(0,n.jsxs)(e.span,{className:"vlist-t vlist-t2",children:[(0,n.jsxs)(e.span,{className:"vlist-r",children:[(0,n.jsx)(e.span,{className:"vlist",style:{height:"0.3117em"},children:(0,n.jsxs)(e.span,{style:{top:"-2.55em",marginLeft:"0em",marginRight:"0.05em"},children:[(0,n.jsx)(e.span,{className:"pstrut",style:{height:"2.7em"}}),(0,n.jsx)(e.span,{className:"sizing reset-size6 size3 mtight",children:(0,n.jsx)(e.span,{className:"mord mathnormal mtight",children:"i"})})]})}),(0,n.jsx)(e.span,{className:"vlist-s",children:"\u200b"})]}),(0,n.jsx)(e.span,{className:"vlist-r",children:(0,n.jsx)(e.span,{className:"vlist",style:{height:"0.15em"},children:(0,n.jsx)(e.span,{})})})]})})]}),(0,n.jsx)(e.span,{className:"mpunct",children:","}),(0,n.jsx)(e.span,{className:"mspace",style:{marginRight:"0.1667em"}}),(0,n.jsx)(e.span,{className:"mord",children:"0"}),(0,n.jsx)(e.span,{className:"mclose",children:")"})]})]})]})]}),"\n"]}),"\n"]}),(0,n.jsx)(e.p,{children:"to do: replace formula with example DataFrame visualization"}),(0,n.jsxs)(e.ol,{start:"3",children:["\n",(0,n.jsxs)(e.li,{children:[(0,n.jsx)(e.strong,{children:"Sum of negative differences:"})," Add only the absolute values where the selected distribution (e.g. P_i) is less than the other (e.g. Q_i). This essentially sums the deficient probabilities in one distribution relative to the other. ",(0,n.jsx)(e.br,{}),"\n",(0,n.jsxs)(e.span,{className:"katex",children:[(0,n.jsx)(e.span,{className:"katex-mathml",children:(0,n.jsx)(e.math,{xmlns:"http://www.w3.org/1998/Math/MathML",children:(0,n.jsxs)(e.semantics,{children:[(0,n.jsxs)(e.mrow,{children:[(0,n.jsx)(e.mtext,{children:"TVD"}),(0,n.jsx)(e.mo,{children:"="}),(0,n.jsx)(e.mo,{children:"\u2211"}),(0,n.jsx)(e.mi,{children:"a"}),(0,n.jsx)(e.mi,{children:"b"}),(0,n.jsx)(e.mi,{children:"s"}),(0,n.jsx)(e.mo,{stretchy:"false",children:"("}),(0,n.jsx)(e.mi,{children:"m"}),(0,n.jsx)(e.mi,{children:"i"}),(0,n.jsx)(e.mi,{children:"n"}),(0,n.jsx)(e.mo,{stretchy:"false",children:"("}),(0,n.jsxs)(e.msub,{children:[(0,n.jsx)(e.mi,{children:"P"}),(0,n.jsx)(e.mi,{children:"i"})]}),(0,n.jsx)(e.mo,{children:"\u2212"}),(0,n.jsxs)(e.msub,{children:[(0,n.jsx)(e.mi,{children:"Q"}),(0,n.jsx)(e.mi,{children:"i"})]}),(0,n.jsx)(e.mo,{separator:"true",children:","}),(0,n.jsx)(e.mn,{children:"0"}),(0,n.jsx)(e.mo,{stretchy:"false",children:")"}),(0,n.jsx)(e.mo,{stretchy:"false",children:")"}),(0,n.jsx)(e.mtext,{children:"\xa0or\xa0TVD"}),(0,n.jsx)(e.mo,{children:"="}),(0,n.jsx)(e.mo,{children:"\u2211"}),(0,n.jsx)(e.mi,{children:"m"}),(0,n.jsx)(e.mi,{children:"a"}),(0,n.jsx)(e.mi,{children:"x"}),(0,n.jsx)(e.mo,{stretchy:"false",children:"("}),(0,n.jsxs)(e.msub,{children:[(0,n.jsx)(e.mi,{children:"Q"}),(0,n.jsx)(e.mi,{children:"i"})]}),(0,n.jsx)(e.mo,{children:"\u2212"}),(0,n.jsxs)(e.msub,{children:[(0,n.jsx)(e.mi,{children:"P"}),(0,n.jsx)(e.mi,{children:"i"})]}),(0,n.jsx)(e.mo,{separator:"true",children:","}),(0,n.jsx)(e.mn,{children:"0"}),(0,n.jsx)(e.mo,{stretchy:"false",children:")"})]}),(0,n.jsx)(e.annotation,{encoding:"application/x-tex",children:"\\text{TVD}=\\sum abs(min(P_i-Q_i,0)) \\ \\text{or} \\ \\text{TVD}=\\sum max(Q_i-P_i,0)"})]})})}),(0,n.jsxs)(e.span,{className:"katex-html","aria-hidden":"true",children:[(0,n.jsxs)(e.span,{className:"base",children:[(0,n.jsx)(e.span,{className:"strut",style:{height:"0.6833em"}}),(0,n.jsx)(e.span,{className:"mord text",children:(0,n.jsx)(e.span,{className:"mord",children:"TVD"})}),(0,n.jsx)(e.span,{className:"mspace",style:{marginRight:"0.2778em"}}),(0,n.jsx)(e.span,{className:"mrel",children:"="}),(0,n.jsx)(e.span,{className:"mspace",style:{marginRight:"0.2778em"}})]}),(0,n.jsxs)(e.span,{className:"base",children:[(0,n.jsx)(e.span,{className:"strut",style:{height:"1em",verticalAlign:"-0.25em"}}),(0,n.jsx)(e.span,{className:"mop op-symbol small-op",style:{position:"relative",top:"0em"},children:"\u2211"}),(0,n.jsx)(e.span,{className:"mspace",style:{marginRight:"0.1667em"}}),(0,n.jsx)(e.span,{className:"mord mathnormal",children:"ab"}),(0,n.jsx)(e.span,{className:"mord mathnormal",children:"s"}),(0,n.jsx)(e.span,{className:"mopen",children:"("}),(0,n.jsx)(e.span,{className:"mord mathnormal",children:"min"}),(0,n.jsx)(e.span,{className:"mopen",children:"("}),(0,n.jsxs)(e.span,{className:"mord",children:[(0,n.jsx)(e.span,{className:"mord mathnormal",style:{marginRight:"0.13889em"},children:"P"}),(0,n.jsx)(e.span,{className:"msupsub",children:(0,n.jsxs)(e.span,{className:"vlist-t vlist-t2",children:[(0,n.jsxs)(e.span,{className:"vlist-r",children:[(0,n.jsx)(e.span,{className:"vlist",style:{height:"0.3117em"},children:(0,n.jsxs)(e.span,{style:{top:"-2.55em",marginLeft:"-0.1389em",marginRight:"0.05em"},children:[(0,n.jsx)(e.span,{className:"pstrut",style:{height:"2.7em"}}),(0,n.jsx)(e.span,{className:"sizing reset-size6 size3 mtight",children:(0,n.jsx)(e.span,{className:"mord mathnormal mtight",children:"i"})})]})}),(0,n.jsx)(e.span,{className:"vlist-s",children:"\u200b"})]}),(0,n.jsx)(e.span,{className:"vlist-r",children:(0,n.jsx)(e.span,{className:"vlist",style:{height:"0.15em"},children:(0,n.jsx)(e.span,{})})})]})})]}),(0,n.jsx)(e.span,{className:"mspace",style:{marginRight:"0.2222em"}}),(0,n.jsx)(e.span,{className:"mbin",children:"\u2212"}),(0,n.jsx)(e.span,{className:"mspace",style:{marginRight:"0.2222em"}})]}),(0,n.jsxs)(e.span,{className:"base",children:[(0,n.jsx)(e.span,{className:"strut",style:{height:"1em",verticalAlign:"-0.25em"}}),(0,n.jsxs)(e.span,{className:"mord",children:[(0,n.jsx)(e.span,{className:"mord mathnormal",children:"Q"}),(0,n.jsx)(e.span,{className:"msupsub",children:(0,n.jsxs)(e.span,{className:"vlist-t vlist-t2",children:[(0,n.jsxs)(e.span,{className:"vlist-r",children:[(0,n.jsx)(e.span,{className:"vlist",style:{height:"0.3117em"},children:(0,n.jsxs)(e.span,{style:{top:"-2.55em",marginLeft:"0em",marginRight:"0.05em"},children:[(0,n.jsx)(e.span,{className:"pstrut",style:{height:"2.7em"}}),(0,n.jsx)(e.span,{className:"sizing reset-size6 size3 mtight",children:(0,n.jsx)(e.span,{className:"mord mathnormal mtight",children:"i"})})]})}),(0,n.jsx)(e.span,{className:"vlist-s",children:"\u200b"})]}),(0,n.jsx)(e.span,{className:"vlist-r",children:(0,n.jsx)(e.span,{className:"vlist",style:{height:"0.15em"},children:(0,n.jsx)(e.span,{})})})]})})]}),(0,n.jsx)(e.span,{className:"mpunct",children:","}),(0,n.jsx)(e.span,{className:"mspace",style:{marginRight:"0.1667em"}}),(0,n.jsx)(e.span,{className:"mord",children:"0"}),(0,n.jsx)(e.span,{className:"mclose",children:"))"}),(0,n.jsx)(e.span,{className:"mspace",children:"\xa0"}),(0,n.jsx)(e.span,{className:"mord text",children:(0,n.jsx)(e.span,{className:"mord",children:"or"})}),(0,n.jsx)(e.span,{className:"mspace",children:"\xa0"}),(0,n.jsx)(e.span,{className:"mord text",children:(0,n.jsx)(e.span,{className:"mord",children:"TVD"})}),(0,n.jsx)(e.span,{className:"mspace",style:{marginRight:"0.2778em"}}),(0,n.jsx)(e.span,{className:"mrel",children:"="}),(0,n.jsx)(e.span,{className:"mspace",style:{marginRight:"0.2778em"}})]}),(0,n.jsxs)(e.span,{className:"base",children:[(0,n.jsx)(e.span,{className:"strut",style:{height:"1em",verticalAlign:"-0.25em"}}),(0,n.jsx)(e.span,{className:"mop op-symbol small-op",style:{position:"relative",top:"0em"},children:"\u2211"}),(0,n.jsx)(e.span,{className:"mspace",style:{marginRight:"0.1667em"}}),(0,n.jsx)(e.span,{className:"mord mathnormal",children:"ma"}),(0,n.jsx)(e.span,{className:"mord mathnormal",children:"x"}),(0,n.jsx)(e.span,{className:"mopen",children:"("}),(0,n.jsxs)(e.span,{className:"mord",children:[(0,n.jsx)(e.span,{className:"mord mathnormal",children:"Q"}),(0,n.jsx)(e.span,{className:"msupsub",children:(0,n.jsxs)(e.span,{className:"vlist-t vlist-t2",children:[(0,n.jsxs)(e.span,{className:"vlist-r",children:[(0,n.jsx)(e.span,{className:"vlist",style:{height:"0.3117em"},children:(0,n.jsxs)(e.span,{style:{top:"-2.55em",marginLeft:"0em",marginRight:"0.05em"},children:[(0,n.jsx)(e.span,{className:"pstrut",style:{height:"2.7em"}}),(0,n.jsx)(e.span,{className:"sizing reset-size6 size3 mtight",children:(0,n.jsx)(e.span,{className:"mord mathnormal mtight",children:"i"})})]})}),(0,n.jsx)(e.span,{className:"vlist-s",children:"\u200b"})]}),(0,n.jsx)(e.span,{className:"vlist-r",children:(0,n.jsx)(e.span,{className:"vlist",style:{height:"0.15em"},children:(0,n.jsx)(e.span,{})})})]})})]}),(0,n.jsx)(e.span,{className:"mspace",style:{marginRight:"0.2222em"}}),(0,n.jsx)(e.span,{className:"mbin",children:"\u2212"}),(0,n.jsx)(e.span,{className:"mspace",style:{marginRight:"0.2222em"}})]}),(0,n.jsxs)(e.span,{className:"base",children:[(0,n.jsx)(e.span,{className:"strut",style:{height:"1em",verticalAlign:"-0.25em"}}),(0,n.jsxs)(e.span,{className:"mord",children:[(0,n.jsx)(e.span,{className:"mord mathnormal",style:{marginRight:"0.13889em"},children:"P"}),(0,n.jsx)(e.span,{className:"msupsub",children:(0,n.jsxs)(e.span,{className:"vlist-t vlist-t2",children:[(0,n.jsxs)(e.span,{className:"vlist-r",children:[(0,n.jsx)(e.span,{className:"vlist",style:{height:"0.3117em"},children:(0,n.jsxs)(e.span,{style:{top:"-2.55em",marginLeft:"-0.1389em",marginRight:"0.05em"},children:[(0,n.jsx)(e.span,{className:"pstrut",style:{height:"2.7em"}}),(0,n.jsx)(e.span,{className:"sizing reset-size6 size3 mtight",children:(0,n.jsx)(e.span,{className:"mord mathnormal mtight",children:"i"})})]})}),(0,n.jsx)(e.span,{className:"vlist-s",children:"\u200b"})]}),(0,n.jsx)(e.span,{className:"vlist-r",children:(0,n.jsx)(e.span,{className:"vlist",style:{height:"0.15em"},children:(0,n.jsx)(e.span,{})})})]})})]}),(0,n.jsx)(e.span,{className:"mpunct",children:","}),(0,n.jsx)(e.span,{className:"mspace",style:{marginRight:"0.1667em"}}),(0,n.jsx)(e.span,{className:"mord",children:"0"}),(0,n.jsx)(e.span,{className:"mclose",children:")"})]})]})]})]}),"\n"]}),(0,n.jsx)(e.p,{children:"to do: replace formula with example DataFrame visualization"})]})]})}function x(s={}){const{wrapper:e}={...(0,l.R)(),...s.components};return e?(0,n.jsx)(e,{...s,children:(0,n.jsx)(d,{...s})}):d(s)}},8597:(s,e,a)=>{a.d(e,{A:()=>l});a(6540);var n=a(4848);const l=s=>{let{data:e}=s,a=[],l=[],i="",t=[];if(e){const s=JSON.parse(e);a=s.columns||[],l=s.data||[],i=s.indexName||"Index",t=s.index||[]}return(0,n.jsx)("div",{className:"dataframe-container",children:(0,n.jsxs)("table",{className:"dataframe-table",children:[(0,n.jsx)("thead",{children:(0,n.jsxs)("tr",{children:[(0,n.jsx)("th",{children:i}),a.map(((s,e)=>(0,n.jsx)("th",{children:s},e)))]})}),(0,n.jsx)("tbody",{children:l.map(((s,e)=>(0,n.jsxs)("tr",{children:[(0,n.jsx)("td",{className:"index-value",children:t[e]}),s.map(((s,e)=>{return(0,n.jsx)("td",{children:(a=s,"boolean"==typeof a?a.toString().charAt(0).toUpperCase()+a.toString().slice(1):a)},e);var a}))]},e)))})]})})}},5158:(s,e,a)=>{a.d(e,{A:()=>i});var n=a(6540),l=a(4848);const i=function(s){let{src:e,sourceLink:a,aspectRatio:i=16/9}=s;const[t,r]=(0,n.useState)(0),[c,m]=(0,n.useState)(0),h=(0,n.useRef)(null);return(0,n.useEffect)((()=>{const s=()=>{if(h.current){const s=h.current.offsetWidth;m(s/i)}};return s(),window.addEventListener("resize",s),()=>window.removeEventListener("resize",s)}),[i]),(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("div",{ref:h,style:{width:"100%",position:"relative",maxWidth:"100%",backgroundColor:"white"},children:(0,l.jsx)("iframe",{src:e,style:{width:"100%",height:`${c}px`,border:"0",allowFullScreen:!0}},t)}),(0,l.jsx)("div",{style:{display:"flex",justifyContent:"center",margin:"20px 0"},children:(0,l.jsx)("a",{href:a,target:"_blank",rel:"noopener noreferrer",children:"(Source)"})}),(0,l.jsx)("div",{style:{display:"flex",justifyContent:"center",margin:"10px 0"},children:(0,l.jsx)("button",{onClick:()=>{r((s=>s+1))},style:{backgroundColor:"#4CAF50",color:"white",padding:"10px 20px",border:"none",borderRadius:"5px",cursor:"pointer",outline:"none",fontSize:"16px",fontWeight:"bold",boxShadow:"0 4px 8px rgba(0,0,0,0.1)",transition:"background-color 0.3s"},onMouseOver:s=>s.currentTarget.style.backgroundColor="#45a049",onMouseOut:s=>s.currentTarget.style.backgroundColor="#4CAF50",children:"Restart Diagram"})})]})}},8453:(s,e,a)=>{a.d(e,{R:()=>t,x:()=>r});var n=a(6540);const l={},i=n.createContext(l);function t(s){const e=n.useContext(i);return n.useMemo((function(){return"function"==typeof s?s(e):{...e,...s}}),[e,s])}function r(s){let e;return e=s.disableParentContext?"function"==typeof s.components?s.components(l):s.components||l:t(s.components),n.createElement(i.Provider,{value:e},s.children)}}}]); \ No newline at end of file diff --git a/assets/js/runtime~main.cd6e20cf.js b/assets/js/runtime~main.142639b8.js similarity index 98% rename from assets/js/runtime~main.cd6e20cf.js rename to assets/js/runtime~main.142639b8.js index b949b20d..d8ace926 100644 --- a/assets/js/runtime~main.cd6e20cf.js +++ b/assets/js/runtime~main.142639b8.js @@ -1 +1 @@ -(()=>{"use strict";var e,a,f,c,d,b={},r={};function t(e){var a=r[e];if(void 0!==a)return a.exports;var f=r[e]={id:e,loaded:!1,exports:{}};return b[e].call(f.exports,f,f.exports,t),f.loaded=!0,f.exports}t.m=b,t.c=r,e=[],t.O=(a,f,c,d)=>{if(!f){var b=1/0;for(i=0;i=d)&&Object.keys(t.O).every((e=>t.O[e](f[o])))?f.splice(o--,1):(r=!1,d0&&e[i-1][2]>d;i--)e[i]=e[i-1];e[i]=[f,c,d]},t.n=e=>{var a=e&&e.__esModule?()=>e.default:()=>e;return t.d(a,{a:a}),a},f=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,t.t=function(e,c){if(1&c&&(e=this(e)),8&c)return e;if("object"==typeof e&&e){if(4&c&&e.__esModule)return e;if(16&c&&"function"==typeof e.then)return e}var d=Object.create(null);t.r(d);var b={};a=a||[null,f({}),f([]),f(f)];for(var r=2&c&&e;"object"==typeof r&&!~a.indexOf(r);r=f(r))Object.getOwnPropertyNames(r).forEach((a=>b[a]=()=>e[a]));return b.default=()=>e,t.d(d,b),d},t.d=(e,a)=>{for(var f in a)t.o(a,f)&&!t.o(e,f)&&Object.defineProperty(e,f,{enumerable:!0,get:a[f]})},t.f={},t.e=e=>Promise.all(Object.keys(t.f).reduce(((a,f)=>(t.f[f](e,a),a)),[])),t.u=e=>"assets/js/"+({28:"f095f4cd",94:"81322b72",186:"2869c049",614:"f2b0891e",670:"454a1eba",675:"82ff9878",719:"9ac7dbcc",796:"669a2506",972:"f03ae67e",1316:"62552850",1607:"faf9f7da",1614:"e10a9913",1746:"a278cdf6",1779:"9a265863",1870:"ee019b1d",1903:"9e7aae35",1944:"b0c30e46",1972:"73664a40",1979:"b69909d7",2087:"f0fd5c00",2105:"dd3b6db1",2138:"1a4e3797",2284:"6e05dac9",2302:"499d47b2",2334:"65beeb93",2441:"9e1896f0",2456:"36d89dbe",2491:"acb40918",2634:"c4f5d8e4",2646:"0c6397b1",2711:"9e4087bc",2720:"10f7d562",2808:"f0994678",2917:"dfefbedb",3068:"1687d1ce",3237:"2be9118b",3249:"ccc49370",3279:"1fc0ff79",3342:"f9684ee2",3343:"f3b65525",3362:"f39390d7",3404:"a5070059",3484:"c94468d5",3508:"202baea0",3555:"d3ef55ca",3637:"f4f34a3a",3694:"8717b14a",3717:"099c0b96",3782:"6e7a31fd",3870:"37002ad4",3985:"1cf20db4",4266:"8ded1294",4279:"df203c0f",4284:"acecf23e",4469:"6a26c916",4534:"97247bb2",4540:"f8d80a2f",4551:"907d0c45",4567:"655190df",4594:"62efbc4a",4599:"5a31c4e4",4638:"9746c0ef",4787:"3720c009",4812:"739bf370",4813:"6875c492",4833:"d4f68316",4929:"b78139e1",4932:"6b67e948",5007:"e06ba05c",5119:"d28047a2",5125:"10297ef4",5151:"55960ee5",5296:"14acb028",5387:"a934ee8a",5391:"cd451366",5427:"956f17b0",5443:"add9b02f",5480:"09399a2b",5521:"38b2e376",5557:"d9f32620",5579:"46ccc97a",5589:"ea885f1b",5622:"5d6a2894",5719:"74a3fcb2",5743:"231a3aa4",5745:"8d40581b",5980:"6e2ca103",5999:"602d711c",6061:"1f391b9e",6077:"ffbcff43",6090:"3f791b14",6137:"61546123",6142:"60c4aef6",6264:"187e374f",6280:"5ddb68ca",6363:"2141c98b",6454:"a632f386",6690:"920988e2",6730:"b7ff327f",6747:"f4434bba",6787:"eb170cfd",6925:"ecad1ce6",6969:"14eb3368",7069:"2efbf384",7098:"a7bd4aaa",7174:"a4805c9a",7214:"dcbe5aac",7233:"f4c1c84a",7326:"03f8d3d3",7472:"814f3328",7489:"fe41946a",7643:"a6aa9e1f",7661:"26533384",7680:"cdae2dcc",7795:"f3976560",7889:"a16987a3",8065:"80770d40",8104:"d3196d0d",8209:"01a85c17",8241:"de98ccb0",8401:"17896441",8405:"6d7cf8c9",8559:"3349ad3a",8581:"935f2afb",8609:"925b3f96",8675:"809bd41b",8737:"7661071f",8857:"0708938a",9048:"a94703ab",9316:"3b87ebee",9325:"59362658",9328:"e273c56f",9448:"1774e1e3",9477:"57154246",9572:"8c496670",9595:"fb17983f",9600:"eaaf288f",9647:"5e95c892",9699:"f9ea3bc3",9797:"85bbc213",9826:"d01a85b0",9894:"9f1843d8",9933:"9c6685b1",9938:"3eb51302"}[e]||e)+"."+{28:"9f1d1318",94:"90d5758b",186:"7590b2dd",614:"d7eac5db",670:"16d66e92",675:"9143662a",719:"77c0c128",796:"170f6d81",972:"05f5883f",1316:"611cdd05",1607:"a670a186",1614:"b87367c0",1746:"6d5ef8b3",1779:"97c28c35",1870:"83c014e4",1903:"af9e1878",1944:"494989bc",1972:"6864c464",1979:"cf14dce4",2087:"4df4c5a5",2105:"3ea3e8be",2138:"aadba9b7",2237:"29af0789",2284:"5de02c24",2302:"394129d8",2334:"92288123",2441:"53464e90",2456:"abf69e17",2491:"20b35a67",2634:"f7cd0456",2646:"4c026ca7",2711:"8dd0f02f",2720:"9b0bb4fc",2808:"04e51180",2917:"f0f27122",3068:"20883732",3237:"1e62f3f0",3242:"bc6cfa22",3249:"ede845d6",3279:"66617d79",3342:"94223911",3343:"792c19b9",3362:"8c037730",3404:"d420f5a2",3484:"c6edfbc0",3508:"908c6f0c",3555:"2308a0a5",3637:"b17e442f",3694:"5454028b",3717:"cd0ce1aa",3782:"37c8f8e9",3808:"8a31a624",3870:"05ddd35d",3985:"a1948cc0",4266:"513e7c38",4279:"9bb05a46",4284:"6510b036",4469:"af28a919",4534:"84f8af6a",4540:"8eab106d",4551:"7e422b8d",4567:"23a73ffd",4594:"00648062",4599:"2044ebb1",4638:"2880f7ec",4787:"9b65805f",4812:"a6284299",4813:"170acbab",4833:"270cd6c0",4929:"88fdbdc8",4932:"0e1c3290",5007:"2fc679a2",5049:"fc44c2c6",5119:"40e4d113",5125:"8f93c5d4",5151:"765be35c",5296:"d858fe86",5387:"7e4093f8",5391:"27038027",5427:"95f66799",5443:"bf2acfd8",5480:"c91de645",5521:"3d83e140",5557:"9fd27735",5579:"c2d0e88e",5589:"9a7123df",5622:"ac62096c",5719:"fd2380f0",5743:"bb1b0a14",5745:"0f3d989b",5980:"7621ee3b",5999:"f7e2a03a",6061:"0fbbc924",6077:"e95668eb",6090:"fee676c1",6137:"4e189d0b",6142:"df20c7dd",6264:"00e1cc00",6280:"036894d0",6363:"8ceae88c",6454:"f7ec2f07",6690:"1a73d040",6730:"d6f9457e",6747:"0479fbaa",6787:"253b7f3e",6925:"45e66795",6969:"66f25eb3",7069:"0f6f23fb",7098:"7f57ba47",7174:"53481746",7214:"70a12792",7233:"0250807e",7326:"65063e2e",7472:"2a71da77",7489:"a8daece4",7643:"e66b5d79",7661:"ba125169",7680:"872a7974",7795:"e6a51183",7889:"423d1bcd",8065:"88d53b0f",8104:"987cf125",8209:"9fbc266e",8241:"92417364",8401:"e72d0c45",8405:"81b437c0",8559:"33a087db",8581:"038ab178",8609:"cba4ee15",8675:"0c13f0ab",8737:"8c73ff37",8857:"fbfbdee8",8913:"a03b371c",9048:"be35ee30",9316:"65aa3284",9325:"777bc4c6",9328:"f95f7890",9448:"31a80d1b",9462:"c36291a8",9477:"9e5a012a",9572:"3ecad696",9595:"d5f88d2e",9600:"10ee7159",9647:"c487ac59",9699:"f12abbc7",9797:"59604264",9826:"297915d4",9894:"1b3eede2",9933:"77d25a1f",9938:"ade32d2c"}[e]+".js",t.miniCssF=e=>{},t.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),t.o=(e,a)=>Object.prototype.hasOwnProperty.call(e,a),c={},d="bpd-reference:",t.l=(e,a,f,b)=>{if(c[e])c[e].push(a);else{var r,o;if(void 0!==f)for(var n=document.getElementsByTagName("script"),i=0;i{r.onerror=r.onload=null,clearTimeout(s);var d=c[e];if(delete c[e],r.parentNode&&r.parentNode.removeChild(r),d&&d.forEach((e=>e(f))),a)return a(f)},s=setTimeout(l.bind(null,void 0,{type:"timeout",target:r}),12e4);r.onerror=l.bind(null,r.onerror),r.onload=l.bind(null,r.onload),o&&document.head.appendChild(r)}},t.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},t.p="/bpd-reference/",t.gca=function(e){return e={17896441:"8401",26533384:"7661",57154246:"9477",59362658:"9325",61546123:"6137",62552850:"1316",f095f4cd:"28","81322b72":"94","2869c049":"186",f2b0891e:"614","454a1eba":"670","82ff9878":"675","9ac7dbcc":"719","669a2506":"796",f03ae67e:"972",faf9f7da:"1607",e10a9913:"1614",a278cdf6:"1746","9a265863":"1779",ee019b1d:"1870","9e7aae35":"1903",b0c30e46:"1944","73664a40":"1972",b69909d7:"1979",f0fd5c00:"2087",dd3b6db1:"2105","1a4e3797":"2138","6e05dac9":"2284","499d47b2":"2302","65beeb93":"2334","9e1896f0":"2441","36d89dbe":"2456",acb40918:"2491",c4f5d8e4:"2634","0c6397b1":"2646","9e4087bc":"2711","10f7d562":"2720",f0994678:"2808",dfefbedb:"2917","1687d1ce":"3068","2be9118b":"3237",ccc49370:"3249","1fc0ff79":"3279",f9684ee2:"3342",f3b65525:"3343",f39390d7:"3362",a5070059:"3404",c94468d5:"3484","202baea0":"3508",d3ef55ca:"3555",f4f34a3a:"3637","8717b14a":"3694","099c0b96":"3717","6e7a31fd":"3782","37002ad4":"3870","1cf20db4":"3985","8ded1294":"4266",df203c0f:"4279",acecf23e:"4284","6a26c916":"4469","97247bb2":"4534",f8d80a2f:"4540","907d0c45":"4551","655190df":"4567","62efbc4a":"4594","5a31c4e4":"4599","9746c0ef":"4638","3720c009":"4787","739bf370":"4812","6875c492":"4813",d4f68316:"4833",b78139e1:"4929","6b67e948":"4932",e06ba05c:"5007",d28047a2:"5119","10297ef4":"5125","55960ee5":"5151","14acb028":"5296",a934ee8a:"5387",cd451366:"5391","956f17b0":"5427",add9b02f:"5443","09399a2b":"5480","38b2e376":"5521",d9f32620:"5557","46ccc97a":"5579",ea885f1b:"5589","5d6a2894":"5622","74a3fcb2":"5719","231a3aa4":"5743","8d40581b":"5745","6e2ca103":"5980","602d711c":"5999","1f391b9e":"6061",ffbcff43:"6077","3f791b14":"6090","60c4aef6":"6142","187e374f":"6264","5ddb68ca":"6280","2141c98b":"6363",a632f386:"6454","920988e2":"6690",b7ff327f:"6730",f4434bba:"6747",eb170cfd:"6787",ecad1ce6:"6925","14eb3368":"6969","2efbf384":"7069",a7bd4aaa:"7098",a4805c9a:"7174",dcbe5aac:"7214",f4c1c84a:"7233","03f8d3d3":"7326","814f3328":"7472",fe41946a:"7489",a6aa9e1f:"7643",cdae2dcc:"7680",f3976560:"7795",a16987a3:"7889","80770d40":"8065",d3196d0d:"8104","01a85c17":"8209",de98ccb0:"8241","6d7cf8c9":"8405","3349ad3a":"8559","935f2afb":"8581","925b3f96":"8609","809bd41b":"8675","7661071f":"8737","0708938a":"8857",a94703ab:"9048","3b87ebee":"9316",e273c56f:"9328","1774e1e3":"9448","8c496670":"9572",fb17983f:"9595",eaaf288f:"9600","5e95c892":"9647",f9ea3bc3:"9699","85bbc213":"9797",d01a85b0:"9826","9f1843d8":"9894","9c6685b1":"9933","3eb51302":"9938"}[e]||e,t.p+t.u(e)},(()=>{var e={5354:0,1869:0};t.f.j=(a,f)=>{var c=t.o(e,a)?e[a]:void 0;if(0!==c)if(c)f.push(c[2]);else if(/^(1869|5354)$/.test(a))e[a]=0;else{var d=new Promise(((f,d)=>c=e[a]=[f,d]));f.push(c[2]=d);var b=t.p+t.u(a),r=new Error;t.l(b,(f=>{if(t.o(e,a)&&(0!==(c=e[a])&&(e[a]=void 0),c)){var d=f&&("load"===f.type?"missing":f.type),b=f&&f.target&&f.target.src;r.message="Loading chunk "+a+" failed.\n("+d+": "+b+")",r.name="ChunkLoadError",r.type=d,r.request=b,c[1](r)}}),"chunk-"+a,a)}},t.O.j=a=>0===e[a];var a=(a,f)=>{var c,d,b=f[0],r=f[1],o=f[2],n=0;if(b.some((a=>0!==e[a]))){for(c in r)t.o(r,c)&&(t.m[c]=r[c]);if(o)var i=o(t)}for(a&&a(f);n{"use strict";var e,a,f,c,d,b={},r={};function t(e){var a=r[e];if(void 0!==a)return a.exports;var f=r[e]={id:e,loaded:!1,exports:{}};return b[e].call(f.exports,f,f.exports,t),f.loaded=!0,f.exports}t.m=b,t.c=r,e=[],t.O=(a,f,c,d)=>{if(!f){var b=1/0;for(i=0;i=d)&&Object.keys(t.O).every((e=>t.O[e](f[o])))?f.splice(o--,1):(r=!1,d0&&e[i-1][2]>d;i--)e[i]=e[i-1];e[i]=[f,c,d]},t.n=e=>{var a=e&&e.__esModule?()=>e.default:()=>e;return t.d(a,{a:a}),a},f=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,t.t=function(e,c){if(1&c&&(e=this(e)),8&c)return e;if("object"==typeof e&&e){if(4&c&&e.__esModule)return e;if(16&c&&"function"==typeof e.then)return e}var d=Object.create(null);t.r(d);var b={};a=a||[null,f({}),f([]),f(f)];for(var r=2&c&&e;"object"==typeof r&&!~a.indexOf(r);r=f(r))Object.getOwnPropertyNames(r).forEach((a=>b[a]=()=>e[a]));return b.default=()=>e,t.d(d,b),d},t.d=(e,a)=>{for(var f in a)t.o(a,f)&&!t.o(e,f)&&Object.defineProperty(e,f,{enumerable:!0,get:a[f]})},t.f={},t.e=e=>Promise.all(Object.keys(t.f).reduce(((a,f)=>(t.f[f](e,a),a)),[])),t.u=e=>"assets/js/"+({28:"f095f4cd",94:"81322b72",186:"2869c049",614:"f2b0891e",670:"454a1eba",675:"82ff9878",719:"9ac7dbcc",796:"669a2506",972:"f03ae67e",1316:"62552850",1607:"faf9f7da",1614:"e10a9913",1746:"a278cdf6",1779:"9a265863",1870:"ee019b1d",1903:"9e7aae35",1944:"b0c30e46",1972:"73664a40",1979:"b69909d7",2087:"f0fd5c00",2105:"dd3b6db1",2138:"1a4e3797",2284:"6e05dac9",2302:"499d47b2",2334:"65beeb93",2441:"9e1896f0",2456:"36d89dbe",2491:"acb40918",2634:"c4f5d8e4",2646:"0c6397b1",2711:"9e4087bc",2720:"10f7d562",2808:"f0994678",2917:"dfefbedb",3068:"1687d1ce",3237:"2be9118b",3249:"ccc49370",3279:"1fc0ff79",3342:"f9684ee2",3343:"f3b65525",3362:"f39390d7",3404:"a5070059",3484:"c94468d5",3508:"202baea0",3555:"d3ef55ca",3637:"f4f34a3a",3694:"8717b14a",3717:"099c0b96",3782:"6e7a31fd",3870:"37002ad4",3985:"1cf20db4",4266:"8ded1294",4279:"df203c0f",4284:"acecf23e",4469:"6a26c916",4534:"97247bb2",4540:"f8d80a2f",4551:"907d0c45",4567:"655190df",4594:"62efbc4a",4599:"5a31c4e4",4638:"9746c0ef",4787:"3720c009",4812:"739bf370",4813:"6875c492",4833:"d4f68316",4929:"b78139e1",4932:"6b67e948",5007:"e06ba05c",5119:"d28047a2",5125:"10297ef4",5151:"55960ee5",5296:"14acb028",5387:"a934ee8a",5391:"cd451366",5427:"956f17b0",5443:"add9b02f",5480:"09399a2b",5521:"38b2e376",5557:"d9f32620",5579:"46ccc97a",5589:"ea885f1b",5622:"5d6a2894",5719:"74a3fcb2",5743:"231a3aa4",5745:"8d40581b",5980:"6e2ca103",5999:"602d711c",6061:"1f391b9e",6077:"ffbcff43",6090:"3f791b14",6137:"61546123",6142:"60c4aef6",6264:"187e374f",6280:"5ddb68ca",6363:"2141c98b",6454:"a632f386",6690:"920988e2",6730:"b7ff327f",6747:"f4434bba",6787:"eb170cfd",6925:"ecad1ce6",6969:"14eb3368",7069:"2efbf384",7098:"a7bd4aaa",7174:"a4805c9a",7214:"dcbe5aac",7233:"f4c1c84a",7326:"03f8d3d3",7472:"814f3328",7489:"fe41946a",7643:"a6aa9e1f",7661:"26533384",7680:"cdae2dcc",7795:"f3976560",7889:"a16987a3",8065:"80770d40",8104:"d3196d0d",8209:"01a85c17",8241:"de98ccb0",8401:"17896441",8405:"6d7cf8c9",8559:"3349ad3a",8581:"935f2afb",8609:"925b3f96",8675:"809bd41b",8737:"7661071f",8857:"0708938a",9048:"a94703ab",9316:"3b87ebee",9325:"59362658",9328:"e273c56f",9448:"1774e1e3",9477:"57154246",9572:"8c496670",9595:"fb17983f",9600:"eaaf288f",9647:"5e95c892",9699:"f9ea3bc3",9797:"85bbc213",9826:"d01a85b0",9894:"9f1843d8",9933:"9c6685b1",9938:"3eb51302"}[e]||e)+"."+{28:"9f1d1318",94:"90d5758b",186:"7590b2dd",614:"d7eac5db",670:"16d66e92",675:"9143662a",719:"77c0c128",796:"170f6d81",972:"05f5883f",1316:"611cdd05",1607:"a670a186",1614:"b87367c0",1746:"6d5ef8b3",1779:"97c28c35",1870:"83c014e4",1903:"af9e1878",1944:"494989bc",1972:"6864c464",1979:"cf14dce4",2087:"4df4c5a5",2105:"3ea3e8be",2138:"aadba9b7",2237:"29af0789",2284:"5de02c24",2302:"394129d8",2334:"92288123",2441:"53464e90",2456:"abf69e17",2491:"20b35a67",2634:"f7cd0456",2646:"4c026ca7",2711:"8dd0f02f",2720:"9b0bb4fc",2808:"04e51180",2917:"f0f27122",3068:"20883732",3237:"1e62f3f0",3242:"bc6cfa22",3249:"ede845d6",3279:"66617d79",3342:"94223911",3343:"792c19b9",3362:"8c037730",3404:"d420f5a2",3484:"c6edfbc0",3508:"908c6f0c",3555:"2308a0a5",3637:"b17e442f",3694:"5454028b",3717:"cd0ce1aa",3782:"37c8f8e9",3808:"8a31a624",3870:"05ddd35d",3985:"a1948cc0",4266:"513e7c38",4279:"9bb05a46",4284:"6510b036",4469:"af28a919",4534:"84f8af6a",4540:"8eab106d",4551:"7e422b8d",4567:"23a73ffd",4594:"00648062",4599:"2044ebb1",4638:"2880f7ec",4787:"9b65805f",4812:"a6284299",4813:"170acbab",4833:"270cd6c0",4929:"88fdbdc8",4932:"0e1c3290",5007:"2fc679a2",5049:"fc44c2c6",5119:"40e4d113",5125:"8f93c5d4",5151:"765be35c",5296:"d858fe86",5387:"7e4093f8",5391:"27038027",5427:"95f66799",5443:"bf2acfd8",5480:"c91de645",5521:"3d83e140",5557:"9fd27735",5579:"c2d0e88e",5589:"9a7123df",5622:"ac62096c",5719:"fd2380f0",5743:"bb1b0a14",5745:"0f3d989b",5980:"7621ee3b",5999:"f7e2a03a",6061:"0fbbc924",6077:"e95668eb",6090:"fee676c1",6137:"4e189d0b",6142:"f5ab945a",6264:"00e1cc00",6280:"036894d0",6363:"8ceae88c",6454:"f7ec2f07",6690:"1a73d040",6730:"d6f9457e",6747:"0479fbaa",6787:"253b7f3e",6925:"45e66795",6969:"66f25eb3",7069:"0f6f23fb",7098:"7f57ba47",7174:"53481746",7214:"70a12792",7233:"0250807e",7326:"65063e2e",7472:"2a71da77",7489:"a8daece4",7643:"e66b5d79",7661:"ba125169",7680:"872a7974",7795:"e6a51183",7889:"423d1bcd",8065:"88d53b0f",8104:"987cf125",8209:"9fbc266e",8241:"92417364",8401:"e72d0c45",8405:"81b437c0",8559:"33a087db",8581:"038ab178",8609:"cba4ee15",8675:"0c13f0ab",8737:"8c73ff37",8857:"fbfbdee8",8913:"a03b371c",9048:"be35ee30",9316:"65aa3284",9325:"777bc4c6",9328:"f95f7890",9448:"31a80d1b",9462:"c36291a8",9477:"9e5a012a",9572:"3ecad696",9595:"d5f88d2e",9600:"10ee7159",9647:"c487ac59",9699:"f12abbc7",9797:"59604264",9826:"297915d4",9894:"1b3eede2",9933:"77d25a1f",9938:"ade32d2c"}[e]+".js",t.miniCssF=e=>{},t.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),t.o=(e,a)=>Object.prototype.hasOwnProperty.call(e,a),c={},d="bpd-reference:",t.l=(e,a,f,b)=>{if(c[e])c[e].push(a);else{var r,o;if(void 0!==f)for(var n=document.getElementsByTagName("script"),i=0;i{r.onerror=r.onload=null,clearTimeout(s);var d=c[e];if(delete c[e],r.parentNode&&r.parentNode.removeChild(r),d&&d.forEach((e=>e(f))),a)return a(f)},s=setTimeout(l.bind(null,void 0,{type:"timeout",target:r}),12e4);r.onerror=l.bind(null,r.onerror),r.onload=l.bind(null,r.onload),o&&document.head.appendChild(r)}},t.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},t.p="/bpd-reference/",t.gca=function(e){return e={17896441:"8401",26533384:"7661",57154246:"9477",59362658:"9325",61546123:"6137",62552850:"1316",f095f4cd:"28","81322b72":"94","2869c049":"186",f2b0891e:"614","454a1eba":"670","82ff9878":"675","9ac7dbcc":"719","669a2506":"796",f03ae67e:"972",faf9f7da:"1607",e10a9913:"1614",a278cdf6:"1746","9a265863":"1779",ee019b1d:"1870","9e7aae35":"1903",b0c30e46:"1944","73664a40":"1972",b69909d7:"1979",f0fd5c00:"2087",dd3b6db1:"2105","1a4e3797":"2138","6e05dac9":"2284","499d47b2":"2302","65beeb93":"2334","9e1896f0":"2441","36d89dbe":"2456",acb40918:"2491",c4f5d8e4:"2634","0c6397b1":"2646","9e4087bc":"2711","10f7d562":"2720",f0994678:"2808",dfefbedb:"2917","1687d1ce":"3068","2be9118b":"3237",ccc49370:"3249","1fc0ff79":"3279",f9684ee2:"3342",f3b65525:"3343",f39390d7:"3362",a5070059:"3404",c94468d5:"3484","202baea0":"3508",d3ef55ca:"3555",f4f34a3a:"3637","8717b14a":"3694","099c0b96":"3717","6e7a31fd":"3782","37002ad4":"3870","1cf20db4":"3985","8ded1294":"4266",df203c0f:"4279",acecf23e:"4284","6a26c916":"4469","97247bb2":"4534",f8d80a2f:"4540","907d0c45":"4551","655190df":"4567","62efbc4a":"4594","5a31c4e4":"4599","9746c0ef":"4638","3720c009":"4787","739bf370":"4812","6875c492":"4813",d4f68316:"4833",b78139e1:"4929","6b67e948":"4932",e06ba05c:"5007",d28047a2:"5119","10297ef4":"5125","55960ee5":"5151","14acb028":"5296",a934ee8a:"5387",cd451366:"5391","956f17b0":"5427",add9b02f:"5443","09399a2b":"5480","38b2e376":"5521",d9f32620:"5557","46ccc97a":"5579",ea885f1b:"5589","5d6a2894":"5622","74a3fcb2":"5719","231a3aa4":"5743","8d40581b":"5745","6e2ca103":"5980","602d711c":"5999","1f391b9e":"6061",ffbcff43:"6077","3f791b14":"6090","60c4aef6":"6142","187e374f":"6264","5ddb68ca":"6280","2141c98b":"6363",a632f386:"6454","920988e2":"6690",b7ff327f:"6730",f4434bba:"6747",eb170cfd:"6787",ecad1ce6:"6925","14eb3368":"6969","2efbf384":"7069",a7bd4aaa:"7098",a4805c9a:"7174",dcbe5aac:"7214",f4c1c84a:"7233","03f8d3d3":"7326","814f3328":"7472",fe41946a:"7489",a6aa9e1f:"7643",cdae2dcc:"7680",f3976560:"7795",a16987a3:"7889","80770d40":"8065",d3196d0d:"8104","01a85c17":"8209",de98ccb0:"8241","6d7cf8c9":"8405","3349ad3a":"8559","935f2afb":"8581","925b3f96":"8609","809bd41b":"8675","7661071f":"8737","0708938a":"8857",a94703ab:"9048","3b87ebee":"9316",e273c56f:"9328","1774e1e3":"9448","8c496670":"9572",fb17983f:"9595",eaaf288f:"9600","5e95c892":"9647",f9ea3bc3:"9699","85bbc213":"9797",d01a85b0:"9826","9f1843d8":"9894","9c6685b1":"9933","3eb51302":"9938"}[e]||e,t.p+t.u(e)},(()=>{var e={5354:0,1869:0};t.f.j=(a,f)=>{var c=t.o(e,a)?e[a]:void 0;if(0!==c)if(c)f.push(c[2]);else if(/^(1869|5354)$/.test(a))e[a]=0;else{var d=new Promise(((f,d)=>c=e[a]=[f,d]));f.push(c[2]=d);var b=t.p+t.u(a),r=new Error;t.l(b,(f=>{if(t.o(e,a)&&(0!==(c=e[a])&&(e[a]=void 0),c)){var d=f&&("load"===f.type?"missing":f.type),b=f&&f.target&&f.target.src;r.message="Loading chunk "+a+" failed.\n("+d+": "+b+")",r.name="ChunkLoadError",r.type=d,r.request=b,c[1](r)}}),"chunk-"+a,a)}},t.O.j=a=>0===e[a];var a=(a,f)=>{var c,d,b=f[0],r=f[1],o=f[2],n=0;if(b.some((a=>0!==e[a]))){for(c in r)t.o(r,c)&&(t.m[c]=r[c]);if(o)var i=o(t)}for(a&&a(f);n