<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Julia Community 🟣: math4mad</title>
    <description>The latest articles on Julia Community 🟣 by math4mad (@math4mad).</description>
    <link>https://forem.julialang.org/math4mad</link>
    <image>
      <url>https://forem.julialang.org/images/LtvTLATmsFxBXyDhB6nWWyz3JsT9pm6iiEtppEiR4Fs/rs:fill:90:90/g:sm/mb:500000/ar:1/aHR0cHM6Ly9mb3Jl/bS5qdWxpYWxhbmcu/b3JnL3JlbW90ZWlt/YWdlcy91cGxvYWRz/L3VzZXIvcHJvZmls/ZV9pbWFnZS84MDcv/YmRiYjY1NjQtMTQ1/Yi00MTQ1LTk1ZWEt/Njk5NGVjMmUyMDgz/LnBuZw</url>
      <title>Julia Community 🟣: math4mad</title>
      <link>https://forem.julialang.org/math4mad</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.julialang.org/feed/math4mad"/>
    <language>en</language>
    <item>
      <title>A very short introduction to Bayesian workflow</title>
      <dc:creator>math4mad</dc:creator>
      <pubDate>Wed, 12 Oct 2022 07:14:52 +0000</pubDate>
      <link>https://forem.julialang.org/math4mad/a-very-short-introduction-to-bayesian-workflow-1ee5</link>
      <guid>https://forem.julialang.org/math4mad/a-very-short-introduction-to-bayesian-workflow-1ee5</guid>
      <description>&lt;p&gt;Recently, I read a lot of materials about Bayesian Statistics. Same with other programmers , lots of perplex, such as what are difference about  Classical Statistics(&lt;code&gt;CS&lt;/code&gt;) with Bayesian Statistics(&lt;code&gt;BS&lt;/code&gt;),how to use &lt;code&gt;BS&lt;/code&gt; ? etc.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;We must understanding  &lt;code&gt;Bayes Theorem&lt;/code&gt; before we use BS?&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;It depdends&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;For most of  Programmers, actually we talk about &lt;code&gt;probability programming language&lt;/code&gt; , not BS. With some Programming Framework, like &lt;code&gt;Turing.jl&lt;/code&gt;, we don't need understanding  &lt;code&gt;Bayes Theorem&lt;/code&gt; at all.  We Just need to understand &lt;code&gt;Bayes Workflow&lt;/code&gt;,  like us use application on iPhone, but we don't need understanding how A15 cpu working principle. We are learning how to use Bayesian Application, not  Bayesian's CPU.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;For  Bayesian expert Programmers,  understanding  &lt;code&gt;Bayes Theorem&lt;/code&gt; not enough, they must use many many  other techniques. &lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Most importantly,  our human's cognition processing flow extremely  likely with Bayesian Workflow.   &lt;/p&gt;

&lt;p&gt;In this blog, I will describe some  learning points about  probability programming with BS&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;In my experience, I want you keep thinking two problems:Where data came from ? What is Data Source'params, until you understanding what I talking about.&lt;/p&gt;

&lt;p&gt;the meaning of &lt;code&gt;likely hood&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;why  In &lt;code&gt;Truing.jl&lt;/code&gt; 's model code using  Greek alphabet&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Where data came from?
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Mocking Data
&lt;/h3&gt;

