Skip to content

Commit

Permalink
Latex fix
Browse files Browse the repository at this point in the history
  • Loading branch information
WardBrian committed Dec 10, 2024
1 parent e5ec664 commit 65e3a46
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 16 deletions.
26 changes: 13 additions & 13 deletions src/reference-manual/transforms.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -477,12 +477,12 @@ $$
For the transform, Stan uses the first part of an isometric log ratio
transform; see [@egozcue+etal:2003] for the basic definitions and
Chapter 3 of [@filzmoser+etal:2018] for the pivot coordinate version
used here. Stan uses the isometric log ratio transform because it
used here. Stan uses the isometric log ratio transform because it
results in equal variances of the the constrained sum to zero
vector see, e.g.,[@seyboldt:2024]. Simpler alternatives, such as setting the
final element to the negative sum of the first elements, do not result in
equal variances. The $N - 1$ unconstrained parameters are independent, however,
the sum-to-zero constraint induces a negative correlation across the
equal variances. The $N - 1$ unconstrained parameters are independent, however,
the sum-to-zero constraint induces a negative correlation across the
constrained vector values.

### Zero sum transform {-}
Expand Down Expand Up @@ -520,7 +520,7 @@ It maps an unconstrained vector $y \in \mathbb{R}^N$ to a zero-sum vector $x \in
$$
\sum_{n=1}^{N + 1} x_n = 0.
$$
The values are defined inductively, starting with
The values are defined inductively, starting with
$$
x_1 = \sum_{n=1}^N \frac{y_n}{\sqrt{n \cdot (n + 1)}}
$$
Expand All @@ -536,7 +536,7 @@ $$
\sum_{n = 1}^{N + 1} x_n = 0
$$
by construction, because each of the terms added to $x_{n}$ is then
subtracted from $x_{n + 1}$ the number of times it shows up in earlier terms.
subtracted from $x_{n + 1}$ the number of times it shows up in earlier terms.

### Absolute Jacobian determinant of the zero sum inverse transform {-}

Expand Down Expand Up @@ -757,14 +757,14 @@ $$
## Stochastic Matrix {#stochastic-matrix-transform.section}

The `column_stochastic_matrix[N, M]` and `row_stochastic_matrix[N, M]` type in
Stan represents an \(N \times M\) matrix where each column (row) is a unit simplex
of dimension \(N\). In other words, each column (row) of the matrix is a vector
Stan represents an $N \times M$ matrix where each column (row) is a unit simplex
of dimension $N$. In other words, each column (row) of the matrix is a vector
constrained to have non-negative entries that sum to one.

### Definition of a Stochastic Matrix {-}

A column stochastic matrix \(X \in \mathbb{R}^{N \times M}\) is defined such
that each column is a simplex. For column \(m\) (where \(1 \leq m \leq M\)):
A column stochastic matrix $X \in \mathbb{R}^{N \times M}$ is defined such
that each column is a simplex. For column $m$ (where $1 \leq m \leq M$):

$$
X_{n, m} \geq 0 \quad \text{for } 1 \leq n \leq N,
Expand All @@ -790,8 +790,8 @@ $$
\sum_{m=1}^N X_{n, m} = 1.
$$

This definition ensures that each column (row) of the matrix \(X\) lies on the
\(N-1\) dimensional unit simplex, similar to the `simplex[N]` type, but
This definition ensures that each column (row) of the matrix $X$ lies on the
$N-1$ dimensional unit simplex, similar to the `simplex[N]` type, but
extended across multiple columns(rows).

### Inverse Transform for Stochastic Matrix {-}
Expand All @@ -801,8 +801,8 @@ as simplex, but applied to each column (row).

### Absolute Jacobian Determinant for the Inverse Transform {-}

The Jacobian determinant of the inverse transform for each column \(m\) in
the matrix is given by the product of the diagonal entries \(J_{n, m}\) of
The Jacobian determinant of the inverse transform for each column $m$ in
the matrix is given by the product of the diagonal entries $J_{n, m}$ of
the lower-triangular Jacobian matrix. This determinant is calculated as:

$$
Expand Down
6 changes: 3 additions & 3 deletions src/reference-manual/types.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -678,7 +678,7 @@ priors for some parameters.

A stochastic matrix is a matrix where each column or row is a
unit simplex, meaning that each column (row) vector has non-negative
values that sum to 1. The following example is a \(3 \times 4\)
values that sum to 1. The following example is a $3 \times 4$
column-stochastic matrix.

$$
Expand All @@ -689,7 +689,7 @@ $$
\end{bmatrix}
$$

An example of a \(3 \times 4\) row-stochastic matrix is the following.
An example of a $3 \times 4$ row-stochastic matrix is the following.

$$
\begin{bmatrix}
Expand Down Expand Up @@ -731,7 +731,7 @@ As with simplexes, `column_stochastic_matrix` and `row_stochastic_matrix`
variables are subject to validation, ensuring that each column (row)
satisfies the simplex constraints. This validation accounts for
floating-point imprecision, with checks performed up to a statically
specified accuracy threshold \(\epsilon\).
specified accuracy threshold $\epsilon$.

#### Stability Considerations {-}

Expand Down

0 comments on commit 65e3a46

Please sign in to comment.