Skip to content

Commit

Permalink
typos
Browse files Browse the repository at this point in the history
  • Loading branch information
juanitorduz committed Nov 14, 2023
1 parent 8f40ce2 commit 5d6ae13
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<link href="intro_hierarchical_models_files/libs/quarto-html/light-border.css" rel="stylesheet">
<link href="intro_hierarchical_models_files/libs/quarto-html/quarto-html.min.css" rel="stylesheet" data-mode="light">
<link href="intro_hierarchical_models_files/libs/quarto-html/quarto-syntax-highlighting.css" rel="stylesheet" id="quarto-text-highlighting-styles"><meta charset="utf-8">
<meta name="generator" content="quarto-1.3.450">
<meta name="generator" content="quarto-1.3.353">

<meta name="author" content="Dr.&nbsp;Juan Orduz">
<title>Introduction to Hierarchical Models</title>
Expand Down Expand Up @@ -422,7 +422,7 @@ <h2>Outline</h2>
<li class="fragment">Pooled</li>
<li class="fragment">Hierarchical
<ul>
<li class="fragment">Non-Ceneter Parametrization</li>
<li class="fragment">Non-Centered Parametrization</li>
<li class="fragment">Shrinkage Effect</li>
</ul></li>
<li class="fragment">Hierarchical with Correlated Random Effects</li>
Expand Down Expand Up @@ -464,7 +464,7 @@ <h3 id="books">Books</h3>
</section>
<section id="price-elasticity" class="slide level2">
<h2>Price Elasticity</h2>
<p>The elasticity of a variable <span class="math inline">\(y(x, z)\)</span> with respect to another variable <span class="math inline">\(x\)</span> is defined as the percentage change in <span class="math inline">\(y\)</span> for a one percent change in <span class="math inline">\(x\)</span>. Mathematically, this is written as</p>
<p>The elasticity of a variable <span class="math inline">\(y(x, z)\)</span> with respect to another variable <span class="math inline">\(x\)</span> is defined as the percentage change in <span class="math inline">\(y\)</span> for a <span class="math inline">\(1\%\)</span> change in <span class="math inline">\(x\)</span>. Mathematically, this is written as</p>
<p><span class="math display">\[
\eta = \frac{\partial \log(y(x, z))}{\partial \log(x)}
\]</span></p>
Expand Down Expand Up @@ -512,8 +512,8 @@ <h2>Region Elasticities</h2>
</figure>
</div>
</section>
<section id="beline-model---unpooled" class="slide level2">
<h2>Beline Model - Unpooled</h2>
<section id="base-model---unpooled" class="slide level2">
<h2>Base Model - Unpooled</h2>