&lt;p&gt;If  we want to  develop E-Business website.  First we need some data, we can use some mocking package or website to produce data &lt;br&gt;
Such as &lt;a href="https://mockaroo.com"&gt;&lt;code&gt;https://mockaroo.com&lt;/code&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://forem.julialang.org/images/Cw-FgpRKiMtXE3nouNa0IOtXsB0wvFGXJ32mz4YlnXs/w:880/mb:500000/ar:1/aHR0cHM6Ly90dmEx/LnNpbmFpbWcuY24v/bXc2OTAvMDA4dnh2/Z0dneTFoNzJhc3Z4/aXd5ajMxMHcwbTQw/dW8uanBn" class="article-body-image-wrapper"&gt;&lt;img src="https://forem.julialang.org/images/Cw-FgpRKiMtXE3nouNa0IOtXsB0wvFGXJ32mz4YlnXs/w:880/mb:500000/ar:1/aHR0cHM6Ly90dmEx/LnNpbmFpbWcuY24v/bXc2OTAvMDA4dnh2/Z0dneTFoNzJhc3Z4/aXd5ajMxMHcwbTQw/dW8uanBn" alt="mockaroo data" width="690" height="414"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We need some Fields defining   structure of mocking data. All data follow  fields definition.   Once we defined all  fields correctly, we get a &lt;strong&gt;data  producing machine&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;These Fields can be called &lt;code&gt;params&lt;/code&gt; of data source&lt;/p&gt;

&lt;p&gt;Then, we program some CRUD code to  manipulate data.  For example, we read 100 rows of data. that is not over, we need check results.If  we get wrong result, maybe   data structure has problem, maybe  code has problem. So we need modify somewhere. Iterate several times until most results correctly. &lt;/p&gt;

&lt;p&gt;In this section , we build a workflow starting from  data source. &lt;/p&gt;

&lt;p&gt;If we have an experienced programmer to design data structure,  workflow can be less error and spending less time.This can be thought as prior condition. If you ever learned some BS, you will recognize some things.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Remember, if data has meaning , data structure of data source has meaning. In BS we try to find these data source's params!&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  Real data producing machine
&lt;/h3&gt;

&lt;p&gt;I like  running , my  application record many data of running. &lt;br&gt;
So I'm a data producing source. What is Fields(params) of source ? How to explain these data?&lt;/p&gt;

&lt;p&gt;&lt;a href="https://forem.julialang.org/images/o4r5kuXdlgc_Zw6avcByDKXsddm3uE4MjmTAkYgvrK4/w:880/mb:500000/ar:1/aHR0cHM6Ly90dmEx/LnNpbmFpbWcuY24v/bGFyZ2UvMDA4dnh2/Z0dneTFoNzJmZXBw/MDh3ajMwZ28wY2kz/eXEuanBn" class="article-body-image-wrapper"&gt;&lt;img src="https://forem.julialang.org/images/o4r5kuXdlgc_Zw6avcByDKXsddm3uE4MjmTAkYgvrK4/w:880/mb:500000/ar:1/aHR0cHM6Ly90dmEx/LnNpbmFpbWcuY24v/bGFyZ2UvMDA4dnh2/Z0dneTFoNzJmZXBw/MDh3ajMwZ28wY2kz/eXEuanBn" alt="running app" width="600" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You are not   familiar with me , let talk Usain Bolt&lt;br&gt;
&lt;a href="https://forem.julialang.org/images/XHC1F8YsghONh-0vlKq9jH7ilv5rJ7X3DkX0orx1HI0/w:880/mb:500000/ar:1/aHR0cHM6Ly9pbWcu/b2x5bXBpY2NoYW5u/ZWwuY29tL2ltYWdl/cy9pbWFnZS9wcml2/YXRlL3RfMTYtOV8x/MjQwLTcwMF8xNXgv/Zl9hdXRvL3YxNTM4/MzU1NjAwL3ByaW1h/cnkvamd3dG1qaGc3/MGdvamdxaXhobGw" class="article-body-image-wrapper"&gt;&lt;img src="https://forem.julialang.org/images/XHC1F8YsghONh-0vlKq9jH7ilv5rJ7X3DkX0orx1HI0/w:880/mb:500000/ar:1/aHR0cHM6Ly9pbWcu/b2x5bXBpY2NoYW5u/ZWwuY29tL2ltYWdl/cy9pbWFnZS9wcml2/YXRlL3RfMTYtOV8x/MjQwLTcwMF8xNXgv/Zl9hdXRvL3YxNTM4/MzU1NjAwL3ByaW1h/cnkvamd3dG1qaGc3/MGdvamdxaXhobGw" alt="Usain Bolt's record" width="880" height="497"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Bolt is a crazy running data producing machine, I'm just a mediocre   running data producing machine&lt;/p&gt;

