Skip to content

Revise Web pages #11

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 10, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions bayesml/autoregressive/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
.. math::
\mathrm{St}(x_{n+1}|m_\mathrm{p}, \lambda_\mathrm{p}, \nu_\mathrm{p})
= \frac{\Gamma (\nu_\mathrm{p}/2 + 1/2)}{\Gamma (\nu_\mathrm{p}/2)}
\left( \frac{m_\mathrm{p}}{\pi \nu_\mathrm{p}} \right)^{1/2}
\left( \frac{\lambda_\mathrm{p}}{\pi \nu_\mathrm{p}} \right)^{1/2}
\left[ 1 + \frac{\lambda_\mathrm{p}(x_{n+1}-m_\mathrm{p})^2}{\nu_\mathrm{p}} \right]^{-\nu_\mathrm{p}/2 - 1/2}.

.. math::
Expand All @@ -95,7 +95,7 @@
where the parameters are obtained from the hyperparameters of the posterior distribution as follows.

.. math::
m_\mathrm{p} &= \mu_n^\top \boldsymbol{x}'_n,\\
m_\mathrm{p} &= \boldsymbol{\mu}_n^\top \boldsymbol{x}'_n,\\
\lambda_\mathrm{p} &= \frac{\alpha_n}{\beta_n} (1 + (\boldsymbol{x}'_n)^\top \boldsymbol{\Lambda}_n^{-1} \boldsymbol{x}'_n)^{-1},\\
\nu_\mathrm{p} &= 2 \alpha_n.
"""
Expand Down
12 changes: 6 additions & 6 deletions bayesml/bernoulli/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
* :math:`B(\cdot,\cdot): \mathbb{R}_{>0} \times \mathbb{R}_{>0} \to \mathbb{R}_{>0}`: the Beta function

.. math::
p(\theta) = \mathrm{Beta}(\theta|\alpha_0,\beta_0) = \frac{1}{B(\alpha_0, \beta_0)} \theta^{\alpha_0} (1-\theta)^{\beta_0}.
p(\theta) = \mathrm{Beta}(\theta|\alpha_0,\beta_0) = \frac{1}{B(\alpha_0, \beta_0)} \theta^{\alpha_0 - 1} (1-\theta)^{\beta_0 - 1}.

.. math::
\mathbb{E}[\theta] &= \frac{\alpha_0}{\alpha_0 + \beta_0}, \\
Expand All @@ -36,11 +36,11 @@
* :math:`\beta_n \in \mathbb{R}_{>0}`: a hyperparameter

.. math::
p(\theta | x^n) = \mathrm{Beta}(\theta|\alpha_n,\beta_n) = \frac{1}{B(\alpha_n, \beta_n)} \theta^{\alpha_n} (1-\theta)^{\beta_n},
p(\theta | x^n) = \mathrm{Beta}(\theta|\alpha_n,\beta_n) = \frac{1}{B(\alpha_n, \beta_n)} \theta^{\alpha_n - 1} (1-\theta)^{\beta_n - 1},

.. math::
\mathbb{E}[\theta | x^n] &= \frac{\alpha_n}{\alpha_n + \beta_n}, \\
\mathbb{V}[\theta | x^n] &= \frac{\alpha_n \beta_n}{(\alpha_n + \beta_n)^2 (\alpha_n + \beta_n + 1)}.
\mathbb{V}[\theta | x^n] &= \frac{\alpha_n \beta_n}{(\alpha_n + \beta_n)^2 (\alpha_n + \beta_n + 1)},

where the updating rule of the hyperparameters is

Expand All @@ -56,16 +56,16 @@
* :math:`\theta_\mathrm{p} \in [0,1]`: a parameter

.. math::
p(x_{n+1} | x^n) = \mathrm{Bern}(x_{n+1}|\theta_\mathrm{p}) =\theta_\mathrm{p}^{x_{n+1}}(1-\theta_\mathrm{p})^{1-x_{n+1}}
p(x_{n+1} | x^n) = \mathrm{Bern}(x_{n+1}|\theta_\mathrm{p}) =\theta_\mathrm{p}^{x_{n+1}}(1-\theta_\mathrm{p})^{1-x_{n+1}},

.. math::
\mathbb{E}[x_{n+1} | x^n] &= \theta_\mathrm{p}, \\
\mathbb{V}[x_{n+1} | x^n] &= \theta_\mathrm{p} (1 - \theta_\mathrm{p}).
\mathbb{V}[x_{n+1} | x^n] &= \theta_\mathrm{p} (1 - \theta_\mathrm{p}),

where the parameters are obtained from the hyperparameters of the posterior distribution as follows.

.. math::
\theta_\mathrm{p} = \frac{\alpha_n}{\alpha_n + \beta_n}
\theta_\mathrm{p} = \frac{\alpha_n}{\alpha_n + \beta_n}.
"""

from ._bernoulli import GenModel
Expand Down
6 changes: 3 additions & 3 deletions bayesml/categorical/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

The prior distribution is as follows:

* :math:`\boldsymbol{\alpha}_0 \in \mathbb{R}_{>0}`: a hyperparameter
* :math:`\boldsymbol{\alpha}_0 \in \mathbb{R}_{>0}^d`: a hyperparameter
* :math:`\Gamma (\cdot)`: the gamma function
* :math:`\tilde{\alpha}_0 = \sum_{k=1}^d \alpha_{0,k}`
* :math:`C(\boldsymbol{\alpha}_0)=\frac{\Gamma(\tilde{\alpha}_0)}{\Gamma(\alpha_{0,1})\cdots\Gamma(\alpha_{0,d})}`
Expand Down Expand Up @@ -58,7 +58,7 @@

The predictive distribution is as follows:

* :math:`x_{n+1} \in \{ 0, 1\}^d`: a new data point
* :math:`\boldsymbol{x}_{n+1} \in \{ 0, 1\}^d`: a new data point
* :math:`\boldsymbol{\theta}_\mathrm{p} \in [0, 1]^d`: the hyperparameter of the posterior (:math:`\sum_{k=1}^d \theta_{\mathrm{p},k} = 1`)

.. math::
Expand All @@ -72,7 +72,7 @@
where the parameters are obtained from the hyperparameters of the posterior distribution as follows:

.. math::
\boldsymbol{\theta}_{\mathrm{p},k} = \frac{\alpha_{n,k}}{\sum_{k=1}^d \alpha_{n,k}}, \quad (k \in \{ 1, 2, \dots , d \}).
\theta_{\mathrm{p},k} = \frac{\alpha_{n,k}}{\sum_{k=1}^d \alpha_{n,k}}, \quad (k \in \{ 1, 2, \dots , d \}).
"""

from ._categorical import GenModel
Expand Down
8 changes: 4 additions & 4 deletions bayesml/exponential/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,13 @@

.. math::
\mathbb{E}[\lambda | x^n] &= \frac{\alpha_n}{\beta_n}, \\
\mathbb{V}[\lambda | x^n] &= \frac{\alpha_n}{\beta_n^2}.
\mathbb{V}[\lambda | x^n] &= \frac{\alpha_n}{\beta_n^2},

where the updating rule of the hyperparameters is

.. math::
\alpha_n &= \alpha_0 + n\\
\beta_n &= \beta_0 + \sum_{i=1}^n x_i
\alpha_n &= \alpha_0 + n,\\
\beta_n &= \beta_0 + \sum_{i=1}^n x_i.


The predictive distribution is as follows:
Expand All @@ -58,7 +58,7 @@
* :math:`\eta_\mathrm{p} \in \mathbb{R}_{>0}`: the hyperparameter of the posterior

.. math::
p(x_{n+1}|x^n)=\mathrm{Lomax}(x_{n+1}|\alpha_\mathrm{p},\eta_\mathrm{p}) = \frac{\alpha_\mathrm{p}}{\eta_\mathrm{p}}\left(1+\frac{x}{\eta_\mathrm{p}}\right)^{-(\alpha_\mathrm{p}+1)},
p(x_{n+1}|x^n)=\mathrm{Lomax}(x_{n+1}|\alpha_\mathrm{p},\eta_\mathrm{p}) = \frac{\alpha_\mathrm{p}}{\eta_\mathrm{p}}\left(1+\frac{x_{n+1}}{\eta_\mathrm{p}}\right)^{-(\alpha_\mathrm{p}+1)},

.. math::
\mathbb{E}[x_{n+1} | x^n] &=
Expand Down
6 changes: 3 additions & 3 deletions bayesml/linearregression/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* :math:`d \in \mathbb N`: a dimension
* :math:`\boldsymbol{x} = [x_1, x_2, \dots , x_d] \in \mathbb{R}^d`: an explanatory variable. If you consider an intercept term, it should be included as one of the elements of :math:`\boldsymbol{x}`.
* :math:`y\in\mathbb{R}`: an objective variable
* :math:`\tau \in\mathbb{R}`: a parameter
* :math:`\tau \in\mathbb{R}_{>0}`: a parameter
* :math:`\boldsymbol{\theta}\in\mathbb{R}^{d}`: a parameter

.. math::
Expand All @@ -25,7 +25,7 @@
The prior distribution is as follows:

* :math:`\boldsymbol{\mu_0} \in \mathbb{R}^d`: a hyperparameter
* :math:`\boldsymbol{\Lambda_0} \in \mathbb{R}^{d\times d}`: a hyperparameter
* :math:`\boldsymbol{\Lambda_0} \in \mathbb{R}^{d\times d}`: a hyperparameter (a positive definite matrix)
* :math:`\alpha_0\in \mathbb{R}_{>0}`: a hyperparameter
* :math:`\beta_0\in \mathbb{R}_{>0}`: a hyperparameter

Expand Down Expand Up @@ -78,7 +78,7 @@

.. math::
p(y_{n+1} | \boldsymbol{X}, \boldsymbol{y}, \boldsymbol{x}_{n+1} ) &= \mathrm{St}\left(y_{n+1} \mid m_\mathrm{p}, \lambda_\mathrm{p}, \nu_\mathrm{p}\right) \\
&= \frac{\Gamma (\nu_\mathrm{p} / 2) + 1/2}{\Gamma (\nu_\mathrm{p} / 2)} \left( \frac{\lambda_\mathrm{p}}{\pi \nu_\mathrm{p}} \right)^{1/2} \left( 1 + \frac{\lambda_\mathrm{p} (y_{n+1} - m_\mathrm{p})^2}{\nu_\mathrm{p}} \right)^{-\nu_\mathrm{p}/2 - 1/2},
&= \frac{\Gamma (\nu_\mathrm{p} / 2 + 1/2 )}{\Gamma (\nu_\mathrm{p} / 2)} \left( \frac{\lambda_\mathrm{p}}{\pi \nu_\mathrm{p}} \right)^{1/2} \left( 1 + \frac{\lambda_\mathrm{p} (y_{n+1} - m_\mathrm{p})^2}{\nu_\mathrm{p}} \right)^{-\nu_\mathrm{p}/2 - 1/2},

.. math::
\mathbb{E}[y_{n+1} | \boldsymbol{X}, \boldsymbol{y}, \boldsymbol{x}_{n+1}] &= m_\mathrm{p} & (\nu_\mathrm{p} > 1), \\
Expand Down
4 changes: 2 additions & 2 deletions bayesml/multivariate_normal/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
* :math:`\boldsymbol{x} \in \mathbb{R}^D`: a data point
* :math:`\boldsymbol{\mu} \in \mathbb{R}^D`: a parameter
* :math:`\boldsymbol{\Lambda} \in \mathbb{R}^{D\times D}` : a parameter (a positive definite matrix)
* :math:`| \boldsymbol{\Lambda} | \in \mathbb{R}`: the determinant of :math:`\boldsymbol{\Lambda}_0`
* :math:`| \boldsymbol{\Lambda} | \in \mathbb{R}`: the determinant of :math:`\boldsymbol{\Lambda}`

.. math::
p(\boldsymbol{x} | \boldsymbol{\mu}, \boldsymbol{\Lambda}) &= \mathcal{N}(\boldsymbol{x}|\boldsymbol{\mu},\boldsymbol{\Lambda}^{-1}) \\
Expand Down Expand Up @@ -51,7 +51,7 @@
* :math:`\boldsymbol{x}^n = (\boldsymbol{x}_1, \boldsymbol{x}_2, \dots , \boldsymbol{x}_n) \in \mathbb{R}^{D\times n}`: given data
* :math:`\boldsymbol{m}_n \in \mathbb{R}^{D}`: a hyperparameter
* :math:`\kappa_n \in \mathbb{R}_{>0}`: a hyperparameter
* :math:`\nu_n \in \mathbb{R}`: a hyperparameter :math:`(\nu_0 > D-1)`
* :math:`\nu_n \in \mathbb{R}`: a hyperparameter :math:`(\nu_n > D-1)`
* :math:`\boldsymbol{W}_n \in \mathbb{R}^{D\times D}`: a hyperparameter (a positive definite matrix)

.. math::
Expand Down
6 changes: 3 additions & 3 deletions bayesml/normal/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
\mathbb{E}[\mu | x^n] &= m_n & \left( \alpha_n > \frac{1}{2} \right), \\
\mathbb{V}[\mu | x^n] &= \frac{\beta_n \alpha_n}{\alpha_n (\alpha_n - 1)} & (\alpha_n > 1), \\
\mathbb{E}[\tau | x^n] &= \frac{\alpha_n}{\beta_n}, \\
\mathbb{V}[\tau | x^n] &= \frac{\alpha_n}{\beta_n^2}.
\mathbb{V}[\tau | x^n] &= \frac{\alpha_n}{\beta_n^2},

where the updating rule of the hyperparameters is

Expand All @@ -66,7 +66,7 @@
m_n &= \frac{\kappa_0 m_0 + n \bar{x}}{\kappa_0 + n}, \\
\kappa_n &= \kappa_0 + n, \\
\alpha_n &= \alpha_0 + \frac{n}{2}, \\
\beta_n &= \beta_0 + \frac{1}{2} \left( \sum_{i=0}^n (x_i - \bar{x})^2 + \frac{\kappa_0 n}{\kappa_n + n} (\bar{x} - m_0)^2 \right).
\beta_n &= \beta_0 + \frac{1}{2} \left( \sum_{i=1}^n (x_i - \bar{x})^2 + \frac{\kappa_0 n}{\kappa_n + n} (\bar{x} - m_0)^2 \right).

The predictive distribution is as follows:

Expand All @@ -77,7 +77,7 @@

.. math::
p(x_{n+1} | x^{n} ) &= \mathrm{St}(x_{n+1} | \mu_\mathrm{p}, \lambda_\mathrm{p}, \nu_\mathrm{p}) \\
&= \frac{\Gamma (\nu_\mathrm{p} / 2) + 1/2}{\Gamma (\nu_\mathrm{p} / 2)} \left( \frac{\lambda_\mathrm{p}}{\pi \nu_\mathrm{p}} \right)^{1/2} \left( 1 + \frac{\lambda_\mathrm{p} (x_{n+1} - \mu_\mathrm{p})^2}{\nu_\mathrm{p}} \right)^{-\nu_\mathrm{p}/2 - 1/2},
&= \frac{\Gamma (\nu_\mathrm{p} / 2 + 1/2 )}{\Gamma (\nu_\mathrm{p} / 2)} \left( \frac{\lambda_\mathrm{p}}{\pi \nu_\mathrm{p}} \right)^{1/2} \left( 1 + \frac{\lambda_\mathrm{p} (x_{n+1} - \mu_\mathrm{p})^2}{\nu_\mathrm{p}} \right)^{-\nu_\mathrm{p}/2 - 1/2},

.. math::
\mathbb{E}[x_{n+1} | x^n] &= \mu_\mathrm{p} & (\nu_\mathrm{p} > 1), \\
Expand Down
8 changes: 4 additions & 4 deletions bayesml/poisson/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
* :math:`\lambda \in \mathbb{R}_{>0}`: a parameter

.. math::
p(x | \lambda) = \mathrm{Po}(x|\lambda) = \frac{ \lambda^{x} }{x!}\exp \{ -\lambda \}
p(x | \lambda) = \mathrm{Po}(x|\lambda) = \frac{ \lambda^{x} }{x!}\exp \{ -\lambda \}.

The prior distribution is as follows:

Expand All @@ -38,13 +38,13 @@

.. math::
\mathbb{E}[\lambda | x^n] &= \frac{\alpha_n}{\beta_n}, \\
\mathbb{V}[\lambda | x^n] &= \frac{\alpha_n}{\beta_n^2}.
\mathbb{V}[\lambda | x^n] &= \frac{\alpha_n}{\beta_n^2},

where the updating rule of the hyperparameters is

.. math::
\alpha_n &= \alpha_0 + \sum_{i=1}^n x_i\\
\beta_n &= \beta_0 + n
\alpha_n &= \alpha_0 + \sum_{i=1}^n x_i,\\
\beta_n &= \beta_0 + n.

The predictive distribution is as follows:

Expand Down
4 changes: 2 additions & 2 deletions docs/bayesml.autoregressive.html
Original file line number Diff line number Diff line change
Expand Up @@ -336,14 +336,14 @@ <h1>bayesml.autoregressive package<a class="headerlink" href="#bayesml-autoregre
<div class="math notranslate nohighlight">
\[\mathrm{St}(x_{n+1}|m_\mathrm{p}, \lambda_\mathrm{p}, \nu_\mathrm{p})
= \frac{\Gamma (\nu_\mathrm{p}/2 + 1/2)}{\Gamma (\nu_\mathrm{p}/2)}
\left( \frac{m_\mathrm{p}}{\pi \nu_\mathrm{p}} \right)^{1/2}
\left( \frac{\lambda_\mathrm{p}}{\pi \nu_\mathrm{p}} \right)^{1/2}
\left[ 1 + \frac{\lambda_\mathrm{p}(x_{n+1}-m_\mathrm{p})^2}{\nu_\mathrm{p}} \right]^{-\nu_\mathrm{p}/2 - 1/2}.\]</div>
<div class="math notranslate nohighlight">
\[\begin{split}\mathbb{E}[x_{n+1} | x^n] &amp;= m_\mathrm{p} &amp; (\nu_\mathrm{p} &gt; 1), \\
\mathbb{V}[x_{n+1} | x^n] &amp;= \frac{1}{\lambda_\mathrm{p}} \frac{\nu_\mathrm{p}}{\nu_\mathrm{p}-2} &amp; (\nu_\mathrm{p} &gt; 2),\end{split}\]</div>
<p>where the parameters are obtained from the hyperparameters of the posterior distribution as follows.</p>
<div class="math notranslate nohighlight">
\[\begin{split}m_\mathrm{p} &amp;= \mu_n^\top \boldsymbol{x}'_n,\\
\[\begin{split}m_\mathrm{p} &amp;= \boldsymbol{\mu}_n^\top \boldsymbol{x}'_n,\\
\lambda_\mathrm{p} &amp;= \frac{\alpha_n}{\beta_n} (1 + (\boldsymbol{x}'_n)^\top \boldsymbol{\Lambda}_n^{-1} \boldsymbol{x}'_n)^{-1},\\
\nu_\mathrm{p} &amp;= 2 \alpha_n.\end{split}\]</div>
<dl class="py class">
Expand Down
12 changes: 6 additions & 6 deletions docs/bayesml.bernoulli.html
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ <h1>bayesml.bernoulli package<a class="headerlink" href="#bayesml-bernoulli-pack
<li><p><span class="math notranslate nohighlight">\(B(\cdot,\cdot): \mathbb{R}_{&gt;0} \times \mathbb{R}_{&gt;0} \to \mathbb{R}_{&gt;0}\)</span>: the Beta function</p></li>
</ul>
<div class="math notranslate nohighlight">
\[p(\theta) = \mathrm{Beta}(\theta|\alpha_0,\beta_0) = \frac{1}{B(\alpha_0, \beta_0)} \theta^{\alpha_0} (1-\theta)^{\beta_0}.\]</div>
\[p(\theta) = \mathrm{Beta}(\theta|\alpha_0,\beta_0) = \frac{1}{B(\alpha_0, \beta_0)} \theta^{\alpha_0 - 1} (1-\theta)^{\beta_0 - 1}.\]</div>
<div class="math notranslate nohighlight">
\[\begin{split}\mathbb{E}[\theta] &amp;= \frac{\alpha_0}{\alpha_0 + \beta_0}, \\
\mathbb{V}[\theta] &amp;= \frac{\alpha_0 \beta_0}{(\alpha_0 + \beta_0)^2 (\alpha_0 + \beta_0 + 1)}.\end{split}\]</div>
Expand All @@ -292,10 +292,10 @@ <h1>bayesml.bernoulli package<a class="headerlink" href="#bayesml-bernoulli-pack
<li><p><span class="math notranslate nohighlight">\(\beta_n \in \mathbb{R}_{&gt;0}\)</span>: a hyperparameter</p></li>
</ul>
<div class="math notranslate nohighlight">
\[p(\theta | x^n) = \mathrm{Beta}(\theta|\alpha_n,\beta_n) = \frac{1}{B(\alpha_n, \beta_n)} \theta^{\alpha_n} (1-\theta)^{\beta_n},\]</div>
\[p(\theta | x^n) = \mathrm{Beta}(\theta|\alpha_n,\beta_n) = \frac{1}{B(\alpha_n, \beta_n)} \theta^{\alpha_n - 1} (1-\theta)^{\beta_n - 1},\]</div>
<div class="math notranslate nohighlight">
\[\begin{split}\mathbb{E}[\theta | x^n] &amp;= \frac{\alpha_n}{\alpha_n + \beta_n}, \\
\mathbb{V}[\theta | x^n] &amp;= \frac{\alpha_n \beta_n}{(\alpha_n + \beta_n)^2 (\alpha_n + \beta_n + 1)}.\end{split}\]</div>
\mathbb{V}[\theta | x^n] &amp;= \frac{\alpha_n \beta_n}{(\alpha_n + \beta_n)^2 (\alpha_n + \beta_n + 1)},\end{split}\]</div>
<p>where the updating rule of the hyperparameters is</p>
<div class="math notranslate nohighlight">
\[\begin{split}\alpha_n = \alpha_0 + \sum_{i=1}^n I \{ x_i = 1 \},\\
Expand All @@ -308,13 +308,13 @@ <h1>bayesml.bernoulli package<a class="headerlink" href="#bayesml-bernoulli-pack
<li><p><span class="math notranslate nohighlight">\(\theta_\mathrm{p} \in [0,1]\)</span>: a parameter</p></li>
</ul>
<div class="math notranslate nohighlight">
\[p(x_{n+1} | x^n) = \mathrm{Bern}(x_{n+1}|\theta_\mathrm{p}) =\theta_\mathrm{p}^{x_{n+1}}(1-\theta_\mathrm{p})^{1-x_{n+1}}\]</div>
\[p(x_{n+1} | x^n) = \mathrm{Bern}(x_{n+1}|\theta_\mathrm{p}) =\theta_\mathrm{p}^{x_{n+1}}(1-\theta_\mathrm{p})^{1-x_{n+1}},\]</div>
<div class="math notranslate nohighlight">
\[\begin{split}\mathbb{E}[x_{n+1} | x^n] &amp;= \theta_\mathrm{p}, \\
\mathbb{V}[x_{n+1} | x^n] &amp;= \theta_\mathrm{p} (1 - \theta_\mathrm{p}).\end{split}\]</div>
\mathbb{V}[x_{n+1} | x^n] &amp;= \theta_\mathrm{p} (1 - \theta_\mathrm{p}),\end{split}\]</div>
<p>where the parameters are obtained from the hyperparameters of the posterior distribution as follows.</p>
<div class="math notranslate nohighlight">
\[\theta_\mathrm{p} = \frac{\alpha_n}{\alpha_n + \beta_n}\]</div>
\[\theta_\mathrm{p} = \frac{\alpha_n}{\alpha_n + \beta_n}.\]</div>
<dl class="py class">
<dt class="sig sig-object py" id="bayesml.bernoulli.GenModel">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">bayesml.bernoulli.</span></span><span class="sig-name descname"><span class="pre">GenModel</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="o"><span class="pre">*</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">theta</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">0.5</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">h_alpha</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">0.5</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">h_beta</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">0.5</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">seed</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#bayesml.bernoulli.GenModel" title="Permalink to this definition">¶</a></dt>
Expand Down
6 changes: 3 additions & 3 deletions docs/bayesml.categorical.html
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ <h1>bayesml.categorical package<a class="headerlink" href="#bayesml-categorical-
\mathrm{Cov}[x_k, x_{k'} | \boldsymbol{\theta}] &amp;= -\theta_k \theta_{k'}.\end{split}\]</div>
<p>The prior distribution is as follows:</p>
<ul class="simple">
<li><p><span class="math notranslate nohighlight">\(\boldsymbol{\alpha}_0 \in \mathbb{R}_{&gt;0}\)</span>: a hyperparameter</p></li>
<li><p><span class="math notranslate nohighlight">\(\boldsymbol{\alpha}_0 \in \mathbb{R}_{&gt;0}^d\)</span>: a hyperparameter</p></li>
<li><p><span class="math notranslate nohighlight">\(\Gamma (\cdot)\)</span>: the gamma function</p></li>
<li><p><span class="math notranslate nohighlight">\(\tilde{\alpha}_0 = \sum_{k=1}^d \alpha_{0,k}\)</span></p></li>
<li><p><span class="math notranslate nohighlight">\(C(\boldsymbol{\alpha}_0)=\frac{\Gamma(\tilde{\alpha}_0)}{\Gamma(\alpha_{0,1})\cdots\Gamma(\alpha_{0,d})}\)</span></p></li>
Expand Down Expand Up @@ -307,7 +307,7 @@ <h1>bayesml.categorical package<a class="headerlink" href="#bayesml-categorical-
\[\alpha_{n,k} = \alpha_{0,k} + \sum_{i=1}^n x_{i,k}, \quad (k \in \{ 1, 2, \dots , d \}).\]</div>
<p>The predictive distribution is as follows:</p>
<ul class="simple">
<li><p><span class="math notranslate nohighlight">\(x_{n+1} \in \{ 0, 1\}^d\)</span>: a new data point</p></li>
<li><p><span class="math notranslate nohighlight">\(\boldsymbol{x}_{n+1} \in \{ 0, 1\}^d\)</span>: a new data point</p></li>
<li><p><span class="math notranslate nohighlight">\(\boldsymbol{\theta}_\mathrm{p} \in [0, 1]^d\)</span>: the hyperparameter of the posterior (<span class="math notranslate nohighlight">\(\sum_{k=1}^d \theta_{\mathrm{p},k} = 1\)</span>)</p></li>
</ul>
<div class="math notranslate nohighlight">
Expand All @@ -318,7 +318,7 @@ <h1>bayesml.categorical package<a class="headerlink" href="#bayesml-categorical-
\mathrm{Cov}[x_{n+1,k}, x_{n+1,k'} | \boldsymbol{x}^n] &amp;= -\theta_{\mathrm{p},k} \theta_{\mathrm{p},k'},\end{split}\]</div>
<p>where the parameters are obtained from the hyperparameters of the posterior distribution as follows:</p>
<div class="math notranslate nohighlight">
\[\boldsymbol{\theta}_{\mathrm{p},k} = \frac{\alpha_{n,k}}{\sum_{k=1}^d \alpha_{n,k}}, \quad (k \in \{ 1, 2, \dots , d \}).\]</div>
\[\theta_{\mathrm{p},k} = \frac{\alpha_{n,k}}{\sum_{k=1}^d \alpha_{n,k}}, \quad (k \in \{ 1, 2, \dots , d \}).\]</div>
<dl class="py class">
<dt class="sig sig-object py" id="bayesml.categorical.GenModel">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">bayesml.categorical.</span></span><span class="sig-name descname"><span class="pre">GenModel</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="o"><span class="pre">*</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">degree</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">theta_vec</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">h_alpha_vec</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">seed</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#bayesml.categorical.GenModel" title="Permalink to this definition">¶</a></dt>
Expand Down
Loading