From 65e3a4615dd3d002e288500fc5bc603aa57dc2d0 Mon Sep 17 00:00:00 2001 From: Brian Ward Date: Tue, 10 Dec 2024 10:12:18 -0500 Subject: [PATCH] Latex fix --- src/reference-manual/transforms.qmd | 26 +++++++++++++------------- src/reference-manual/types.qmd | 6 +++--- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/src/reference-manual/transforms.qmd b/src/reference-manual/transforms.qmd index 2db22abb8..c12c4eeaf 100644 --- a/src/reference-manual/transforms.qmd +++ b/src/reference-manual/transforms.qmd @@ -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 {-} @@ -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)}} $$ @@ -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 {-} @@ -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, @@ -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 {-} @@ -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: $$ diff --git a/src/reference-manual/types.qmd b/src/reference-manual/types.qmd index 089b962a2..9e23f92e3 100644 --- a/src/reference-manual/types.qmd +++ b/src/reference-manual/types.qmd @@ -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. $$ @@ -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} @@ -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 {-}