&lt;p&gt;We are both human , we are same machine type.&lt;br&gt;
 But  we  have different  Fields(params), that' why we get different running data . &lt;/p&gt;

&lt;p&gt;similarly params produce  similarly data &lt;br&gt;
&lt;a href="https://forem.julialang.org/images/e37ABPzvYNyTnF3B_DlvyxeprQAm_uLq_re0ju5yo6I/w:880/mb:500000/ar:1/aHR0cHM6Ly90czEu/Y24ubW0uYmluZy5u/ZXQvdGgvaWQvUi1D/LjZjNGMzNTY5MzE0/OTU4OTc0Y2Y0ZWVl/MjY0YWZhZDk4P3Jp/az10ZlZJRWt4TGp3/VSUyYmdRJnJpdT1o/dHRwJTNhJTJmJTJm/dXNhaW5ib2x0LmNv/bSUyZndwLWNvbnRl/bnQlMmZ1cGxvYWRz/JTJmMjAxMiUyZjA4/JTJmRFNDXzM1MTAu/anBnJmVoaz04N3BG/VzQyV1NSenpBRWpL/d3ZhOWhUeHNnYXUl/MmZVR1BzRHhjQXg3/dW0lMmJycyUzZCZy/aXNsPSZwaWQ9SW1n/UmF3JnI9MA" class="article-body-image-wrapper"&gt;&lt;img src="https://forem.julialang.org/images/e37ABPzvYNyTnF3B_DlvyxeprQAm_uLq_re0ju5yo6I/w:880/mb:500000/ar:1/aHR0cHM6Ly90czEu/Y24ubW0uYmluZy5u/ZXQvdGgvaWQvUi1D/LjZjNGMzNTY5MzE0/OTU4OTc0Y2Y0ZWVl/MjY0YWZhZDk4P3Jp/az10ZlZJRWt4TGp3/VSUyYmdRJnJpdT1o/dHRwJTNhJTJmJTJm/dXNhaW5ib2x0LmNv/bSUyZndwLWNvbnRl/bnQlMmZ1cGxvYWRz/JTJmMjAxMiUyZjA4/JTJmRFNDXzM1MTAu/anBnJmVoaz04N3BG/VzQyV1NSenpBRWpL/d3ZhOWhUeHNnYXUl/MmZVR1BzRHhjQXg3/dW0lMmJycyUzZCZy/aXNsPSZwaWQ9SW1n/UmF3JnI9MA" alt="runners" width="880" height="584"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;For these guys, collect some data , you can't tell which data producing by Bolt.&lt;/p&gt;

&lt;p&gt;Usually, we collect data from a time slice(instant time), assuming machine's param keep constant. &lt;/p&gt;

&lt;p&gt;In single time,  maybe we find a beautiful view in joggling , so we  take pictures, this make running record getting worse. &lt;br&gt;
This change not cause by params's change , just environment factors.  environment factors are uncountable. &lt;/p&gt;

&lt;p&gt;In long time range , some params  changed , such as  after long time training , you get better record than ever.  During aging , you running speed get slowly.  &lt;/p&gt;

&lt;h3&gt;
  
  
  So what's point above examples?
&lt;/h3&gt;

&lt;p&gt;In CS, we focus on data and computing. In BS, we care about data  source, data source's params and data. &lt;/p&gt;

&lt;p&gt;In CS  we test params. In BS we estimate params&lt;/p&gt;

&lt;p&gt;CS seems like a block of BS  workflow.&lt;/p&gt;

&lt;h3&gt;
  
  
  probability distributions has different use in CS and BS
&lt;/h3&gt;

&lt;p&gt;In CS, if we have real data, we don't need   probability distributions , some CS methods need to check distributions, but not use distributions. If we have no data, we can use  probability density function (pdf) to mock data, that's all. &lt;br&gt;
Like we buy goods, but we have not rights to modify machine's params. &lt;/p&gt;

