-
-
Notifications
You must be signed in to change notification settings - Fork 117
document sum to zero matrix #867
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
Comments
Doc thoughts The
giving If one wanted a ND basis then forming the ND tensor-product of the Helmert bases will result in the correct orthonormal transform. Below is one possible way to present the mathematics behind your Helmert‐like row‐and‐column‐constraining transform in a style reminiscent of a Stan User Guide, but without actual C++ code. The loops are written purely in mathematical notation, showing how each element of the output (Z) is computed. Mathematical Description of the TransformWe have an input matrix and we wish to construct an output matrix subject to the row‐sum‐zero and column‐sum‐zero constraints. Define vectors and initialize Then proceed as follows: Descending loop over columns Define Initialize an accumulator $ \mathrm{ax_prev} = 0 $. Set Inside each column, descending loop over rows Define Form the partial combination Denote this quantity by Update the output: Update the Impose the row‐sum and column‐sum constraints: Accumulate After finishing all rows This ensures the bottom‐right corner reflects the column sum constraint in the last row. At the end of these nested loops, the matrix That is, each row and column of |
As an additional note: besides just the new type, we will also want to document the new overloads to functions like |
It's all merged now -- @spinkney do you want to take the first crack? I can add the new function overloads to whatever branch you work on |
While we're at it, there's a typo in the sum to zero vector: https://discourse.mc-stan.org/t/constraint-transforms/39384 |
The sqrt of y fix is merged but the docs need to be rerendered to show it
…On Tue, May 6, 2025, 11:18 AM Brian Ward ***@***.***> wrote:
*WardBrian* left a comment (stan-dev/docs#867)
<#867 (comment)>
While we're at it, there's a typo in the sum to zero vector:
https://discourse.mc-stan.org/t/constraint-transforms/39384
—
Reply to this email directly, view it on GitHub
<#867 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AFU3D6NONLYMUX6WDUJTXHT25DHELAVCNFSM6AAAAABZYNWNU6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDQNJUHE3TKNRRGY>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Once stan-dev/math#3169 is in I'll need to document this.
The text was updated successfully, but these errors were encountered: