477477For the transform, Stan uses the first part of an isometric log ratio
478478transform; see [ @egozcue +etal:2003] for the basic definitions and
479479Chapter 3 of [ @filzmoser +etal:2018] for the pivot coordinate version
480- used here. Stan uses the isometric log ratio transform because it
480+ used here. Stan uses the isometric log ratio transform because it
481481results in equal variances of the the constrained sum to zero
482482vector see, e.g.,[ @seyboldt :2024] . Simpler alternatives, such as setting the
483483final element to the negative sum of the first elements, do not result in
484- equal variances. The $N - 1$ unconstrained parameters are independent, however,
485- the sum-to-zero constraint induces a negative correlation across the
484+ equal variances. The $N - 1$ unconstrained parameters are independent, however,
485+ the sum-to-zero constraint induces a negative correlation across the
486486constrained vector values.
487487
488488### Zero sum transform {-}
@@ -520,7 +520,7 @@ It maps an unconstrained vector $y \in \mathbb{R}^N$ to a zero-sum vector $x \in
520520$$
521521\sum_{n=1}^{N + 1} x_n = 0.
522522$$
523- The values are defined inductively, starting with
523+ The values are defined inductively, starting with
524524$$
525525x_1 = \sum_{n=1}^N \frac{y_n}{\sqrt{n \cdot (n + 1)}}
526526$$
536536\sum_{n = 1}^{N + 1} x_n = 0
537537$$
538538by construction, because each of the terms added to $x_ {n}$ is then
539- subtracted from $x_ {n + 1}$ the number of times it shows up in earlier terms.
539+ subtracted from $x_ {n + 1}$ the number of times it shows up in earlier terms.
540540
541541### Absolute Jacobian determinant of the zero sum inverse transform {-}
542542
757757## Stochastic Matrix {#stochastic-matrix-transform.section}
758758
759759The ` column_stochastic_matrix[N, M] ` and ` row_stochastic_matrix[N, M] ` type in
760- Stan represents an \( N \times M\) matrix where each column (row) is a unit simplex
761- of dimension \( N \) . In other words, each column (row) of the matrix is a vector
760+ Stan represents an $ N \times M$ matrix where each column (row) is a unit simplex
761+ of dimension $N$ . In other words, each column (row) of the matrix is a vector
762762constrained to have non-negative entries that sum to one.
763763
764764### Definition of a Stochastic Matrix {-}
765765
766- A column stochastic matrix \( X \in \mathbb{R}^{N \times M}\) is defined such
767- that each column is a simplex. For column \( m \) (where \( 1 \leq m \leq M\) ):
766+ A column stochastic matrix $ X \in \mathbb{R}^{N \times M}$ is defined such
767+ that each column is a simplex. For column $m$ (where $ 1 \leq m \leq M$ ):
768768
769769$$
770770X_{n, m} \geq 0 \quad \text{for } 1 \leq n \leq N,
790790\sum_{m=1}^N X_{n, m} = 1.
791791$$
792792
793- This definition ensures that each column (row) of the matrix \( X \) lies on the
794- \( N-1\) dimensional unit simplex, similar to the ` simplex[N] ` type, but
793+ This definition ensures that each column (row) of the matrix $X$ lies on the
794+ $ N-1$ dimensional unit simplex, similar to the ` simplex[N] ` type, but
795795extended across multiple columns(rows).
796796
797797### Inverse Transform for Stochastic Matrix {-}
@@ -801,8 +801,8 @@ as simplex, but applied to each column (row).
801801
802802### Absolute Jacobian Determinant for the Inverse Transform {-}
803803
804- The Jacobian determinant of the inverse transform for each column \( m \) in
805- the matrix is given by the product of the diagonal entries \( J_ {n, m}\) of
804+ The Jacobian determinant of the inverse transform for each column $m$ in
805+ the matrix is given by the product of the diagonal entries $ J_ {n, m}$ of
806806the lower-triangular Jacobian matrix. This determinant is calculated as:
807807
808808$$
0 commit comments