<img data-src="intro_hierarchical_models_files/images/unpooled_model.png" class="r-stretch quarto-figure-center"><p>We fit a linear model for each region <span class="math inline">\(j \in \{ 0,\cdots, 8 \}\)</span> separately:</p>
<p><span class="math display">\[
Expand All @@ -523,8 +523,8 @@ <h2>Beline Model - Unpooled</h2>
<p>See <a href="https://bayesiancomputationbook.com/markdown/chp_04.html#unpooled-parameters">Bayesian Modeling and Computation in Python, Chapter 4.5.1: Unpooled Parameters</a></p>
</div>
</section>
<section id="beline-model---pooled-pymc" class="slide level2">
<h2>Beline Model - Pooled (PyMC)</h2>
<section id="base-model---pooled-pymc" class="slide level2">
<h2>Base Model - Pooled (PyMC)</h2>
<div class="sourceCode" id="cb1" data-code-line-numbers="|1|3|4-7|9-18|20-27"><pre class="sourceCode numberSource python number-lines code-with-copy"><code class="sourceCode python"><span id="cb1-1"><a href="#cb1-1"></a>coords <span class="op">=</span> {<span class="st">"region"</span>: region, <span class="st">"obs"</span>: obs}</span>
<span id="cb1-2"><a href="#cb1-2"></a></span>
<span id="cb1-3"><a href="#cb1-3"></a><span class="cf">with</span> pm.Model(coords<span class="op">=</span>coords) <span class="im">as</span> base_model:</span>
Expand Down Expand Up @@ -553,8 +553,8 @@ <h2>Beline Model - Pooled (PyMC)</h2>
<span id="cb1-26"><a href="#cb1-26"></a> dims<span class="op">=</span><span class="st">"obs"</span></span>
<span id="cb1-27"><a href="#cb1-27"></a> )</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</section>
<section id="beline-model---pooled-plate-notation" class="slide level2">
<h2>Beline Model - Pooled (Plate Notation)</h2>
<section id="base-model---pooled-plate-notation" class="slide level2">
<h2>Base Model - Pooled (Plate Notation)</h2>
<div class="quarto-figure quarto-figure-center">
<figure>
<p><img data-src="intro_hierarchical_models_files/images/blog/multilevel_elasticities_single_sku_33_0.svg" height="600"></p>
Expand Down Expand Up @@ -648,15 +648,15 @@ <h2>Posterior Geometry Matters</h2>
<p>See <a href="https://bayesiancomputationbook.com/markdown/chp_04.html#posterior-geometry-matters">Bayesian Modeling and Computation in Python, Chapter 4.6.1: Posterior Geometry Matters</a></p>
</div>
</section>
<section id="non-ceneter-parametrization" class="slide level2 smaller">
<h2>Non-Ceneter Parametrization</h2>
<h3 id="ceneterd-parametrization">Ceneterd Parametrization</h3>
<section id="non-centered-parametrization" class="slide level2 smaller">
<h2>Non-Centered Parametrization</h2>
<h3 id="centered-parametrization">Centered Parametrization</h3>
<p><span class="math display">\[
\begin{align*}
\beta \sim \text{Normal}(\mu_{\beta}, \sigma_{\beta})
\end{align*}
\]</span></p>
<h3 id="non-ceneter-parametrization-1">Non-Ceneter Parametrization</h3>
<h3 id="non-centered-parametrization-1">Non-Centered Parametrization</h3>
<p><span class="math display">\[
\begin{align*}
z \sim \text{Normal}(0, 1) \\
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ format:
- Models
- Pooled
- Hierarchical
- Non-Ceneter Parametrization
- Non-Centered Parametrization
- Shrinkage Effect
- Hierarchical with Correlated Random Effects
- Predictions for a New Region
Expand Down Expand Up @@ -80,7 +80,7 @@ format:
## Price Elasticity

The elasticity of a variable $y(x, z)$ with respect to another variable $x$ is defined
as the percentage change in $y$ for a one percent change in $x$. Mathematically, this
as the percentage change in $y$ for a $1\%$ change in $x$. Mathematically, this
is written as

$$
Expand Down Expand Up @@ -121,7 +121,7 @@ Median income has an effect on price.

![](intro_hierarchical_models_files/images/blog/multilevel_elasticities_single_sku_25_2.png){fig-align="center" height="550"}

## Beline Model - Unpooled
## Base Model - Unpooled

![](intro_hierarchical_models_files/images/unpooled_model.png){fig-align="center"}

Expand All @@ -135,7 +135,7 @@ $$
See [Bayesian Modeling and Computation in Python, Chapter 4.5.1: Unpooled Parameters](https://bayesiancomputationbook.com/markdown/chp_04.html#unpooled-parameters)
:::

## Beline Model - Pooled (PyMC)
## Base Model - Pooled (PyMC)

``` {.python code-line-numbers="|1|3|4-7|9-18|20-27"}
coords = {"region": region, "obs": obs}
Expand Down Expand Up @@ -167,7 +167,7 @@ with pm.Model(coords=coords) as base_model:
)
```

## Beline Model - Pooled (Plate Notation)
## Base Model - Pooled (Plate Notation)

![](intro_hierarchical_models_files/images/blog/multilevel_elasticities_single_sku_33_0.svg){fig-align="center" height="600"}

Expand Down Expand Up @@ -255,17 +255,17 @@ See [Bayesian Modeling and Computation in Python, Chapter 4.6: Hierarchical Mode
See [Bayesian Modeling and Computation in Python, Chapter 4.6.1: Posterior Geometry Matters](https://bayesiancomputationbook.com/markdown/chp_04.html#posterior-geometry-matters)
:::

## Non-Ceneter Parametrization {.smaller}
## Non-Centered Parametrization {.smaller}

### Ceneterd Parametrization
### Centered Parametrization

$$
\begin{align*}
\beta \sim \text{Normal}(\mu_{\beta}, \sigma_{\beta})
\end{align*}
$$

### Non-Ceneter Parametrization
### Non-Centered Parametrization

$$
\begin{align*}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<link href="revenue_retention_presentation_files/libs/quarto-html/light-border.css" rel="stylesheet">
<link href="revenue_retention_presentation_files/libs/quarto-html/quarto-html.min.css" rel="stylesheet" data-mode="light">
<link href="revenue_retention_presentation_files/libs/quarto-html/quarto-syntax-highlighting.css" rel="stylesheet" id="quarto-text-highlighting-styles"><meta charset="utf-8">
<meta name="generator" content="quarto-1.3.450">
<meta name="generator" content="quarto-1.3.353">

<meta name="author" content="Dr.&nbsp;Juan Orduz">
<title>Cohort Revenue &amp; Retention Analysis: A Bayesian Approach</title>
Expand Down Expand Up @@ -472,7 +472,7 @@ <h2>Some Bottom-Up Approaches</h2>
</figure>
</div>
<ul>
<li>Transacation process: <span class="math inline">\(\lambda \sim \text{Gamma}(r, \alpha)\)</span>.</li>
<li>Transaction process: <span class="math inline">\(\lambda \sim \text{Gamma}(r, \alpha)\)</span>.</li>
<li>Dropout probability: <span class="math inline">\(p \sim \text{Beta}(a, b)\)</span>.</li>
</ul>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ format:

![](revenue_retention_presentation_files/images/revenue_retention_presentation_files/p_alive.png){fig-align="center"}

- Transacation process: $\lambda \sim \text{Gamma}(r, \alpha)$.
- Transaction process: $\lambda \sim \text{Gamma}(r, \alpha)$.
- Dropout probability: $p \sim \text{Beta}(a, b)$.

:::
Expand Down

0 comments on commit 5d6ae13

Please sign in to comment.