<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Hlaing Min on Medium]]></title>
        <description><![CDATA[Stories by Hlaing Min on Medium]]></description>
        <link>https://medium.com/@hammer7?source=rss-c3e14d5432fb------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*Gm7eiXXK0q0NtDWe</url>
            <title>Stories by Hlaing Min on Medium</title>
            <link>https://medium.com/@hammer7?source=rss-c3e14d5432fb------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 17 Nov 2026 15:40:47 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@hammer7/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Random Variables 2 (Basic Statistics Part 4)]]></title>
            <link>https://medium.com/@hammer7/random-variables-2-basic-statistics-part-4-415caf223fd9?source=rss-c3e14d5432fb------2</link>
            <guid isPermaLink="false">https://medium.com/p/415caf223fd9</guid>
            <category><![CDATA[myanmar]]></category>
            <category><![CDATA[statistics]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[Hlaing Min]]></dc:creator>
            <pubDate>Tue, 03 Sep 2019 10:02:25 GMT</pubDate>
            <atom:updated>2019-09-04T04:44:07.812Z</atom:updated>
            <content:encoded><![CDATA[<p><a href="https://medium.com/@hammer7/random-variables-1-basic-statistics-part-3-20cff3074ceb">Part 3</a> မွာ Random Variables ရဲ႔ definition, Types of Random Variables နဲ႔ ဘယ္ေၾကာင့္ အသံုးဝင္တာလဲဆိုတာကို ဥပမာ ေတြ နဲ႔ ေဆြးေႏြးခဲ့ၾကပါတယ္။ ဒီ Post မွာေတာ့ သူ႔ ရဲ့ concept အခ်ိဳ႔ ကို ေဆြးေႏြးၾကရ ေအာင္။</p><h4>Support</h4><blockquote>The <strong>support</strong> of a random variable is the set of values that it can take on.</blockquote><p>Random Variable တစ္ခုရဲ႔ support ဆိုတာ possible values အားလံုးပါတဲ့ အစုကို ေခၚပါတယ္။ Part 3 က Example 2 (sum of 2 dice rolls) ရဲ႔ Support ကို A လို႔ သတ္မွတ္ရင္ <strong>A</strong> = {2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12} ပါ။ သတိျပဳရမွာက ေတာ့ Support ထဲက outcome ေတြ Probability မတူတာပါ။ <a href="https://medium.com/@hammer7/random-variables-1-basic-statistics-part-3-20cff3074ceb#a522">Sum of 2 dice rolls</a> မွာ 2 ျဖစ္ဖို႔ Probability က <em>P(X=2)</em><strong> = 1/36</strong> ရွိေပမယ့္ 7 ျဖစ္ဖို႔က ေတာ့ <em>P(X=7)</em><strong>= 1/6</strong> ပါ။ Discrete ေရာ Continuous ေရာ Support ရဲ႔ probability အားလံုးေပါင္းလိုက္ရင္ေတာ့ 1 ရပါတယ္။ Equation နဲ႔ ေျပာရရင္ <em>P(X ∈ A)</em><strong> = 1 </strong>လို႔ ေရးပါတယ္။ အသံုးနည္းတဲ့ အယူအဆပါ။</p><h4><strong>Distribution</strong></h4><blockquote>The <strong><em>probability distribution</em></strong> of a random variable is a list of probabilities associated with each of its possible values.</blockquote><p>Random variable တစ္ခုရဲ႔ Probability distribution ဆိုတာ possible values ေတြ နဲ႔ သူတို႔ ရဲ႕ probability ေတြကို ဆပ္စပ္ ေဖာ္ျပထားတဲ့ function ပါ။ တိတိက်က် ေျပာရရင္ေတာ့ input <strong>set </strong>တစ္ခုကို function ထဲထည့္ရင္ သူ႔ရဲ႔ probability ကို output ထုတ္ေပးပါတယ္။</p><p>Visualize လုပ္လို႔ ရ ေအာင္ graph diagram နဲ႔ ေဖာ္ျပ ေလ့ရွိပါတယ္။ Horizontal X ဝင္ရိုးက <strong>Support</strong> (အထက္မွာ ျပန္ၾကည့္ပါ) ကိုယ္စားျပဳၿပီး Vertical Y ဝင္ရိုးက ေတာ့ တစ္ခုခ်င္းစီရဲ႔ probability ကို ကုိယ္စားျပဳပါတယ္။<br>ဥပမာ Example 2 က Discrete Random Variable ကို ေဖာ္ျပမယ္ဆိုရင္</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nkGT1DDGJHIeAPe2BFuifw.png" /><figcaption><strong>Original : </strong><a href="https://en.wikipedia.org/wiki/Probability_distribution"><strong>https://en.wikipedia.org/wiki/Probability_distribution</strong></a></figcaption></figure><p>ဒီပံုက Wiki page က Dice ကို superimpose လုပ္ထားတဲ့ပံုကို ယူသံုးထားတာပါ။တကယ္ ေတာ့ bar plot နဲ႕ ျပရင္ လံုေလာက္ပါတယ္။ သတိျပဳေစခ်င္ တာက ဒီပံုက Discrete Random Variable ရဲ႕ Distribution ပံုပါ။ Continuous distribution ကို bar plot နဲ႔ ေဖာ္ျပ ေလ့မရွိပါဘူး။</p><p>Discrete Random Variable မွာ values တစ္ခုခ်င္းစီရဲ႕ ျဖစ္ႏိုင္ေျခ ဟာ 0 ထက္ ႀကီ:(non-zero Probability) ျဖစ္တယ္။ Continuous Random Variable မွာ တစ္ခုစီရဲ႔ Probability ကို 0 လို႔ ယူဆတယ္။ Part 3 က <a href="https://medium.com/@hammer7/random-variables-1-basic-statistics-part-3-20cff3074ceb#2450">Example 4</a> ဥပမာ (မနက္ျဖန္ ရန္ကုန္ရဲ႕ အပူခ်ိန္) 35 degrees ျဖစ္ဖို႔ က 0 ပါ။ 35.0001 ျဖစ္ခြင့္မရွိသလို 34.9999 လဲ ျဖစ္လို႔ မရပါဘူး။ 34,9999 နဲ႔ 35.0001 ၾကားမွာကိုက ျဖစ္ႏိုင္ေျခ ေပါင္း Infinity ရွိပါေသးတယ္။ ဘယ္ values ႏွစ္ခု ၾကားမွာ မဆို ျဖစ္ႏိုင္ေျခ (possible outcome) Infinity ရွိတာေၾကာင့္ Values တစ္ခုခ်င္းစီက Probability က 0 ပါ။ ဒီေတာ့ Distribution ေျပာရင္ တစ္ခုခ်င္းစီကို မ ေျပာပဲ Interval နဲ႔ ပဲေျပာပါတယ္။ Probability ေတြကို ေပါင္းမယ္ဆိုရင္လဲ summation (discrete sum) မလုပ္ပဲ Integration (continuous sum) ပဲ လုပ္တယ္။ Graph နဲ႔ ေဖာ္ျပရင္လဲ Bar graph နဲ႔ ေဖာ္ျပ ေလ့မရွိပဲ Density graph နဲ႔ ေဖာ္ျပပါတယ္။</p><p>Random variable နဲ႔ သူတို႔ ရဲ႕ distribution ေတြကို ေရွးလူေတြက <a href="https://en.wikipedia.org/wiki/List_of_probability_distributions">generalize လုပ္ၿပီး ေလ့လာခဲ့ၾကၿပီးသား</a> ျဖစ္တယ္။ ဒီေတာ့ ကိုယ္စိတ္ဝင္စားတဲ့ Random variables ရဲ႕ distribution က ဘာပံုစံေဆာင္လဲဆိုတာ သိရင္ ရွိၿပီးသား properties တြကို အသင့္ ယူသံုးႏိုင္တယ္။ Part 3 က <a href="https://medium.com/@hammer7/random-variables-1-basic-statistics-part-3-20cff3074ceb#e706">Example 1</a> (single dice roll) ဆိုရင္ Support ရဲ႔ Probability က အားလံုး အတူတူ (1/6) ျဖစ္ေနလို႔ Uniform Distribution အသြင္ေဆာင္ပါတယ္။ <a href="https://medium.com/@hammer7/random-variables-1-basic-statistics-part-3-20cff3074ceb#ad09">Example 3</a> (5 flips of a fair coin) က Random Variable က ေတာ့ Binomial Distribution ျဖစ္ပါတယ္။</p><p>Generalize လုပ္လို႔ မရတဲ့ Distribution အမ်ိဳးအစားေတြလဲ ရွိပါတယ္။ အဲ့ဒါ မ်ိဳးကိုေတာ့ Sampling process ကို သံုးၿပီး sampling distribution ကိုေ ျပာင္း လိုက္ရင္ sampling distribution ဟာ Gaussian normal distribution ပံုစံကို ခ်ဥ္းကပ္သြားပါတယ္။ ဒီေတာ့ ဘယ္ပံုစံပဲျဖစ္ျဖစ္ ေနာက္ဆံုး normal distribution နဲ႔ ခ်ိန္ထိုးၾကည့္လို႕ ရပါတယ္။ အသံုးမ်ားတဲ့ Distribution ပံုစံေတြကို ေနာက္ post ေတြမွာ တစ္ခုခ်င္း ေဆြးေႏြးပါမယ္။</p><h4>Probability Mass Function and Probability Density Function</h4><p>PMF နဲ႔ PDF လို႔ အတို ေခၚေလ့ရွိတယ္။ PMF ကို Discrete Random variable အတြက္ သံုး PDF ကေတာ့ Continuous Random Variable အတြက္ သံုးပါတယ္။ အထက္က ေဆြးေႏြးခဲ့တဲ့ Probability Distribution လုိပဲ input တစ္ခု ေပးလိုက္ရင္ function က သူ႔ရဲ႕ probability ကို ထုတ္ေပးပါတယ္။ Distribution လို႔ ေျပာရင္ Random variable တစ္ခုလံုးကို Set တစ္ခု အေနနဲ႔ ျခံဳေျပာတာျဖစ္ၿပီး PMF နဲ႔ PDF ကေတာ့ individual တစ္ခုခ်င္းရဲ႔ distribution ကို ေဖာ္ျပတဲ့ function ျဖစ္ပါတယ္။ PMF ကို ေအာက္ပါအတိုင္း ေဖာ္ျပပါတယ္။</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/222/1*N5HTFcN7SaPCeCyYMXSZTw.png" /><figcaption>PMF of value x of a <strong>Discrete</strong> Random Variable X</figcaption></figure><p>where <em>P(X=x)</em> = probability of <em>x</em> in discrete random variable <em>X</em></p><p>PDF ကို ေျပာရင္ေတာ့ အထက္မွာ ေျပာတဲ့အတိုင္း value တစ္ခုခ်င္းက 0 probability ရွိတယ္။ ဒီေတာ့ အင္မတန္ငယ္တဲ့ <a href="https://en.wikipedia.org/wiki/Infinitesimal">Infinitesimal interval</a> ထဲမွာရွိတဲ့ value နဲ႔ ပဲေျပာတယ္။ probability ကို ေတာ့ အဲ့ဒီ interval ထဲမွာရွိတဲ့ area under the curve နဲ႔ ေဖာ္ျပႏိုင္ပါတယ္။</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/279/1*xWpE0VfVhHKPWiv9gYTY0w.png" /><figcaption>PDF of infinitesimal interval x of a <strong>Continuous</strong> random Variable X</figcaption></figure><p>where A = infinitesimal interval around the value <em>x</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/592/1*KPnMMphS-WW_HYHfMNtE7g.png" /><figcaption><strong>Example PMF graph for rolling 2 dices</strong></figcaption></figure><h4>Cumulative Distribution Function</h4><p>CDF လို႔ အတိုေခၚၿပီး Discrete ေရာ Continuous အတြက္ေရာ သံုးပါတယ္။ Input value တစ္ခုေပးလိုက္ရင္ ဒီ function အဲ့ဒီ input နဲ႔ သူထက္ငယ္တဲ့ probability အားလံုး ေပါင္းလဒ္ကို output ထုတ္ေပးပါတယ္။</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/220/1*KwFBxy7RF7LvmbKA7-LWNA.png" /><figcaption>CDF of x of a random Variable X</figcaption></figure><p>ဥပမာ သင္က Starbucks က sale manager ဆိုပါစို႔။ ေနရာသစ္တစ္ခုမွာ coffee shop outlet တစ္ခုဖြင့္ခ်င္တယ္။ Past data ေတြနဲ႕ environment အေနအထားေတြအရ တစ္ရက္တာ ေရာင္းရမယ့္ coffee cups အေရအတြက္ကို Random Variable X နဲ႕ ထားၿပီး probability ေတြကို ခန္႔မွန္း ၿပီး တြက္ထားမယ္။ တစ္လမွာ 25 ရက္ ေလာက္ coffee cups အနည္းဆံုး 200 မွ မေရာင္းရရင္ မဖြင့္သင့္ဘူး ဆိုပါစို႔။ CDF သံုးၿပီး တြက္လို႔ ရပါတယ္။ CDF(200) ကို တြက္လိုက္ရင္ cup 200 နဲ႔ ေအာက္ ေရာင္းရမယ့္ ျဖစ္တန္စြမ္း (sum of probability of selling 200 coffee cups and lower) ကို ရမယ္။ အဲ့ဒီ probability က 16.6% ထက္ နည္းတယ္ ဆိုရင္ 200 ေက်ာ္ ေရာင္းရတဲ့ ရာခိုင္ႏွံဳးက 83.3% ထက္ မ်ားတယ္ ေပါ့။ ဒါဆို ဖြင့္သင့္တယ္လို႔ ေျပာႏိုင္တယ္။</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/585/1*i9e_EDMYnfGtNm_kHLcPwA.png" /><figcaption><strong>CDF graph for rolling 2 dices</strong></figcaption></figure><h4>Expected Value</h4><blockquote>The <strong>expected value</strong> of a random variable is the <a href="https://en.wikipedia.org/wiki/Weighted_average">probability-weighted average</a> of all possible values.</blockquote><p>Expected Value (သို႔) Expectation ဆိုတာ Random Variable ရဲ႕ Average value ကို ေခၚတာပါ။ သာမန္ data set မွာ <a href="https://medium.com/@hammer7/measures-of-central-tendency-basic-statistics-part-1-935e24495ed3#0bf9">Average </a>(Arithmetic Mean) ကိုရွာရင္ data points အားလံုးကို ေပါင္းၿပီး အ ေရအတြက္နဲ႔ ျပန္စား ရတယ္။ သာမန္ data set မွာ probability မရွိတဲ့အတြက္ uniform distribution လို႔ပဲ ယူဆၿပီး အဲ့ဒီလိုတြက္တာ အဆင္ေျပတယ္။ ဒါေပမယ့္ Random variable မွာေတာ့ probability distribution က uniform ျဖစ္ခ်င္မွျဖစ္မယ္။ ဒီေတာ့ possible values ေတြကို သူ႔ ရဲ႕ probability နဲ႕ weighted လုပ္ (multiply လုပ္) ၿပီးမွ ေပါင္းေပးရတယ္။</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/603/1*kUBeG2WnjnTeixVnVWE2aQ.png" /><figcaption><strong>Illustration of Weighted average</strong></figcaption></figure><p>ဥပမာ အထက္က ပံုမွာ x axis ကို balance ျဖစ္ခ်င္ရင္ 3 နဲ႔ 6 ၾကားက သာမန္ average မွာ ဆံုခ်က္ ထားလို႔ မရပါဘူး။ weighted average ယူၿပီးမွ 3 နဲ႔ ကပ္တဲ့ ဘက္နား (4 မွာ) ထားမွ ရမွာပါ။ Expected value ကလဲ ဒီသေဘာပါပဲ။ ဒါေၾကာင့္ weighted average လို႔ ေခၚသလို Center of mass လို႔ လဲ ေခၚပါတယ္။</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/348/1*AsDjX2ujgmdqKNnQM1qdsA.png" /><figcaption>Expected value of a <strong>Discrete </strong>random variable X</figcaption></figure><p>where <em>E(X)</em> = <em>μ</em>ₓ= Expected value of a Discrete random variable <em>X</em><br><em>N</em> = Number of possible values that X can take on<br><em>xᵢ</em> = Each possible values of <em>X</em><br><em>P(xᵢ)</em> = Probability of each possible values of <em>X</em></p><p>သာမန္ Arithmetic Mean ရဲ႕ Formula နဲ႔ ႏိႈင္းယွဥ္ၾကည့္ရင္ <br>1. တစ္ခုခ်င္းစီရဲ႔ Probability နဲ႕ ေျမွာက္ တဲ့ အပိုင္း ပါလာတယ္။<br>2. အေရအတြက္နဲ႔ စားတဲ့ အပိုင္း မလိုအပ္ေတာ့ဘူး။</p><p>Probability (1 ထက္ငယ္တဲ့ value) နဲ႕ multiply လုပ္ထားေတာ့ အ ေရအတြက္နဲ႕ ျပန္စားစရာ မလိုေတာ့တာပါ။ ဥပမာ single dice roll ကို တြက္ၾကည့္ရေအာင္။ uniform distribution ဆိုေတာ့ ဘယ္ နည္းသံုးၿပီး ရွာရွာ အ ေျဖ အတူတူ ထြက္ရမယ္။</p><p>Arithmetic Mean = (1 + 2 + 3 + 4 + 5+ 6) / 6 = 3.5 ရတယ္။</p><p>Expected Value = <em>∑ xᵢ P(xᵢ)</em> = (1 x 1/6) + (2 x 1/6) + (3 x 1/6) + (4 x 1/6) + (5 x 1/6) + (6 x 1/6) = 3.5 ပဲ ရတယ္။</p><p>Continuous Random Variable မွာေတာ့ summation အစား integration ကို သံုးပါတယ္။ outcome အေရအတြက္က မေရႏိုင္တဲ့ အတြက္ N ကို မသံုးပါဘူး။ သူ႔ အစား range [a, b] ကို သံုးတယ္။ ၿပီးေတာ့ value တစ္ခုခ်င္းစီ (<em>xᵢ</em>) အစား အင္မတန္ငယ္တဲ့ range (<a href="https://en.wikipedia.org/wiki/Infinitesimal">Infinitesimal width</a>) ထဲမွာ အၾကံဳးဝင္တဲ့ value <em>x </em>လို႔ပဲ သံုးတယ္။ <em>P(xᵢ)</em> ဆိုၿပီး တစ္ခုခ်င္း probability လို႔ မေျပာပဲ Infinitesimal width (<em>dx)</em> မွာ ရွိတဲ့ probability density function <em>f(x) </em>နဲ႔ အစားထိုးသံုးပါတယ္။</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/346/1*rKI7x8AWst9KYO_ik4xtOQ.png" /><figcaption>Expected value of a <strong>Continuous </strong>random variable <em>X</em></figcaption></figure><p>where <em>E(X)</em> = <em>μ</em>ₓ = Expected value of a Continuous random variable <em>X</em><br><em>[a, b]</em> = Continuous range that X can take on<br><em>x</em> = Values at each infinitesimal range between [<em>a, b</em>] of <em>X</em><br><em>f(x) dx</em> = Probability density at each infinitesimal range of width<em> dx</em> around <em>x</em></p><p>Infinitesimal width က တိုင္းလို႔ မရေအာင္ ေသးငယ္ပါတယ္။ ဒါေပမယ့္ နားလည္လြယ္ေအာင္ တိုင္းလို႔ရတယ္ ယူဆထားၿပီး ဥပမာနဲ႔ အစားထိုးၾကည့္ရေအာင္။ ဥပမာ မနက္ဖန္ ရန္ကုန္ အပူခ်ိန္ က 35 degrees ဝန္းက်င္မွာ probability density က 0.3 ယူဆၾကည့္ရေအာင္။</p><p><em>x</em> က 34.9999 နဲ႔ 35.0001 ၾကားက interval ျဖစ္ၿပီး အၾကမ္းျဖင္း 35 ပဲ ယူဆရေအာင္။<br><em>f(x)</em> ကေတာ့ ဘယ္ interval မွာ မဆိုရွိတဲ့ density ရဲ႔ function ျဖစ္ၿပီး 35 ဝန္းက်င္မွာ ဆိုရင္ ယူဆထားတဲ့ 0.3 ပါ။ <br><em>dx </em>ကေတာ့ Infinitesimal width ျဖစ္ၿပီး 0.0002 ပါ။<br><em>f(x)dx</em> က graph ေပၚမွာၾကည့္ရင္ area under the curve ပါ။ အဲ့ဒိကို x နဲ႔ ထပ္ေျမွက္ရပါတယ္။<br>ဒီေတာ့ အဲ့ဒီ interval အတြင္းမွာဆိုရင္ <em>x f(x)dx</em> ေျမွာက္တာက 35 x 0.3 x 0.0002 = 0.0021 ရပါတယ္။ Expected value ဆိုတာ အဲ့လို Infinitesimal interval ကို a နဲ႔ b ၾကားမွာ မေရမတြက္ႏိုင္ေအာင္ ခြဲၿပီး <em>x f(x) dx </em>တန္ဖိုးအားလံုးကို<em> integral sum </em>လုပ္ထားတဲ့ တန္ဖိုးကို ေျပာတာပါ။</p><h4>Variance</h4><p>Random Variable မွာ လဲ Variance ကို ရွာတာက ပံုမန္ Variance ရွာပံုနဲ႕ အတူတူပါပဲ။ တစ္ခုရွိတာက Average <em>μ </em>အစား <em>E(X) </em>ကို သံုးတယ္။ Variance Equation ကို အမ်ိဳးမ်ိဳး ေရးလို႔ရပါတယ္။ Equation ေတြကို ေသခ်ာနားလည္ေအာင္ အေျခခံ ကေန စၾကည့္ရေအာင္။</p><p><em>Variance </em>ဆိုတာကလဲ တကယ္ေတာ့ data point တစ္ခုခ်င္းစီ ရဲ႕ center point (<em>μ) </em>က အကြာေဝး 2 ထပ္ (squared difference) ကို Average ျပန္ယူထားတာပါ။ <a href="https://medium.com/@hammer7/measures-of-spread-basic-statistics-part-2-c6b812fac13b#1b5c">Part 2</a> မွာ ျပန္ၾကည့္ႏိုင္ပါတယ္။ ဒီေတာ့ အဲ့ဒီ Average ကို လဲ probability weighted sum နဲ႔ ျပန္တြက္ရပါတယ္။ Discrete အတြက္ဆိုရင္</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/388/1*_ENSSlbjsRd3Bn3_yqommw.png" /><figcaption>Variance of a <strong>Discrete</strong> random variable <em>X</em></figcaption></figure><p>where Var<em>(X)</em> = Variance of a Discrete random variable <em>X<br>N</em> = Number of possible values that X can take on<br><em>xᵢ</em> = Each possible values of <em>X<br>μ</em>ₓ = Expected Value of X<br><em>P(xᵢ)</em> = Probability of each possible values of <em>X</em></p><p>Continuous Random Variable အတြက္ဆိုရင္ေတာ့</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/431/1*MEgk3kpvyeg-2UR98qvf6A.png" /><figcaption>Variance of a <strong>Continuous </strong>random variable <em>X</em></figcaption></figure><p>where <em>Var(X)</em> = Variance of a Continuous random variable <em>X</em><br><em>[a, b]</em> = Continuous range that X can take on<br><em>x</em> = Values at each infinitesimal range between [<em>a, b</em>] of <em>X<br>μ</em>ₓ = Expected Value of X<br><em>f(x) dx</em> = Probability density at each infinitesimal range of width<em> dx</em> around <em>x</em></p><p>အဲ့ဒီ လို discrete အတြက္ တစ္ခု၊ Continuous အတြက္ တစ္ခု ခြဲ မေရးပဲ 2 ခုလံုးအတြက အဆင္ေျပေအာင္ ေအာက္မွာျပထားတဲ့ အတိုင္း Average (Probability weighted sum) ကို E နဲ႔ အစားထိုးၿပီး ေရးတတ္ပါတယ္။</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/344/1*qL1SfpHFTmSCpensMx4rJw.png" /><figcaption>Variance of a random variable <em>X</em></figcaption></figure><p>where <em>Var(X)</em> = Variance of a random variable <em>X<br>μ = E(X)</em>= Expected Value of X</p><p>ေနာက္တစ္မ်ိဳးကေတာ့ သာမန္ Variance ရဲ႔ <a href="https://medium.com/@hammer7/measures-of-spread-basic-statistics-part-2-c6b812fac13b#a3ff">Raw Score method</a> လိုပဲ Equation ကို ရွင္းခ်လိုက္ရင္ အရိုးရွင္းဆံုးနဲ႕ မွတ္ရ အလြယ္ဆံုး Equation ရပါတယ္။</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/339/1*QJ6LahGHskq6U8A53843LA.png" /><figcaption>Variance of a random variable <em>X</em></figcaption></figure><p>where <em>Var(X)</em> = Variance of a random variable <em>X<br>E(X)</em>= Expected Value of X</p><p>Raw Score method က Equation နဲ႔ ယွဥ္ၾကည့္ရင္ Average ကို expectation <em>E </em>နဲ႔ ေဖာ္ျပတာကလြဲလို႔ အတူတူပဲဆိုတာ ေတြ႕ ရပါလိမ့္မယ္။ အလြယ္ေျပာရရင္ Square အရင္တင္ၿပီး Expectation ရွာထားတဲ့ တန္ဖိုးကေန Expectation အရင္ရွာၿပီး Square တင္တဲ့ တန္ဖိုးကို ႏႈတ္ထားတာပါ။</p><blockquote>The variance of <em>X</em> is equal to the expected value of the square of <em>X</em> minus the square of the expected value of <em>X</em>.</blockquote><p>ဒီေနရာမွာ ေမးစရာက တကယ္လို႔ (E[X])² က E[X²] ထက္ႀကီးရင္ negative variance ထြက္လာမွာေပါ့။ Variance ဆိုတာ positive value ပဲျဖစ္သင့္တာ မဟုတ္လား။ <a href="https://en.wikipedia.org/wiki/Jensen%27s_inequality">Jensen’s inequality</a> က ဘယ္ convex function <em>φ </em>အတြက္မဆို</p><blockquote>φ(E[X]) ≤ E[φ(X)]</blockquote><p>လို႔ သက္ေသျပထားပါတယ္။ က်ေနာ္တို႔ function က <em>f(x)=x² </em>က convex function ပါ။ <em>f(E[X])</em> = <em>(E[X])² </em>≤ <em>E[f(X)]</em> = <em>E[X²] </em>ဆိုေတာ့ convex function ျဖစ္တဲ့ variance က negative မျဖစ္ႏိုင္ပါဘူး။ စဥ္းစားစရာ တစ္ခုက ေတာ့ Variance က ဘာေၾကာင့္ squared function သံုးတာလဲ။ ဘာေၾကာင့္ တျခား convex function မသံုးလဲဆိုတာလဲ ဆိုတာပါ။ ဥပမာ f(x)=x⁴ က လဲ convex function ပါပဲ။ ဒီအခ်က္ကို <a href="https://en.wikipedia.org/wiki/Moment_(mathematics)">Moments </a>အေၾကား ေဆြးေႏြးတဲ့ အခါ အနည္းငယ္ သေဘာေပါက္ႏိုင္မယ္လို႔ ယူဆပါတယ္။ အလ်င္းသင့္ရင္ ေဆြးေႏြးသြားပါမယ္။</p><h4>Standard Deviation</h4><p>Random variable တစ္ခုရဲ႔ Standard deviation ကေတာ့ Variance ကို square root ရွာလို႔ ရတဲ့ အေျဖပါပဲ။</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/196/1*xgsvofP9MBMLHBqz6PYJgw.png" /><figcaption>Standard Deviation of a Random Variable X</figcaption></figure><p>ဒီေလာက္ဆို Random Variable ရဲ႕ concepts ေတြ ေဆြးေႏြးတာ လံုေလာက္ၿပီထင္ပါတယ္။ လက္ေတြ႔ Python နဲ႔ ေရးၾကည့္ၾကရေအာင္။</p><h4>Time for Fun</h4><p>ဒီ coding exercise မွာ Discrete Random Variable (Rolling Dice example) ကို ေလ့လာၾကည့္ရေအာင္။ Dice အေရအတြက္ကို 2 ခုထက္ပိုၿပီး စမ္းႏိုင္ေအာင္ function argument အျဖစ္ထားမယ္။ ၿပီးရင္ theoretical distribution နဲ႔ empirical distribution 2 မ်ိဳး ႏွိင္းယွဥ္ၾကည့္မယ္။ Theoretical ကေတာ့ ျဖစ္ႏိုင္ေျခအားလံုး မ်ွမ်ွတတ က်တဲ့ (ဥပမာ 1 Dice ကို 6 ခါ လွိမ့္ရင္ 1, 2, 3, 4, 5, 6) situation ျဖစ္ၿပီး empirical ကေတာ့ က်ခ်င္ရာ random က်မယ့္ situation ျဖစ္တယ္။ ကဲ ေရးၾကည့္ၾကမယ္။</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/b1d32cb4536366b1c8108557d2eab63b/href">https://medium.com/media/b1d32cb4536366b1c8108557d2eab63b/href</a></iframe><p>ၿပီးရင္ Expected Value နဲ႔ Variance ကို အထက္က Equation အတိုင္း Implement လုပ္ရေအာင္။</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/71051e92a4c3935ec7bf8a44863cdda0/href">https://medium.com/media/71051e92a4c3935ec7bf8a44863cdda0/href</a></iframe><p>ၿပီးရင္ experiment run ၿပီး distribution ေတြကို matplotlib နဲ႕ ျပတဲ့ method ေရးမယ္။ seaborn ကေတာ့ graph ေတြ ပိုၾကည့္ေကာင္းေအာင္ ထည့္ထားတာပါ။ မထည့္လဲ ရပါတယ္။</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/6d6dcd10f031e79e3ebf4dc18a288079/href">https://medium.com/media/6d6dcd10f031e79e3ebf4dc18a288079/href</a></iframe><p>ၿပီးရင္ number of dices နဲ႔ number of trials ကို input ထည့္ၿပီး run ၾကည့္လို႔ ရပါၿပီ။ ဥပမာ</p><blockquote>diceroll_experiment(2, 1000)</blockquote><p>Number of trial ကို မ်ားလိုက္ရင္ Empirical ရဲ႕ Expected value နဲ႕ Variance က theoretical values ေတြဆီ ခ်ဥ္းကပ္သြားတာ ေတြ႔ ရမွာပါ။ ဒါဟာ Statistic အေရးႀကီးတဲ့ concept တစ္ခု ျဖစ္ၿပီး မွာ <a href="https://en.wikipedia.org/wiki/Law_of_large_numbers">Law of Large Numbers</a> လို ေခၚပါတယ္။</p><p>ပိုျမင္သာေအာင္ jupyter notebook မွာ ipython widgets နဲ႔ interactive run လို႔ ရပါတယ္။ Colab မွာ direct run လို႔ ရေအာင္ ဒါမွမဟုတ္ local Jupyter notebook ကို copy ကူး run ႏိုင္ေအာင္ ေအာက္မွာ code တင္ေပးထားပါတယ္။</p><p><a href="https://colab.research.google.com/drive/1s5shF2AkmbQpL2ZNyVQmdzekYrSXuenL">https://colab.research.google.com/drive/1s5shF2AkmbQpL2ZNyVQmdzekYrSXuenL</a></p><p>References</p><p><a href="https://www.khanacademy.org/math/statistics-probability">https://www.khanacademy.org/math/statistics-probability</a><br><a href="https://amsi.org.au/ESA_Senior_Years/SeniorTopic4/4e/4e_2content_4.html">https://amsi.org.au/ESA_Senior_Years/SeniorTopic4/4e/4e_2content_4.html</a><br><a href="https://ocw.mit.edu/courses/mathematics/18-05-introduction-to-probability-and-statistics-spring-2014/readings/">https://ocw.mit.edu/courses/mathematics/18-05-introduction-to-probability-and-statistics-spring-2014/readings/</a><br><a href="https://www.countbayesie.com/blog/2015/3/19/expectation-and-variance-from-high-school-to-grad-school">https://www.countbayesie.com/blog/2015/3/19/expectation-and-variance-from-high-school-to-grad-school</a><br><a href="https://mathinsight.org/probability_density_function_idea">https://mathinsight.org/probability_density_function_idea</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=415caf223fd9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Random Variables 1 (Basic Statistics Part 3)]]></title>
            <link>https://medium.com/@hammer7/random-variables-1-basic-statistics-part-3-20cff3074ceb?source=rss-c3e14d5432fb------2</link>
            <guid isPermaLink="false">https://medium.com/p/20cff3074ceb</guid>
            <category><![CDATA[statistics]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[myanmar]]></category>
            <dc:creator><![CDATA[Hlaing Min]]></dc:creator>
            <pubDate>Tue, 20 Aug 2019 03:37:20 GMT</pubDate>
            <atom:updated>2019-09-03T10:05:19.740Z</atom:updated>
            <content:encoded><![CDATA[<p><a href="https://medium.com/@hammer7/measures-of-spread-basic-statistics-part-2-c6b812fac13b">Part 2 </a>မွာ Variance ရဲ႔ additive property အ ေၾကာင္း ေဆြးေႏြးခဲ့တံုးက random variables X and Y ဆိုၿပီး သံုးခဲ့ ပါတယ္။ အဲ့ဒီတံုး က Random variables ကို ျဖစ္ႏိုင္ေျခ အားလံုးပါဝင္တဲ့ dataset လို႔ အလြယ္ တကူ အစားထိုး ေဆြးေႏြး ခဲ့ၾကပါတယ္။</p><p>ဒီ post မွာေတာ့ Random Variables ဆိုတာ ဘာလဲ ဆိုတာ အ ေသးစိတ္ ေဆြးေႏြး ၾကည့္ၾကရ ေအာင္။</p><blockquote>A random variable is a variable whose possible values are numerical outcomes of a random process.</blockquote><p>ပထမဦးဆံုး သတိျပဳေစခ်င္တာကေတာ့ variable ဆိုတာကို single numeric value တစ္ခုလို႔ မျမင္ပဲ a set of numeric values လို႔ ျမင္ေစခ်င္ပါတယ္။ Random Variables လို႔ ေျပာႏိုင္ဖို႔ ေအာက္ပါ 2 ခ်က္ ေျပလည္ရပါမယ္။</p><ol><li>Random process ျဖစ္ရမယ္။</li><li>Numeric outcomes ေသာ္လည္ေကာင္း numeric အျဖစ္ေျပာင္းလဲႏိုင္ေသာ outcomes ေသာ္ လည္ေကာင္းရွိရ မယ္။</li></ol><p>ဒီ 2 ခ်က္ ျပည့္စံုရင္ အဲဒီ process က ရလာတဲ့ outcomes ေတြကို Random Variables နဲ႔ ေဖာ္ျပႏိုင္ပါတယ္။ Single capital letter, e.g, X, Y စသည္ ျဖင့္ ေဖာ္ျပ ေလ႔ ရွိတယ္။ နားလည္လြယ္ေအာင္ ဥပမာေလးေတြနဲ႔ စဥ္းစားၾကည့္ရ ေအာင္။</p><h4>Random Variables Examples</h4><p><strong>Exmple 1: Single dice roll</strong> ဥပမာ ကို ျပန္ၾကည့္ရ ေအာင္</p><blockquote>Random process ျဖစ္ပါတယ္။ ✅<br>Possible numeric outcomes 6 ခု ရွိပါတယ္။, {1, 2, 3, 4, 5, 6}. ✅<br><strong>Random variable X = Upward face value after rolling a single dice</strong></blockquote><p><strong>Example 2:</strong> <strong>dice rolls 2 ခုရဲ႔ sum </strong>က ေရာ</p><blockquote>Random process ျဖစ္ပါတယ္။ ✅<br>Possible numeric outcomes 11ခု ရွိပါတယ္။, {2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12}. ✅<br><strong>Random Variable Y = Sum of upward face values after rolling 2 dices</strong></blockquote><p><strong>Example 3: ေခါင္းပန္း 5 ခါလွန္ၿပီး ေခါင္းက်မယ့္ အေရအတြက္</strong></p><blockquote>Random process ျဖစ္တယ္။ ✅<br>Possible numeric outcomes 6 ခု ရွိတယ္။ {0, 1, 2, 3, 4, 5} ✅<br><strong>Random Variable Z= number of Heads after 5 flips of a fair coin</strong></blockquote><p><strong>Example 4:</strong> <strong>မနက္ျဖန္ ရန္ကုန္မွာ ျဖစ္ႏိုင္မယ့္ အပူခ်ိန္</strong></p><blockquote>Random process ျဖစ္ပါတယ္။ ✅ <br>coin flip လုပ္ရင္ Heads or Tails ဘယ္သူမွ ႀကိဳ မခန္႔ မွန္းႏိုင္သလို မနက္ျဖန္ ရန္ကုန္ အပူခ်ိန္ ဘယ္သူမွ တိတိက်က် ႀကိဳ မ ေျပာႏုိင္ ပါဘူး။<br> Discrete values ေတြလို 35, 36, 37 စသည့္ျဖင့္ ေရ တြက္ လို႔ မရပါဘူး။ 35.0001 ျဖစ္ႏိုင္သလို 35.000001 လဲ ျဖစ္ႏိုင္တယ္။ Continuous possibilities ျဖစ္တဲ့ အတြက္ ျဖစ္ႏိုင္ေျခက infinite ပါ။ သို႔ ေသာ္ numeric outcome ရွိတယ္ဆိုတဲ့ အခ်က္ က ေတာ့ ျပည့္စံုပါတယ္။ ✅<br><strong>Random Variable T = Exact Celsius temperature in Yangon tomorrow</strong></blockquote><h3>Types of Random Variables</h3><p>Random Variables ကို<br>1. Discrete Random Variables နဲ႔<br>2. Continuous Random Variables ဆိုၿပီး 2 မ်ိဳးခြဲႏိုင္ပါတယ္။</p><h4>Discrete Random Variables</h4><p>Random Variables တစ္ခုရဲ႕ ျဖစ္ႏိုင္ေျခ outcome ေတြဟာ က ကြဲကြဲျပားျပား (distinct) ျဖစ္မယ္ တနည္းအားျဖင္႔ outcome ဘယ္ႏွစ္ခု ရွိတာကို ေရတြက္ႏိုင္တယ္ဆိုရင္ အဲ့ဒီ Random Variables ကို Discrete Random Variables လို႔ ေခၚပါတယ္။ Example 1, 2, and 3 ဟာ Discrete Random Variables ပါ။ single dice roll ဥပမာမွာဆိုရင္ ျဖစ္ႏိုင္ေျခ outcomes ေတြက {1, 2, 3, 4, 5, 6} ဆိုၿပီး 6 ခု ကြဲကြဲျပားျပား ရွိတယ္။</p><h4>Continuous Random Variables</h4><p>Continuous Random Variables က ေတာ့ outcomes ေတြက interval တစ္ခုအတြင္းမွာ ဘယ္ numeric number မဆိုျဖစ္ႏိုင္ပါတယ္။ တနည္းအားျဖင့္ဆိုရင္ outcome ဘယ္ႏွစ္ခုလဲဆိုတာ ေရတြက္ဖို႔ မျဖစ္ႏိုင္ပါဘူး။ အထက္က ေျပာထားတဲ့ Example 4 (မနက္ျဖန္ ရန္ကုန္မွာ ျဖစ္ႏိုင္မယ့္ အပူခ်ိန္) ဟာ Continuous Random Variables ပါ။ ဥပမာ အပူခ်ိန္ 35 က ေန 36 အတြင္းမွာကို ျဖစ္ႏိုင္ေျခ ဒသမ ကိန္း မ ေရမတြက္ႏိုင္ေအာင္ ကို ရွိေနပါတယ္။</p><p>Example ေလးေတြ ထပ္ေလ့လာၾကည့္ရ ေအာင္။</p><p><strong>Example 5: မနက္ျဖန္ ရန္ကုန္ၿမိဳ႕မွာ ရွိမယ့္ လူဦးေရ အ ေရအတြက္</strong></p><blockquote>Random Process ျဖစ္ပါတယ္။ မနက္ျဖန္ ရန္ကုန္မွာ ဘယ္ႏွစ္ေယာက္ရွိမယ္ဆိုတာ ဘယ္သူမွ ႀကိဳမသိႏိုင္ပါဘူး။ ✅<br>Numeric Outcome ရွိတယ္။ ✅<br>Distinct Outcome ရွိတယ္။ 4 သန္းျဖစ္ခ်င္င္ျဖစ္မယ္။ 4,340,425 ျဖစ္ခ်င္္ျဖစ္မယ္။ 10 ေယာက္ပဲလဲျဖစ္ခ်င္ျဖစ္မယ္။ ျဖ စ္ႏိုင္ေျခ outcomes အ ေရ အတြက္ေပါင္း ေသခ်ာ မသိေပမယ့္ ေရတြက္လို႔ ရတယ္။<br><strong>Discrete Random Variable</strong> ျဖစ္ပါတယ္။</blockquote><p><strong>Example 6: Next Olympic မွာ တာတိုအ ေျပးခ်န္ပီယံ ပန္းဝင္မယ့္ ၾကာခ်ိန္</strong></p><blockquote>Random Process ျဖစ္ပါတယ္။ ဘယ္သူမွ ႀကိဳမသိႏိုင္ပါဘူး။ ✅<br>Numeric Outcome ရွိတယ္။ ✅<br>Distinct Outcome မရွိပါဘူး။ 9.58 seconds ျဖစ္ခ်င္ျဖစ္မယ္။ 9.581 , 9.58001 seconds စသည္ျဖင့္ ျဖစ္ႏိုင္ေျခ မ ေရႏိုင္ေအာင္ ရိွပါတယ္။<br><strong>Continuous Random Variable</strong> ျဖစ္ပါတယ္။</blockquote><p>ဒီေလာက္ဆို Random Variables ဆိုတာ ဘာလဲလို႔ သိၿပီထင္ပါတယ္။ ဒါဆို ဘာလို႔ ဒီလို အလုပ္ရႈပ္ခံၿပီး definition လုပ္ထားတာလဲ၊ ဘာေၾကာင့္အသံုးဝင္လို႔လဲ ဆိုတာ ေလ့လာၾကည့္ ၾကရ ေအာင္။</p><h4>Notations ေတြ ေရးရာမွာ လြယ္ကူေစတယ္။</h4><p>ပထမဆံုး အသံုးဝင္တာကေတာ့ probability မွာ notation လြယ္လြယ္ကူကူ ေရးႏိုင္တာပါ။ Statistics ကုိ ေလ့လာရင္ probability ကို ဖယ္ထားလို႔ မရပါဘူး။</p><p>Probability event တစ္ခုမွာ outcome ရဲ႔ ျဖစ္တန္စြမ္းကို ေျပာရင္ P(outcomes) စသည္ျဖင့္ ေျပာပါတယ္။ ဥပမာ ရန္ကုန္ မနက္ျဖန္ အပူခ်ိန္ 35 degree C နဲ႔ ေအာက္ ေရာက္ႏိုင္ေျခ ကို ေဖာ္ျပရင္ P(Exact Celsius temperature in Yangon tomorrow<strong> </strong>≤ 35) ဆို ၿပီး ေျပာရတယ္။ ဒါကို Random Variable T နဲ႔ assign လုပ္ထားၿပီးရင္ clearer notation နဲ႕ P(T ≤ 35) ဆိုၿပီး ေရးႏိုင္ပါတယ္။ P(30≤ T ≤ 35) လိုမ်ိဳး ပို ရႈပ္တဲ့ probability outcomes ေတြကို အလြယ္တကူ ေဖာ္ျပႏိုင္လာတယ္။</p><p>တကယ္လို႔ သင္က ဒါဟာ notation ကို trick လုပ္ထားတာ statistical benefit တ ကယ္ မရွိပါဘူးဆိုရင္ မျငင္းႏိုင္ပါဘူး။ သို႔ ေသာ္ Mathematical constant π ကို ဘယ္သူမွ the ratio of a circle’s circumference to its diameter လို႔ equation ေတြမွာ ထည့္ မ ေရးဘူး ဆိုတာကို သတိျပဳ ေစ ခ်င္ပါတယ္။</p><h4><strong>Sample space ေပၚက function ျဖစ္တယ္။</strong></h4><p>Example 2 မွာ <strong>Random Variable Y = Sum of upward face values after rolling 2 dices </strong>လို႔ define လုပ္ခဲ႔ တယ္။ {2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12} ဆိုၿပီး possible numeric outcomes 11 ခု ရွိတယ္ ေျပာပါတယ္။ ဒါေပမယ့္ ဒီ Random process (rolling 2 dices) မွာ ျဖစ္ႏိုင္ေျခ outcomes အားလံုး (တနည္းအားျဖင့္ ေျပာရင္ sample space) က ဘာလဲ။ ေအာက္မွာ ျပထားသလို outcome 6² = 36 ခုရွိပါတယ္။</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/808/1*CTupHnkJq_itir2LC1id3A.png" /></figure><p>တခ်ိဳ႕ random process ေတြမွာ sample space က သန္းခ်ီ ရွိတတ္ပါတယ္။ သို႔ေသာ္ က် ေနာ္တို႕ က sample space တစ္ခုလံုးကို စိတ္ဝင္စားေလ့ မရွိပါဘူး။ သူ႔ အ ေပၚမွာ တဆင့္ တြက္ထားတဲ့ function ရဲ႔ numeric outcomes ကို သာ စိတ္ဝင္စားတာပါ။ Example 2 က Random Variables Y မွာ ဆို sum function ေပါ့။ ဒီေတာ့ မလိုတာေတြကို အလိုလို ပယ္ၿပီးသားျဖစ္သြားပါတယ္။ ေနာက္ပိုင္း inferential statistics မွာ Random Variables ေတြက လြယ္ကူ ေစတာ ေတြ႔ ရမွာပါ။<br> ဒီေနရာမွာ တစ္ခု သတိျပဳရမွာက outcomes ေတြရဲ႔ probability မတူေတာ့တာပါပဲ။</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*K6P9VdXmfuNp0oF2LVha2w.png" /><figcaption><strong>Sample Space, Random Variable and Probability Distribution</strong></figcaption></figure><p>မတူတဲ့ probability ကို distribution ေတြနဲ႔ ေဖာ္ျပ ေလ႔ ရွိတယ္။ ေနာက္ post မွာ အက်ယ္ ေဆြးေႏြးပါမယ္။</p><h4>သခ်ၤာ လုပ္ထံုးေတြကို Random variables ေပၚမွာ သံုးႏိုင္တယ္</h4><p>အထက္မွာ ေျပာသလို random variables က sample space ရဲ႔ function ျဖစ္တဲ႔ အတြက္ Math function ေတြကို apply လုပ္ႏိုင္ပါတယ္။ Example 4 က <strong>Random Variable T </strong>မွာဆိုရင္ sample တစ္ခုခ်င္း ျဖစ္ႏိုင္ေခ် ေတြ စဥ္းစားစရာ မလိုေတာ့ပဲ continuous function ျဖစ္တဲ့ အတြက္ probability density function တြက္ႏိုင္၊ integral calculus သံုးၿပီးရင္ P(30≤ T ≤ 35) လို probability values မ်ိဳးကို ရွာႏိုင္ပါတယ္။<br>ေနာက္ၿပီး Variance ရွာမယ္။ Expectation ရွာမယ္ ဆိုရင္လဲ Random variables နဲ႔မွ အဆင္ေျပပါတယ္။</p><p>ဒီေလာက္ဆို Random Variables အ ေျခခံ အၾကမ္းျဖင္း ေဆြးေႏြးၿပီးၿပီလို႔ ယူဆပါတယ္။ ေနာ က္ ပို႔ မွာ Random Variables ရဲ႔ Concepts ေတြကို ဆက္ၿပီး ေဆြးေႏြးသြားပါမယ္။</p><p>Part 4 (Random Variables 2) ကို ဆက္ဖတ္မယ္ဆိုရင္</p><p><a href="https://medium.com/@hammer7/random-variables-2-basic-statistics-part-4-415caf223fd9">Random Variables 2 (Basic Statistics Part 4)</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=20cff3074ceb" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Measures of spread (Basic Statistics Part 2)]]></title>
            <link>https://medium.com/@hammer7/measures-of-spread-basic-statistics-part-2-c6b812fac13b?source=rss-c3e14d5432fb------2</link>
            <guid isPermaLink="false">https://medium.com/p/c6b812fac13b</guid>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[statistics]]></category>
            <category><![CDATA[myanmar]]></category>
            <dc:creator><![CDATA[Hlaing Min]]></dc:creator>
            <pubDate>Sun, 18 Aug 2019 10:55:59 GMT</pubDate>
            <atom:updated>2019-09-02T07:58:58.046Z</atom:updated>
            <content:encoded><![CDATA[<p><a href="https://medium.com/@hammer7/measures-of-central-tendency-basic-statistics-part-1-935e24495ed3">Part 1 </a>မွာ က် ေနာ္ တို႔ Measures of central tendency ကို ေလ့လာခဲ့ ၾကပါတယ္။ ဒီ post မွာ ေတာ့ Central tendency measures တစ္ခုထဲ သံုးရင္ ဘာေၾကာင့္ မလံုေလာက္တာလဲ ဆိုတာ နဲ႔ သူနဲ႕ တြဲ ဖက္ သံုးေလ႔ ရွိတဲ့ Measures of spread လို႕ ေခၚတဲ့ ျပန္႕ ႏွံ႔ မႈ႔ (တနည္းအားျဖင့္ စုစည္းမႈ႔) ျဖင့္ တိုင္းတာျခင္း ကို ေဆြး ေႏြး ခ်င္ပါတယ္။</p><h3><strong>Measures of Spread</strong></h3><p>ဥပမာ {-10, 0, 10, 20, 30} နဲ႔ {8, 9, 10, 11, 12} ဆိုၿပီး dataset 2 ခုရွိတယ္ ဆိုပါစို႔ ။ Central tendency measures တစ္ခု ျဖစ္တဲ့ arithmetic mean ကို တြက္ ၾကည့္ရင္ (-10+0+10+20+30)/5 = 10 နဲ႔ (8+9+10+11+12)/5 = 10 ဆိုၿပီး 2 ခုလံုးကို value 10 နဲ႔ ကိုယ္စားျပဳတာကို ေတြရမယ္။ ဒါေပမယ့္ ပထမ dataset မွာ values ေတြက ေဝးကြာ ေနကာ ဒုတိယ dataset မွာေတာ့ နီးကပ္ စြာရွိၾကၿပီး spread မတူတာကို ေတြ႔ ႏိုင္ပါတယ္။ ဒီလို႔ Central tendency နဲ႕ မ ေဖာ္ျပႏိုင္တဲ့ characteristic ကို Measures of spread နဲ႔ ေဖာ္ျပႏိုင္ပါတယ္။ Measures of spread မွာ လည္း နည္း အမ်ိဳးမ်ိဳး ရွိပါတယ္။</p><h4>Range</h4><p>နားလည္ အလြယ္ ဆံုး Measures of spread က ေတာ့ Range ပါ။ Range ဆိုတာ အႀကီး ဆံုး (Max) နဲ႔ အ ေသးဆံုး (Min) data point ရဲ႕ ျခားနားခ်က္ပါ။ ထပ္ ရွင္းျပစရာ မလို ေအာင္ နားလည္ လြယ္ပါတယ္။ အထက္ က datasets 2 ခု ရဲ႔ Rangeေတြကိုတြက္ ၾကည့္လိုက္ရင္ 40 နဲ႔ 4 အသီးသီး ရပါတယ္။</p><figure><img alt="Range" src="https://cdn-images-1.medium.com/max/884/1*ltpbM9vA9meknZJNl-XTsg.png" /><figcaption><strong>Range</strong></figcaption></figure><p>where <em>X</em> = Data set</p><p>Range က လြယ္ကူတဲ့ spread တြက္နည္းျဖစ္ေပမယ့္ အားနည္းခ်က္ေတြရွိပါတယ္။ ပထမ အားနည္းခ်က္ က ေတာ့ တည္မွတ္ (Center point) မရွိတာပါပဲ။ ဘယ္ေနရာကို တည္မွတ္ထားၿပီး ျပန္႔ ႏွံ႔ တာလဲ (သို႕ စုစည္းတာလဲ) ဆိုတာကို မ ေဖာ္ ျပႏိုင္ပါဘူး။ ဒုတိယအားနည္းခ်က္က ေတာ႔ Max နဲ႕ Min values 2 ခုပဲ သံုးထားၿပီး တျခား data points ေတြကို ignore လုပ္ထားတာပါ။ ဒီေတာ့ data points တစ္ခုခ်င္းစီရဲ႕ spread ကို မ ေဖာ္ ျပႏိုင္ပါဘူး။ ေနာက္တစ္ခုက ေတာ့ outliers ရဲ႕ လြွမ္းမိုးမႈ႕ ကို ခံရတာပါပဲ။ Central tendency measures က Mid-Range မွာလိုပဲ Efficiency ေရာ Robustness ပါ အားနည္းပါတယ္။</p><p>ဒီေတာ့ data points အားလံုးရဲ႕ spread ကို ေဖာ္ေဆာင္ႏိုင္ ၿပီးေတာ့ တည္မွတ္ ကို လဲ သတ္မွတ္ႏိုင္တဲ့ ေနာက္ထပ္ နည္းလမး္ေတြလုိလာပါတယ္။</p><h4><strong>Better approaches for spread measures</strong></h4><p>က် ေနာ္တို႕ လိုခ်င္တာက အထက္မွာ ေျပာသလို တည္မွတ္တခု လိုခ်င္တယ္။ ၿပီးေတာ့ data points တခုခ်င္းစီရဲ႕ spread ကိုလည္း တနည္းနည္းနဲ႔ summary ထဲမွာ ပါဝင္ခ်င္တယ္။ စဥ္းစားၾကည့္ရ ေအာင္။</p><p>တည္မွတ္ (Center point) အတြက္က ေတာ့ အသံုး အမ်ားဆံုး Central tendency measure ျဖစ္တဲ့ Arithmetic mean ကို ယူၾကရ ေအာင္။ ၿပီးရင္ data point တစ္ခုခ်င္းစီက Mean နဲ႔ ဘယ္ေလာက္ ေဝးလဲ (distance from Mean) တြက္ ၿပီး အဲ့ဒီ values ေတြ ရဲ႕ ပ်မ္းမ်ွ (Arithmetic mean) ျပန္ယူရင္ က် ေနာ္ တို႕ လိုခ်င္တဲ့ အခ်က္အားလံုး ပါဝင္ပါတယ္။ အဲ အဲ့ဒီမွာ သတိျပဳစရာ တစ္ခု ရွိတယ္။ ဥပမာ {2, 4, 6} ဆို တဲ့ dataset မွာ Mean က 4. တစ္ခုခ်င္းစီရဲ႕ distance from Mean က {2-4, 4-4, 6-4} ဆိုေတာ့ {-2, 0, 2} ပါ။ Arithmetic mean of {-2, 0, 2} က 0 ပါ။ Dataset မွာ spread ရွိေသာ္လဲ 0 အ ေျဖ ရပါတယ္။ ဘယ္ ဘက္ spread (-2) နဲ႔ ညာဘက္ spread (+2) ေခ် လိုက္သလို ျဖစ္သြားလို႔ ပါ။ က် ေနာ္ တို႔ တကယ္ လိုခ်င္တာက distance value ပဲ လိုခ်င္တာ။ Direction မလိုပါဘူး။ အဲ့ဒီေတာ့ Negative value (direction) ကို ေဖ်ာက္ ရ ပါမယ္။ ဘယ္လို လုပ္မလဲ။ 2 နည္းရွိပါတယ္။</p><h4>Mean Absolute Deviation</h4><p>Direction မပါေစတဲ့ အရိုးရွင္းဆံုးက ေတာ့ absolute value ယူလိုက္တာပါပဲ။ -2 ဆိုရင္ 2 လို႔ ယူမယ္။ 2 ဆိုရင္လဲ 2 လို႔ ယူမယ္။ Mean absolute deviation လို ခေၚပါတယ္။ ရိုးရွင္းၿပီး natural က် တယ္ ထင္ ရ ေပမယ့္ ဒုတိယနည္း Variance နဲ႔ သူ႔ ရဲ႕ အႏြယ္ Standard Deviation ေလာက္ powerful မျဖစ္ပါဘူး။</p><p>{2, 4, 6} ဥပမာမွာ Mean absolute deviation = (2 + 0 + 2)/3 = 4/3</p><figure><img alt="Mean Absolute Deviation" src="https://cdn-images-1.medium.com/max/696/1*XUapuRxxVTcYYMlZe26Ktw.png" /><figcaption><strong>Mean Absolute Deviation</strong></figcaption></figure><p>where<em> MAD </em>= Mean Absolute Deviation<br><em>N</em> = Number of data points in the data set<br><em>xᵢ = </em>Each data point in the data set<em><br></em> <em>μ</em><strong><em> </em></strong>= Arithmetic Mean</p><h4>Variance</h4><p>ဒုတိယ နည္း က ေတာ့ direction မပါေအာင္ Squared value ကို ယူတာပါ။ -2 ဆိုရင္ 4 လို႔ ယူမယ္။ 2 ဆိုရင္ လဲ 4 လို႔ ယူမယ္။ Variance က ဒီနည္းကို သံုးပါတယ္။ ဘာေၾကာင့္ Mean absolute deviation ထက္ ပိုၿပီး အသံုးဝင္သလဲ ဆိုတာ ေအာက္မွာ အက်ယ္ ေဆြးေႏြးပါမယ္။<br>{2, 4, 6} ဥပမာမွာ Variance = (2² +0²+ 2²)/3 = 8/3</p><figure><img alt="Population Variance" src="https://cdn-images-1.medium.com/max/916/1*Bx-H_iX7PL-X9Qz36Id20g.png" /><figcaption><strong>Population Variance</strong></figcaption></figure><p>where<em> </em><strong><em>σ² = Var(X) </em></strong>= Variance of the <em>population</em><br><em>N</em> = Number of data points in the <em>population</em><br><em>xᵢ =</em> Each data point in the<em> population<br></em> <em>μ</em><strong><em> </em></strong>= Arithmetic Mean of the <em>population</em></p><p>ဒီေနရာမွာ Population နဲ႕ Sample ကို ကြဲ ကြဲျပားျပား သိဖို႕ လိုပါတယ္။ population ဆိုတာ dataset တစ္ခုလံုးကို ေျပာတာျဖစ္တယ္။ အပိုင္း (၁) က ဥပမာမွာလို ရန္ကုန္က ေၾကာင္အားလံုး (Population) ရဲ႕ ပ်မ္းမ်ွ အသက္လိုခ်င္ရင္ အားလံုးကို လိုက္ေကာက္ဖို႔ မျဖစ္ႏိုင္တဲ့အတြက္ အနည္းငယ္ random sample အႀကိမ္ ႀကိမ္ ေကာက္ၿပီးတိုင္းရတယ္။ Population တစ္ခုလံုးရဲ႕ measures (e.g, mean, variance) ေတြ ကို population parameters လို႕ ေခၚ ၿပီး Sampling processing တစ္ခုက ရလာတဲ့ measures ေတြကိုေတာ့ sample statistics ေတြ လို႕ ေခၚပါတယ္။</p><p>Variance definition မွာ population variance နဲ႕ sample variance နဲ႕ မတူပါဘူး။ အဓိက ကေတာ့ 1/N အစား 1/(n-1) ကို သံုးတာပါ။</p><p><strong><em>X</em></strong> က sample (portion of dataset), <strong><em>x</em></strong> က sample data point တစ္ခုခ်င္းစီ, <strong><em>n </em></strong>က data point အ ေရ အတြက္, <strong>x̄ </strong>က sample mean ဆိုရင္ <em>S</em><strong><em>²</em></strong> သို႔<strong><em>Var(X) </em></strong>ရဲ႔ definition ကို ေအာက္ပါအတိုင္း ေဖာ္ ျပႏိုင္ပါတယ္။</p><figure><img alt="Sample Mean" src="https://cdn-images-1.medium.com/max/990/1*vjv6JG_Ve3IyNZZOTx8EFQ.png" /><figcaption><strong>Sample Variance</strong></figcaption></figure><p>where<em> S</em><strong><em>² = Var(X) </em></strong>= Variance of the <em>sample</em><br><em>N</em> = Number of data points in the <em>sample</em><br><em>xᵢ =</em> Each data point in the <em>sample<br></em> <em>x̄</em><strong><em> </em></strong>= Arithmetic Mean of the <em>sample</em></p><p>ဘာေၾကာင့္ N အစား (n-1) ကိုသံုးၿပီး ပိုႀကီးတဲ့ Value ကို ရ ေစ သလဲဆိုတဲ့ Intuition ကိုေတာ့ ေနာက္မွ အလ်င္းသင့္ သလို ေဆြး ေႏြးခ်င္ပါတယ္။</p><p>ေနာက္တစ္ခုက Variance ကို Programming ေရးၿပီး တြက္ ရင္ dataset တစ္ခုလံုးကို looping တစ္ခါ အရင္ ပတ္ၿပီး Mean (<strong><em>μ</em></strong>) ကို ရွာရတယ္။ ၿပီးရင္ loop ေနာက္တစ္ႀကိမ္ ထပ္ပတ္ၿပီး (<strong><em>xᵢ-μ</em></strong>)<strong>² </strong>ကိုထပ္ရွာရတယ္။ Efficient မျဖစ္သလို တစ္ခါတစ္ရံမွာ (ဥပမာ dataset က Python generator function က လာတာမ်ိဳးဆိုရင္) looping 2 ခါ ပတ္ဖို႕ မျဖစ္ႏိုင္ပါဘူး။ အဲ့ လို အ ေျခအ ေနမ်ိဳး ဆိုရင္ ေနာက္ Equation တစ္ခုကို သံုးပါတယ္။</p><p>Original equation မွာ (<strong><em>xᵢ</em></strong> <strong>-<em>μ</em></strong>)<strong>²</strong> ကို အက်ယ္ျဖန္႔ ၿပီး ရွင္းခ် လိုက္ရင္ ေအာက္က Equation အသစ္ကို ရတယ္။</p><figure><img alt="Population Variance (Raw Score method)" src="https://cdn-images-1.medium.com/max/967/1*wjRoAMRqtRqBCjWIuT1zaA.png" /><figcaption><strong>Population Variance (Raw Score method)</strong></figcaption></figure><p>where<em> </em><strong><em>σ² = Var(X) </em></strong>= Variance of the <em>population</em><br><em>N</em> = Number of data points in the <em>population</em><br><em>xᵢ =</em> Each data point in the<em> population<br></em> <em>μ</em><strong><em> </em></strong>= Arithmetic Mean of the <em>population</em></p><p>ဒီ Equation ကို Raw score method လို႔ ေခၚတယ္။sum squared of <strong><em>xᵢ </em></strong>နဲ႕ sum of <strong><em>xᵢ </em></strong>ကို Looping တစ္ခုထဲနဲ႕ accumulate လုပ္ ေပါင္းသြားႏိုင္တာျဖစ္လို႔ ေနာက္ဆံုးအဆင့္မွာမွ <strong><em>μ </em></strong>ကို တြက္ၿပီး Variance ကို ရႏိုင္ပါတယ္။ လိုအပ္ရင္ အင္မတန္ အသံုးဝင္တဲ့ နည္းပါ။</p><p>Formula derivation ကိုသိခ်င္ရင္ေတာ့ ေအာက္မွာ Sal Khan ရွင္းျပထားတာကို ၾကည့္ႏိုင္ပါတယ္။</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FsRVGcYGjUk8%3Ffeature%3Doembed&amp;url=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DsRVGcYGjUk8&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FsRVGcYGjUk8%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="640" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/8730b2e798d0daf5129c315492d8ce2e/href">https://medium.com/media/8730b2e798d0daf5129c315492d8ce2e/href</a></iframe><h4>Standard Deviation</h4><p>Standard Deviation ဆိုတာ squared root of Variance ပါ။</p><p>Variance formula အရ data point တစ္ခုခ်င္းစီ က mean ကို ႏႈတ္ၿပီးရင္ square တင္ပါတယ္။ တစ္ကယ္လို႕ data point ေတြမွာ unit ေတြ ရွိတယ္ဆိုပါစို႕ ။ ဥပမယ္ လူေတြ ရဲ႕ အရပ္အျမင့္ ေဖာ္ျပတဲ့ dataset မွာ Mean value ရဲ႕ ယူနစ္က meter ျဖစ္ၿပီး Variance က formula အရ ယူနစ္ က squared meter ျဖစ္ပါမယ္။ Spread တန္ဖိုးကို Mean value နဲ႕ ယူနစ္ တူေစခ်င္ရင္ squared root ျပန္ရွာေပးရမယ္။ အဲ့ဒီ သ ဘောပါပဲ။</p><figure><img alt="Population Variance" src="https://cdn-images-1.medium.com/max/455/1*7gVhDzHLtuV9I2xirxMRTQ.png" /><figcaption><strong>Standard Deviation</strong></figcaption></figure><p>where<em> </em><strong><em>σ </em></strong>= Standard deviation of the <em>population</em><br><em>Var(X)</em> = Variance of the <em>population</em></p><p>ၿပီးေတာ့ Variance က outliers ရဲ႔ လြမ္းမိုးမႈ႔ ရွိပါတယ္။ ဥပမာ outliers က mean ကေန 10 unit ေဝးရင္ variance မွာ 100 units အထိ လြမ္းမိုးႏိုင္တယ္။ SD ရဲ႔ unit က original data ရဲ႔ unit နဲ႔ တူတဲ့ အျပင္ outlier ရဲ႔လြမ္းမိုးမႈ႔ နည္းတဲ့ အတြက္ Robust ပို ျဖစ္ၿပီး လက္ေတြ႔ မွာ ပို အသံုးမ်ားပါတယ္။</p><p>ဒီေလာက္ဆိုရင္ Measures of spread အ ေၾကာင္း ေဆြးေႏြးတာ အ ေတာ္ ျပည့္စံုၿပီထင္ပတယ္။ ေနာ က္ ဆံုး တစ္ခုက ေတာ့ အထက္မွာ ေျပာထားတဲ့ ဘာေၾကာင့္ Variance က Mean absolute deviation ထက္ ပို ၿပီးေတာ့ အသံုးဝင္ သလဲ ဆိုတာ ေဆြး ေႏြး ၾကည့္ရေအာင္။</p><h4>Why Variance is more preferred option than MAD</h4><p>ဘာေၾကာင့္ MAD အစား Variance ကို ပိုသံုးသလဲ ဆိုတာ internet မွာ ရွာၾကည့္ရင္ အျမင္ အ ေတာ္ မ်ားမ်ားကို ေတြ႕ ရမွာပါ။</p><ol><li>The squared difference in variance is a continuous differentiable function.</li><li>Variance is the second moment in Statistics. (Mean is the first moment)</li><li>Variance plays a unique role in central limit theorem.</li><li>etc…</li></ol><p>စသည္ျဖင့္ ေတြ ရမွာပါ။ ဒါေတြအားလံုးက မွန္ေသာ္ လည္း Statistics ကို Basic က ေန ေလ႔ လာတဲ့ သူ တစ္ေယာက္ ကို စိတ္ေက်နပ္ ေလာက္တဲ့ နားလည္မႈ႕ မ ေပးႏိုင္ပါဘူး။</p><p>လက္ေတြ႕ က်တဲ့ နည္းလမ္းနဲ႕ ေဆြးေႏြးၾကည့္ရေအာင္။</p><p>Variance properties ေတြ ထဲမွာ Additive property လို႕ ေခၚတဲ့အင္မတန္ အသံုးဝင္တဲ့ property တစ္ခုရွိပါတယ္။</p><p><strong>For <em>independent </em>random variables <em>X</em> and <em>Y</em>, the variance of their sum is the sum of their variances. </strong>Equation နဲ႕ တိုတို ေျပာရရင္</p><blockquote><strong><em>Var(X + Y) = Var(X) + Var(Y)</em></strong></blockquote><p>က် ေနာ္တို႕ Random Variables အ ေၾကာင္းမ ေဆြးေႏြးရ ေသး ဘူးဆိုေတာ့ random variables ဆိုတာ all possibles outcome of an event ကို ကိုယ္စားျပဳထားတဲ့ dataset လို႔ အစားထိုး ယူဆၾကရေအာင္။ ဥပမာ Dice roll ဆိုပါစို႔။ ပထမ dice X roll ရင္ dataset X က ျဖစ္ႏိုင္ေျခ outcome အားလံုးပါတဲ့ {1, 2, 3, 4, 5, 6}. ဒုတိယ dice Y roll ရင္ dataset Y က ျဖစ္ႏိုင္ေျခ outcome အားလံုးပါတဲ့ {1, 2, 3, 4, 5, 6}.</p><p>ဒီမွာ အ ေရးႀကီးတဲ့ keyword က <strong>independent</strong> ပါ။ Dice X ရဲ႕ outcome နဲ႔ Dice Y ရဲ႕ outcome က တစ္ခုနဲ႔ တစ္ခု လြမ္းမိုးမႈ႔ မရွိရပါဘူး။ လြမ္းမိုးမႈ႔ရွိ (independent မျဖစ္) ခဲ့ ရင္ ဒီ equation က မမွန္ေတာ့ပါဘူး။</p><p>ပထမဦးဆံုး Dice တစ္ခုျခင္းကို လွိမ္႔ ရင္ ရမယ့္ Mean, Variance နဲ႔ MAD ကို တြက္ၾကည့္ၾကရ ေအာင္။ လြယ္ကူေအာင္ Python နဲ႔ ေရးၾကည့္မယ္။</p><p>လုိအပ္တဲ့ function ေတြကို အရင္ define လုပ္ပါမယ္။</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/79c6dd5543bd28609a899d31ab9963e4/href">https://medium.com/media/79c6dd5543bd28609a899d31ab9963e4/href</a></iframe><p>ၿပီးရင္ dice X နဲ႔ dice Y အတြက္ ျဖစ္ႏုိင္တဲ့ outcomes ေတြကို define လုပ္ၿပီး mean, variance and MAD ကို တြက္ၾကည့္ၾကရ ေအာင္</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/5f5dc4cc98ee7bdc5409ec3c4160a5a8/href">https://medium.com/media/5f5dc4cc98ee7bdc5409ec3c4160a5a8/href</a></iframe><p>Dice X ေရာ Dice Y ေရာ က ျဖစ္ႏိုင္တဲ့ outcome 6 ခု {1, 2, 3, 4, 5, 6} ဆိုေတာ့ တစ္ခုခ်င္းစီ လွိမ့္ လိုက္ရင္ ေအာက္က အတိုင္း ေတြ႔ ရမွာပါ။</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/790/1*GU2XJjjrzjCJ-o05sAGoYA.png" /><figcaption><strong>Population parameters of Single Dice Roll (X and Y)</strong></figcaption></figure><p>ဒါဆို Dice X and Dice Y ကို အတူတူ လွိမ့္ ၿပီး distributions ေတြကို ေပါင္းၾကည့္ရင္ ျဖစ္ႏုိင္ေျခ က 36 ခုဆိုတာ ေတြ႕ ရမွာ ပါ။</p><p>distribution ေတြ ေပါင္းတယ္ ဆိုတာ ငယ္ငယ္က Monopoly ေဆာ့ရင္ အံစာတံုး 2 တံုး လွိမ့္ၿပီး ေပါင္းလဒ္ကို outcome အျဖစ္ ယူတာကို ေျပာတာပါ။ ဥပမာ (1, 1) = 2, (6, 6) = 12 ေပါ့။</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/50b027c110732dc0e047af1c49023fbd/href">https://medium.com/media/50b027c110732dc0e047af1c49023fbd/href</a></iframe><p>အ ေျဖမွာ ျဖစ္ႏိုင္ေျခ outcomes pairs ေရာ။ ေနာက္ၿပီး ေပါင္းလိုက္ရင္ ရမယ့္ outcomes ေရာ print ထုတ္ျပထားပါတယ္။</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/856/1*8mNRUprspC5w4PxQcgICCg.png" /><figcaption><strong>Population parameters of Sum of 2 Dices Roll (X + Y)</strong></figcaption></figure><p>ဒီ အ ေျဖ ၂ ခု ကို ၾကည့္ရင္ <strong><em>Var(X + Y) = Var(X) + Var(Y) </em></strong>ဆိုတာကို ထင္ထင္ရွားရွား ျမင္ရမွာပါ။</p><p>2.917 + 2.917 = 5.834. (3 decimal places ထိပဲယူထားလုိ႔ 5.833 ျပတာပါ။)</p><p>Variance မွာ အဲ့ဒီ property ရွိေပမယ့္ MAD မွာ မရွိတာကို ေတြ႔ ႏိုင္ပါတယ္။ ဒီေတာ့ distribution (dataset) တစ္ခုခ်င္းစီ ရဲ႔ MAD ကို သိေသာ္လည္း distribution 2 ခု ေပါင္းရဲ႕ MAD ကို လြယ္လြယ္ကူကူ မရွာႏိုင္ပါဘူး။</p><p>ဒီ Properties ကို တစ္ခါတစ္ရံ Pythagorean Theorem of Statistics လိုလဲ ေခၚပါတယ္။</p><p>Central limit theorem က independent variable ရဲ႕ distribution ေတြ ကေ Normal distribution မဟုတ္ခဲ့ရင္ေတာင္ ပါင္းလဒ္ (Sum) ဟာ normal distribution ကို ခ်ဥ္းကပ္ သြားတယ္ လို႔ ဆိုထားပါတယ္။ Statistics မွာ အ ေရး အႀကီးဆံုး အယူအဆ လို႔ ေျပာလို႔ ရပါတယ္။</p><p>ဒီေတာ့ statistical problems ေတြကို ေျဖရွင္းတဲ့ အခါ Central limit theorem ကို ကိုးကားၿပီဆိုရင္ Variance (သို႔) Standard deviation ကို သံုးရင္ ပိုၿပီး natural က်တယ္ ဆိုတာ သိသာႏိုင္ပါတယ္။</p><p>ဘာေၾကာင့္ Variance နဲ႔ Standard deviation ကို Mean absolute deviation ထက္ စာရင္ Measures of spread အ ေနနဲ႔ သံုးသင့္တယ္ ဆိုတာ ဒီ လက္ေတြ႔ ခ်တြက္ ၾကည့္တဲ့ နည္းနဲ႔ စိတ္ေက်နပ္စရာ အ ေျဖ တစ္ခု ေပးႏိုင္မယ္ ေမ်ာ္လင့္ပါတယ္။</p><p>X and Y datasets ေတြကို values အမ်ိဳးမ်ိဳး ထားၿပီး online မွာပဲ Run ၾကည့္မယ္။ ဒါမွမဟုတ္ Raw Score method ကို ကိုယ္ဘာသာကိုယ္ python နဲ႔ implement လုပ္ၾကည့္မယ္ ဆိုရင္ လြယ္ေအာင္ အထက္က codes ေတြကို Google Colab က IPython notebook ထဲမွာ စုစည္းေပးထားပါတယ္။</p><p><a href="https://colab.research.google.com/drive/1PU56SN_VUaitsOi4NlAbF93F-YXiMNjV">Google Colaboratory</a></p><p>Part 3 (Random Variables) ကို ဆက္ဖတ္မယ္ဆိုရင္</p><p><a href="https://medium.com/@hammer7/random-variables-1-basic-statistics-part-3-20cff3074ceb">Random Variables 1 (Basic Statistics Part 3)</a></p><p><strong>References</strong></p><p><a href="https://www.khanacademy.org/math/statistics-probability">https://www.khanacademy.org/math/statistics-probability</a><br> <a href="http://khsapstats.weebly.com/pythagorean-theorem-of-statistics.html">http://khsapstats.weebly.com/pythagorean-theorem-of-statistics.html</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c6b812fac13b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Measures of central tendency (Basic Statistics Part 1)]]></title>
            <link>https://medium.com/@hammer7/measures-of-central-tendency-basic-statistics-part-1-935e24495ed3?source=rss-c3e14d5432fb------2</link>
            <guid isPermaLink="false">https://medium.com/p/935e24495ed3</guid>
            <category><![CDATA[statistics]]></category>
            <category><![CDATA[myanmar]]></category>
            <category><![CDATA[descriptive-statistics]]></category>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[Hlaing Min]]></dc:creator>
            <pubDate>Mon, 12 Aug 2019 11:51:52 GMT</pubDate>
            <atom:updated>2019-09-02T08:00:38.740Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="Measures of central tendency" src="https://cdn-images-1.medium.com/max/750/1*_qz9a6Y4Dobvh37nSAtgpA.jpeg" /><figcaption><strong>Measures of central tendency</strong></figcaption></figure><p>Machine Learning Engineer ပဲျဖစ္ျဖစ္ Data Scientist ပဲျဖစ္ျဖစ္ မရွိ မျဖစ္ အေရးႀကီးတဲ့ Skill တစ္ခုကေတာ့ Statistics ပါပဲ။ Statistics ဆိုတာ Data ေတြကို ေလ့လာတဲ့ ပညာရပ္ ျဖစ္တယ္။ Statistics အ ေၾကာင္း မ ေျပာခင္မွာ data ကို <strong>Population data</strong> နဲ႔ <strong>Sample data</strong> ဆိုၿပီး အမ်ိဳးအစား 2 ခု ခြဲထားတယ္ဆိုတာ သိဖို႔ လိုပါတယ္။</p><ol><li><strong>Population data</strong> — study လုပ္ ခ်င္ တဲ့ data အားလံုးပါဝင္တဲ့ data set အစု ကို ေခၚပါတယ္။</li><li><strong>Sample data</strong> —<strong> </strong>လက္ရွိ random sample နမူနာက်ဘမ္း ေကာက္ထား တဲ့ data set အစု ကို ေခၚပါတယ္။</li></ol><p>ဥပမာ ရန္ကုန္ၿမိဳ႕ က ေၾကာင္ေတြ အားလံုးရဲ႔ အထီး အမ Gender ratio ကို သိခ်င္တယ္ ဆိုပါစို႔။ <strong>Population data </strong>က ရန္ကုန္က ေၾကာင္ အားလံုးပါတဲ့ dataset ပါ။ ဒါေပမယ့္ ေၾကာင္အားလံုးကို လိုက္ၾကည့္ ဖို႔ ဆိုတာ မျဖစ္ႏိုင္ပါဘူး။ ဒီေတာ့ နမူနာ 100 သို႔ 1000 ေကာက္ၿပီး ေလ့လာရပါတယ္။ နမူနာေကာက္တဲ့ အခါမွာလဲ random ျဖစ္ဖို႔ အ ေရးႀကီးတယ္။ သူငယ္ခ်င္းအိမ္ သြားလည္ၿပီး သူ႔ ေမြးထားတဲ့ ေၾကာင္ 15 ေကာင္ ကို sample ယူမယ္ဆိုရင္ Random လို႔ ေျပာလို႔ မရပါဘူး။ သူက ေၾကာင္ အထီးကို ပဲ ေမြးထားၿပီး အမ ေတြကို သူမ်ား ေပးပစ္တယ္ ဆို ဘယ္ႏွယ္လုပ္မလဲ။ ဒီေတာ့ random ျဖစ္ေစတဲ့ process တစ္ခုကို define လုပ္ၿပီး အႀကိမ္ႀကိမ္ ေကာက္ရပါတယ္။ ဒီလို random sample ေကာက္ထားတဲ့ dataset ကို <strong>Sample data</strong> လို႔ ေခၚပါတယ္။</p><p>Statistics ကို အဓိက အပိုင္း 2 ပိုင္း ခြဲျခားႏုိင္ ပါတယ္။</p><ol><li><strong>Descriptive statistics — </strong>Data (Population or Sample) ေတြကို summarize လုပ္ျခင္း</li><li><strong>Inferential statistics — </strong>Sample data ေတြကို အ ေျခခံ သံုးသပ္ၿပီး population တစ္ခုလံုး အ ေပၚ ေကာက္ခ်က္ဆြဲျခင္<strong>း</strong></li></ol><p>Inferential statistics ကိုေတာ့ ေနာက္ အလ်င္းသင့္ရင္ ေဆြး ေႏြးသြားပါမယ္။ ေလာေလာ ဆယ္ေတာ့ Descriptive statistics အ ေၾကာင္းကိုပဲ ဆက္ ေလ့လာၾကည့္ၾကရ ေအာင္။</p><p>Data point ေသာင္းဂဏန္း ေလာက္ရွိတဲ့ dataset ကို data အားလံုး ျပစရာမလိုပဲ Summarize လုပ္ၿပီး က်စ္လစ္စြာ ရွင္းျပမယ္ဆိုရင္ အလြယ္တကူ ေခါင္းထဲမွာ visualize လုပ္ႏိုင္မွာပါ။</p><p>ဥပမာ သင့္မွာ ေၾကာင္ 6 ေကာင္, အသက္ က {3, 1, 6, 5, 4, 5} ႏွစ္ အသီးသီး ရွိတယ္ ဆိုပါေတာ့။ ေၾကာင္ေတြ အသက္ကို ေမးရင္ တေကာင္ျခင္း လိုက္ေျပာမယ့္အစား မွတ္မိလြယ္တဲ့ number တစ္ခုပဲေျပာတာ ပိုသင့္ေတာ္တယ္။</p><p>ေၾကာင္ေတြက ပ်မ္းမ်ွ 4 ႏွစ္ ရိွတယ္။<br>ေၾကာင္ အမ်ားစုက 5 ႏွစ္ ဝန္းက်င္ပဲ။</p><p>စသည့္ျဖင့္ေပါ့။ အဲ့ဒါဟာ Descriptive Statistics ရဲ႕ အေျခခံပါပဲ။ သတိျပဳရမွာကေတာ့ Summarize လုပ္လိုက္တာနဲ႕ Information loss ျဖစ္သြားတာပါပဲ။ မွတ္မိလြယ္တယ္။ သို႔ေသာ္ တိက်မႈ႔ ေလ်ာ့ သြားတယ္။</p><p>Descriptive Statistics ကို summarize လုပ္ၿပီး ေဖာ္ျပရာမွာ <br>1. Measures of Central Tendency — အလယ္ယိွမ္းမႈ႔ ကို တိုင္းတာျခင္း<br>2. Measures of Spread or Variation — ျပန္႕ ႏွံ႔မႈ႔ ကို တိုင္းတာျခင္း<br>3. Measures of Frequency — အၾကိမ္ ေရ ကို တိုင္းတာျခင္း<br>4. Measures of Position — ေနရာကို (ႏိႈင္းယွဥ္)တိုင္းတာျခင္း<br>ဆိုၿပီး 4 မ်ိဳး ခြဲ ႏိုင္ပါတယ္။</p><p>အသံုးမ်ားတာကေတာ့ 1 and 2 ျဖစ္ၿပီး ဒီ post မွာ နံပါတ္ 1 ကို ပဲ ေဆြးေႏြးသြားမွာပါ။</p><h3>Measures of Central Tendency</h3><p>Measures of Central Tendency ဆိုတာ dataset ရဲ့ တနည္းနည္း နဲ႔ center ျဖစ္ေနတဲ့ point (Average, typical or middle value) ရွာတာပါ။ နည္းလမ္း အမ်ိဳးမ်ိဳး ရိွတဲ့ထဲက အသံုးမ်ားတဲ့ နည္းတစ္ခ်ိဳ႕ ကို ေဆြးေႏြးခ်င္ပါတယ္။</p><h4>Mean</h4><figure><img alt="Mean represents the average of all data points in a dataset." src="https://cdn-images-1.medium.com/max/697/1*Amd8UfF-dlmaAQWDZTAKfg.png" /><figcaption><strong>Mean represents the average of all data points in a dataset</strong></figcaption></figure><p>ပထမဆံုး တနည္းကေတာ့ ပ်မ္းမ်ွ တန္ဖိုး (Average) ပါ။ Average မွာလဲ အမ်ိဳးမ်ိဳးရွိပါတယ္။ အားလံုးရင္းႏွီးၿပီး သားက ေတာ့ Mean လို႕ အတို ေခၚ ေလ႔ရွိတဲ့ <strong>Arithmetic Mean</strong> ပါ။ တန္ဖိုးအားလံုးကို ေပါင္းပီး data point အ ေရအတြက္နဲ႔ စားရပါတယ္။</p><figure><img alt="Arithmetic Mean" src="https://cdn-images-1.medium.com/max/444/1*TQ5dZErtcoAf_fwQgq8QCw.png" /><figcaption><strong>Arithmetic Mean</strong></figcaption></figure><p>where <em>μ</em><strong><em> </em></strong>= Arithmetic Mean<br><em>N</em> = Number of data points in the data set<br><em>xᵢ = </em>Each data point in the data set</p><p>သတိျပဳရမွာက ဒီ definition ဟာ Circle Area (A = π r²) equation လိုမ်ိဳး universal truth မဟုတ္ပါဘူး။ အရင္လူေတြ ထြင္ခဲ့ျပီး လက္ေတြ႔ အသံုးဝင္တဲ့ human constructed definition ပါ။</p><p>ဆင့္ပြားပီး စဥ္းစားၾကည့္ရင္ တျခား Mean definition ေတြ ရွိႏိုင္တာကို ေတြ႔ ရပါလိမ့္မယ္။ ဘာလို႔ add လုပ္ဖို႔ လိုတာလဲ။ Add အစား multiply သံုးလို႔ မရဘူးလား။ အဲ multiply လုပ္မယ္ဆိုရင္ေတာ့ data point အေရအတြက္နဲ႔ စားလို႔ မွန္ပါဦးမလား။ <br>ဥပမာ data point 2 ခုရွိရင္ Arithmetic mean က 2 ခုေပါင္းပီး 2 နဲ႔ ျပန္စားတယ္။ ဆိုေတာ့ 2 ခု ေျမွာက္ ရင္ square root ျပန္ရွာသင့္တာေပါ့။ 3 ခုရွိရင္ cube root ေပါ့။ nth ခု ရွိရင္ nth root ေပါ့။ ဒါကို <strong>Geometric Mean</strong> လို႕ ေခၚပါတယ္။ Finance မွာ Growth rate တြက္ရင္ Geometric mean ကို သံုးပါတယ္။</p><figure><img alt="Geometric Mean" src="https://cdn-images-1.medium.com/max/585/1*vehTefoK8lfmG1aKrLveIQ.png" /><figcaption><strong>Geometric Mean</strong></figcaption></figure><p>where <em>G</em><strong><em> </em></strong>= Geometric Mean<br><em>N</em> = Number of data points in the data set<br><em>x</em>₁<em>, x</em>₂ … <em>= </em>Data points in the data set</p><p>ေနာက္ ထပ္ Mean တခုကေတာ့ <strong>Harmonic Mean</strong> ပါ။ data point တစ္ခုျခင္းရဲ႕ လွန္ကိန္း (Reciprocal) ကို Arithmetic mean ယူၿပီး ရတဲ့ Value ကို မွ reciprocal ျပန္ယူတာပါ။ ဘာလို႕ အဲ့လို ရွာမွ အဆင္ေျပတယ္ဆိုတဲ့ Intuition ကို ေျပာရရင္ အနည္းငယ္ ရွည္ပါတယ္။ Machine learning မွာ model တစ္ခု ရဲ႕ Test Accuracy ကို တိုင္းတာေလ့ ရွိတဲ႔ F1 Score ဆိုတာ Precision နဲ႕ Recall values 2 ခုၾကားက Harmonic Mean ကို ယူထားတာပဲ။ ေနာက္ အလ်င္းသင့္ရင္ F1 Score က Harmonic mean ကိုဘာေၾကာင့္ သံုးတယ္ ဆိုတာကို ေဆြးေႏြးခ်င္ပါေသးတယ္။</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/452/1*BwCidMu3Bo7PgWTRgPS9ig.png" /></figure><p>where <em>H</em><strong><em> </em></strong>= Harmonic Mean<br><em>N</em> = Number of data points in the data set<br><em>xᵢ = </em>Each data point in the data set</p><p>တစ္ျခား Mean အမ်ိဳးအစားေတြ ရွိေသးေပမယ့္ ဒီ 3 ခုေလာက္သိရင္ အေတာ္ေလး လံုေလာက္ပီလို႕ ေျပာလို႕ ရပါတယ္။</p><h4>Median</h4><figure><img alt="Median represents the middle value of the data points in a sorted dataset" src="https://cdn-images-1.medium.com/max/697/1*C2O_9O30Ms3_ZYUHg3LRFQ.png" /><figcaption><strong>Median represents the middle value of the data points in a sorted dataset</strong></figcaption></figure><p>ေနာက္တစ္ခုက ေတာ့ Median ပါ။ Data points ေတြရဲ႔ Middle number နဲ႔ summarize လုပ္တာပါ။ Sort အရင္ လုပ္ရပါတယ္။ ၿပီး ရင္ middle number ကို Median အျဖစ္ယူပါတယ္။ Middle number 2 ခု ရွိခဲ့ရင္ အဲ့ဒီ 2 ခု ရဲ႔ Arithmetic Mean ကိုယူပါတယ္။ အထက္က ေၾကာင္ ဥပမာမွာဆို Sort လုပ္ပီးရင္ {1, 3, 4, 5, 5, 6} ဆိုေတာ့ Median က 4.5 ပါ။<br>တစ္ခါတေလ dataset မွာ data point ေတာ္ေတာ္မ်ားမ်ားက နီးနီးကပ္ကပ္ ရွိေသာ္လည္း အနည္းအက်ဥ္းက အစြန္းေတြ ေရာက္ေနတဲ့ Outliers ေတြပါေနတာမ်ိဳး ၾကံဳ ရပါတယ္။ ဥပမာ{1, 3, 4, 5, 5, 6, 10000} ဆိုတဲ့ dataset ကို Arithmetic mean နဲ႔ summarize လုပ္ရင္ အဆင္ မေျပပါဘူး။ အမ်ားစုကို ကို္ယ္စားမျပဳ တဲ့ Value တစ္ခု ထြက္လာမွာပါ။ အဲ့လို အေျခအေနမ်ိဳးမွာ Median သံုးရင္ ပို သင့္ေတာ္ပါတယ္။</p><h4>Mode</h4><p>ေနာက္ တစ္နည္းကေတာ့ Mode လို႕ ေခၚတဲ့ Typical number, အၾကိမ္အမ်ားဆံုး number နဲ႔ summarize လုပ္တာပါ။ အသံုးနည္းတယ္။ ေၾကာင္ ဥပမာမွာဆို {3, 1, 6, 5, 4, 5} ဆိုေတာ့ Mode က 5 ပါ။</p><figure><img alt="Mode represents the most frequency data point in a dataset." src="https://cdn-images-1.medium.com/max/697/1*HAmtvSsUryNgk-aQwTAiOw.png" /><figcaption><strong>Mode represents the most frequency data point in a dataset.</strong></figcaption></figure><h4>Mid Range</h4><p>ေနာက္တစ္ခု ကေတာ့ Mid-Range လို႕ ေခၚတဲ့ အစြန္း ၂ ခု ရဲ႕ အလယ္မွတ္ (Midpoint of the range) ကို ယူတဲ့ နည္းပါ။ တစ္နည္းအားျဖင့္ Max and Min Value 2 ခု ရဲ႕ Arithmetic Mean ပါ။ <strong><em>X</em></strong> က dataset တစ္ခုလံုးကို ကိုယ္စားျပဳတယ္ဆိုရင္ Mid Range ရဲ႕ equation က</p><figure><img alt="Mid Range" src="https://cdn-images-1.medium.com/max/540/1*wUOcihfGkD1_4SFRkh017g.png" /><figcaption><strong>Mid Range</strong></figcaption></figure><p>where<em> X</em> = Data set</p><p>{3, 1, 6, 5, 4, 5} ဥပမာမွာ ဆိုရင္ Mid-Range က (1+6)/2 = 3.5.</p><p>ဒါေတြအျပင္ အျခား အသံုးနည္းတဲ့ Central tendency ေတြ အမ်ားၾကီး က်န္ပါေသးတယ္။ စိတ္ဝင္စားရင္ အေသးစိတ္ ကို <a href="https://en.wikipedia.org/wiki/Central_tendency">wiki page</a> မွာ ေလ႔လာႏိုင္ပါတယ္။</p><h3>Conclusions</h3><p>ေမးခြန္းတစ္ခု ရွိတာက ဒါဆို Measures of Central Tendency မွာ အေကာင္းဆံုး နည္းလမ္း က ဘာလဲ။ Efficiency နဲ႕ Robustness ကို ၾကည့္ပါတယ္။</p><p><strong>Efficiency</strong> ကို နားလည္ဖို႕ Inferential statistic က Sampling process သိဖို႕ လိုပါတယ္။ ဥပမာ မွာ ရန္ကုန္ မွာ ေၾကာင္ အေကာင္ ၁ သန္းရွိတယ္။ ပိုခ်င္လဲ ပိုမယ္။ ရန္ကုန္က ေၾကာင္ေတြရဲ႕ အသက္ ဘယ္ေလာက္လဲ ပ်မ္းမ် (Population Mean) သိခ်င္ရင္ အားလံုး လိုက္ေကာက္ဖို႕ မျဖစ္ႏိုင္ပါဘူး။ ဒီေတာ့ ဥပမာ random 10 (or any number of) sample ေကာက္ရတယ္။ ၿပီးရင္ summarize (ဥပမာ Mean) လုပ္။ ဒီလို process ကို ခနခန repeat (ဥပမာ အၾကိမ္ 500) လုပ္ရတယ္။ ဒါဆို Mean value ေပါင္း 500 ရၿပီ။ အဲ့ဒါကို Sampling distribution of sample mean လို ေခၚပါတယ္။ ၿပီးမွ အဲ့ဒီ Value 500 ကို summarize ထပ္လုပ္ၿပီး အ ေျဖထုတ္တဲ့ process ပါ။ အဲ့ဒီလို sample က ေန summarize လုပ္ထားတဲ့ statistical value ေတြ (sample mean, sample median) စသည္တို႕ ကို Estimators လို႕ ေခၚ တယ္။ Population mean, population median တို႕ ကိုေတာ့ အဲ့လို ေခၚ ေလ႔ မရွိပါဘူး။</p><p>Population ရဲ႕ center ကို sampling repeatation အနည္းဆံုးနဲေကာက္ခ်က္ဆြဲ (Infer လုပ္) ႏိုင္ရင္ Efficiency ေကာင္းတယ္ လို႕ သတ္မွတ္ပါတယ္။ တစ္နည္းအားျဖင့္ sampling distribution ရဲ႔ <a href="https://medium.com/@hammer7/measures-of-spread-basic-statistics-part-2-c6b812fac13b">spread</a> ေသးရင္ Efficiency ေကာင္းပါတယ္။</p><p><strong>Robustness</strong> ကေတာ့ Robustness to outliers (စုန္းျပဴး ေတြကို ေတာင့္ခံႏိုင္တာ)ပါပဲ။</p><p>Estimator တစ္ခု ရဲ႕ Efficiency and Robustness ဟာ dataset ေပၚ မူတည္ၿပီး ေျပာင္းလဲ တတ္တာပါ။ အထက္မွာ ေျပာတဲ့ အတိုင္း Outliers မ်ားတဲ့ dataset မွာ Median က Mean ထက္ စာရင္ Robustness ေကာင္းတယ္။</p><p>ဒီမွာ တစ္ခု သတိျပဳသင့္တာကေတာ့ Robustness ဆိုရာ အစြန္းႏွစ္ဖက္ ရွိတဲ့ ဓါးသြား (double-edged sword) လိုပါပဲ။ Robustness အရမ္းေကာင္းလြန္းရင္လဲ outliers ေတြရဲ႕ information ကို လံုးဝ ထည့္ မစဥ္းစား သလို ျဖစ္ေစၿပီး အဆင္မ ေျပ ပါဘူး။</p><p>ၿပီးေတာ့ လက္ေတြ႔ မွာ data set အေတာ္မ်ားမ်ားဟာ Central limit theorem အရ distribution က Normal distributions (Bell curve) ျဖစ္တဲ့ အတြက္ outliers နည္းပါတယ္။ Mean က Median ထက္ ေယဘုယ် အား ျဖင့္ Efficiency ပိုေကာင္းတဲ့ အတြက္ Sample Mean ကိုပဲ unbiased estimator အျဖစ္ သံုးတာမ်ားပါတယ္။</p><p>Mode ကေတာ့ non-numerical datasets (categorical datasets) ေတြမွာ အသံုးမ်ားတယ္။ ဥပမာ ေၾကာင္ 6 ေကာင္ hair color က {white, brown, brown, red, black, brown} ဆိုရင္ Mean နဲ႔ Median ရွာဖို႕ မျဖစ္ႏိုင္ပါဘူး။ Mode ကို ပဲ သံုးရမွာပါ။</p><p>Mid-Range ကေတာ့ Efficiency ေရာ Robustness ေရာ အားနည္းတဲ့ အတြက္ အသံုး အနည္းဆံုးပါ။</p><p>Part 2 (Measures of spread) ကို ဆက္လက္ ဖတ္ရႈ႔ မယ္ဆိုရင္</p><p><a href="https://medium.com/@hammer7/measures-of-spread-basic-statistics-part-2-c6b812fac13b">Measures of spread (Basic Statistics Part 2)</a></p><h4><strong>Reference</strong></h4><p><a href="https://www.khanacademy.org/math/statistics-probability">https://www.khanacademy.org/math/statistics-probability</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=935e24495ed3" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>