Skip to content
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

Minor fixes to beta function parameters and clarifying text for gamma distribution #640

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -368,11 +368,13 @@ For a description of argument and return types, see section

### Probability density function

If $\alpha \in \mathbb{R}^+$ and $\beta \in \mathbb{R}^+$, then for $y
If the shape parameter $\alpha \in \mathbb{R}^+$ and the rate (or inverse scale) parameter $\beta \in \mathbb{R}^+$, then for $y
\in \mathbb{R}^+$, \[ \text{Gamma}(y|\alpha,\beta) =
\frac{\beta^{\alpha}} {\Gamma(\alpha)} \, y^{\alpha - 1}
\exp(-\beta \, y) . \]

Under the shape and rate formulation of the Gamma distribution, $E(y) = \alpha/\beta$ and $\var(y) = \alpha/\beta^2$.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry I didn't see this before. This is fine, but we've used \mathbb{E}[y] for expectations and typically Y for random variables. Also \mathrm{var}[y] (though that may be what \var does?).


### Sampling statement

`y ~ ` **`gamma`**`(alpha, beta)`
Expand Down
2 changes: 1 addition & 1 deletion src/functions-reference/real-valued_basic_functions.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -1217,7 +1217,7 @@ Return the natural logarithm of the beta function applied to alpha and
beta. The beta function, $\text{B}(\alpha,\beta)$, computes the
normalizing constant for the beta distribution, and is defined for
$\alpha > 0$ and $\beta > 0$. \[ \text{lbeta}(\alpha,\beta) = \log
\Gamma(a) + \log \Gamma(b) - \log \Gamma(a+b) \] See section
\Gamma(\alpha) + \log \Gamma(\beta) - \log \Gamma(\alpha+\beta) \] See section
[appendix](#beta-appendix) for definition of $\text{B}(\alpha, \beta)$.
`r since("2.0")`

Expand Down