&lt;p&gt;In BS, probability Distributions is vital building block, we need goods, also need making machine by ourselves. &lt;br&gt;
We can change machine's params to make them producing better goods. &lt;/p&gt;

&lt;p&gt;If we choose &lt;code&gt;semi-finished products&lt;/code&gt;, we can speed getting  our goods. (That is prior condition)&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Mocking data in not  a part of CS, neither BS.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  What is data producing machine's shape?
&lt;/h3&gt;

&lt;p&gt;Most of time when we learning math,  we start from an expression . But most of time nature model has no  expression at all. &lt;br&gt;
In Calculus , we use series to  approximate a function &lt;br&gt;
In Algebra, we use function of  linear combination to get approximate function expression. &lt;/p&gt;

&lt;p&gt;We don't care about what is function expression, we just care about  expression's outputs.&lt;/p&gt;

&lt;p&gt;This method like &lt;code&gt;Duck type&lt;/code&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;code&gt;If it looks like a duck and quacks like a duck, it’s a duck”&lt;/code&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  &lt;code&gt;likely hood&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;This is &lt;code&gt;likelyhood&lt;/code&gt;, and in &lt;code&gt;Turing.jl&lt;/code&gt;, we use &lt;code&gt;~&lt;/code&gt;, not &lt;code&gt;=&lt;/code&gt;. That's why, cause we  approximately get a set of data's data source's params. &lt;/p&gt;

&lt;p&gt;That is the &lt;code&gt;likelyhood&lt;/code&gt; meaning. If a distribution with these &lt;code&gt;likelyhood&lt;/code&gt; params  produce our observation data, job done!. &lt;/p&gt;

&lt;p&gt;here is workflow:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Get &lt;code&gt;semi-finished machine&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;By data, to tuning machine's params&lt;/li&gt;
&lt;li&gt;Check  whether machine to produce our data. &lt;/li&gt;
&lt;li&gt;Not work , return to 2.&lt;/li&gt;
&lt;li&gt;work great, return a &lt;code&gt;likelyhood&lt;/code&gt; machine &lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;If not work at all , we need choose another &lt;code&gt;semi-finished machine&lt;/code&gt; repeat procedure&lt;/p&gt;

&lt;h3&gt;
  
  
  Why Turing's model using Greek alphabet?
&lt;/h3&gt;

&lt;p&gt;In  Statistics, Population and Samples  are most important concept.  Population's  params represent by  Greek alphabet&lt;/p&gt;

&lt;p&gt;Usually, we  sampling   some entity from Population,then collect  ing sample's data .  &lt;/p&gt;

&lt;p&gt;You can see  Population is data source.  In BS, we estimate  data source's params, that is Population's params. that is why in &lt;code&gt;Turing.jl&lt;/code&gt;'s model using   Greek alphabet.&lt;/p&gt;

&lt;p&gt;That is called Parametric estimate. &lt;br&gt;
On the other hand, in CS, &lt;br&gt;
It is Parametric tests,  in CS, params doesn't change.&lt;/p&gt;

&lt;h2&gt;
  
  
  conclusion
&lt;/h2&gt;

&lt;p&gt;Here is a very  short introduction to Bayesian work flow. &lt;/p&gt;

&lt;p&gt;As for you, it is a &lt;code&gt;semi-finished lesson&lt;/code&gt;, you need repeat  and repeat before you get  &lt;code&gt;finished lesson&lt;/code&gt;. Need more  bayesian data, modify lesson params. &lt;/p&gt;

&lt;p&gt;For me it is a &lt;code&gt;semi-finished blog&lt;/code&gt;, I need many  iteration to make it  better. &lt;/p&gt;

&lt;p&gt;That's all . I'm not good at English,  please correct and modify my params!&lt;/p&gt;

</description>
      <category>launch</category>
      <category>julia</category>
      <category>bayesia</category>
    </item>
  </channel>
</rss>
