Skip to content

Commit

Permalink
fix tex errors
Browse files Browse the repository at this point in the history
  • Loading branch information
martinjankowiak committed Nov 10, 2021
1 parent 9ada313 commit 6170748
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 23 deletions.
20 changes: 10 additions & 10 deletions millipede/normal.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,39 +21,39 @@ class NormalLikelihoodSampler(MCMCSampler):
.. math::
X \in \mathbb{R}^{N \\times P} \qquad \qquad Y \in \mathbb{R}^{N}
X \in \mathbb{R}^{N \times P} \qquad \qquad Y \in \mathbb{R}^{N}
The inclusion of each covariate is governed by a Bernoulli random variable :math:`\gamma_p`.
In particular :math:`\gamma_p = 0` corresponds to exclusion and :math:`\gamma_p = 1` corresponds to inclusion.
The prior probability of inclusion is governed by :math:`h` or alternatively :math:`S`:
.. math::
h \in [0, 1] \qquad \\rm{with} \qquad S \equiv hP
h \in [0, 1] \qquad \rm{with} \qquad S \equiv hP
Putting this together, the model specification for an isotopric prior (with an intercept
:math:`\\beta_0` included) is as follows:
:math:`\beta_0` included) is as follows:
.. math::
&\gamma_p \sim \\rm{Bernoulli}(h) \\qquad \\rm{for} \\qquad p=1,2,...,P
&\gamma_p \sim \rm{Bernoulli}(h) \qquad \rm{for} \qquad p=1,2,...,P
&\\sigma^2 \sim \\rm{InverseGamma}(\\nu_0 / 2, \\nu_0 \\lambda_0 / 2)
&\sigma^2 \sim \rm{InverseGamma}(\nu_0 / 2, \nu_0 \lambda_0 / 2)
&\\beta_0 \sim \\rm{Normal}(0, \\sigma^2\\tau_\\rm{intercept}^{-1})
&\beta_0 \sim \rm{Normal}(0, \sigma^2\tau_\rm{intercept}^{-1})
&\\beta_\gamma \sim \\rm{Normal}(0, \\sigma^2 \\tau^{-1} \\mathbb{1}_\\gamma)
&\beta_\gamma \sim \rm{Normal}(0, \sigma^2 \tau^{-1} \mathbb{1}_\gamma)
&Y_n \sim \\rm{Normal}(X_{n, \\gamma} \cdot \\beta_\gamma, \\sigma^2)
&Y_n \sim \rm{Normal}(X_{n, \gamma} \cdot \beta_\gamma, \sigma^2)
Note that the dimension of :math:`\\beta_\gamma` depends on the number of covariates
Note that the dimension of :math:`\beta_\gamma` depends on the number of covariates
included in a particular model (i.e. on the number of non-zero entries in :math:`\gamma`).
For a gprior the prior over the coefficients is instead specified as follows:
.. math::
\\beta_{\gamma} \sim \\rm{Normal}(0, c \\sigma^2 (X_\\gamma^{\\rm{T}} X_\\gamma)^{-1})
\beta_{\gamma} \sim \rm{Normal}(0, c \sigma^2 (X_\gamma^{\rm{T}} X_\gamma)^{-1})
Usage of this class is only recommended for advanced users. For most users it should
suffice to use :class:`NormalLikelihoodVariableSelector`.
Expand Down
26 changes: 13 additions & 13 deletions millipede/selection.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,42 +37,42 @@ class NormalLikelihoodVariableSelector(object):
.. math::
X \in \mathbb{R}^{N \\times P} \qquad \qquad Y \in \mathbb{R}^{N}
X \in \mathbb{R}^{N \times P} \qquad \qquad Y \in \mathbb{R}^{N}
The inclusion of each covariate is governed by a Bernoulli random variable :math:`\gamma_p`.
In particular :math:`\gamma_p = 0` corresponds to exclusion and :math:`\gamma_p = 1` corresponds to inclusion.
The prior probability of inclusion is governed by :math:`h` or alternatively :math:`S`:
.. math::
h \in [0, 1] \qquad \\rm{with} \qquad S \equiv hP
h \in [0, 1] \qquad \rm{with} \qquad S \equiv hP
Putting this together, the model specification for an isotopric prior (with an intercept
:math:`\\beta_0` included) is as follows:
:math:`\beta_0` included) is as follows:
.. math::
&\gamma_p \sim \\rm{Bernoulli}(h) \\qquad \\rm{for} \\qquad p=1,2,...,P
&\gamma_p \sim \rm{Bernoulli}(h) \qquad \rm{for} \qquad p=1,2,...,P
&\\sigma^2 \sim \\rm{InverseGamma}(\\nu_0 / 2, \\nu_0 \\lambda_0 / 2)
&\sigma^2 \sim \rm{InverseGamma}(\nu_0 / 2, \nu_0 \lambda_0 / 2)
&\\beta_0 \sim \\rm{Normal}(0, \\sigma^2\\tau_\\rm{intercept}^{-1})
&\beta_0 \sim \rm{Normal}(0, \sigma^2\tau_\rm{intercept}^{-1})
&\\beta_\gamma \sim \\rm{Normal}(0, \\sigma^2 \\tau^{-1} \\mathbb{1}_\\gamma)
&\beta_\gamma \sim \rm{Normal}(0, \sigma^2 \tau^{-1} \mathbb{1}_\gamma)
&Y_n \sim \\rm{Normal}(X_{n, \\gamma} \cdot \\beta_\gamma, \\sigma^2)
&Y_n \sim \rm{Normal}(X_{n, \gamma} \cdot \beta_\gamma, \sigma^2)
Note that the dimension of :math:`\\beta_\gamma` depends on the number of covariates
Note that the dimension of :math:`\beta_\gamma` depends on the number of covariates
included in a particular model (i.e. on the number of non-zero entries in :math:`\gamma`).
The hyperparameters :math:`\\nu_0` and :math:`\\lambda_0` govern the prior over
:math:`\\sigma^2`. The default choice :math:`\\nu_0=\\lambda_0=0` corresponds to an
improper prior :math:`p(\sigma^2) \propto 1/\\sigma^2`.
The hyperparameters :math:`\nu_0` and :math:`\lambda_0` govern the prior over
:math:`\sigma^2`. The default choice :math:`\nu_0=\lambda_0=0` corresponds to an
improper prior :math:`p(\sigma^2) \propto 1/\sigma^2`.
For a gprior the prior over the coefficients is instead specified as follows:
.. math::
\\beta_{\gamma} \sim \\rm{Normal}(0, c \\sigma^2 (X_\\gamma^{\\rm{T}} X_\\gamma)^{-1})
\beta_{\gamma} \sim \rm{Normal}(0, c \sigma^2 (X_\gamma^{\rm{T}} X_\gamma)^{-1})
where :math:`c > 0` is a user-specified hyperparameter.
Expand Down

0 comments on commit 6170748

Please sign in to comment.