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

What to do with CorrBijector ? #268

Open
harisorgn opened this issue Jun 12, 2023 · 1 comment
Open

What to do with CorrBijector ? #268

harisorgn opened this issue Jun 12, 2023 · 1 comment

Comments

@harisorgn
Copy link
Member

After #246, CorrBijector is no longer in use. This was the old bijector for LKJ which mapped a correlation matrix to a matrix of the same dimensions in unconstrained space (see https://mc-stan.org/docs/reference-manual/correlation-matrix-transform.html).

Shall we remove CorrBijector altogether or keep/adapt it for some other purpose (can't think of something right now) ?

@sethaxen
Copy link
Member

There's still a use-case for a bijector that is effectively F = cholesky(R) for correlation matrix R. Suppose one wants a parameter F because their model needs the Cholesky factorization, but they want to put a Normal(0.9, 0.01) prior on R[1, 2]. Then they would need something like

@model function demo(n)
    F ~ LKJCholesky(n, 1)  # uniform distribution on Matrix(F)
    Rmat, logJ = with_logabsdet_jacobian(inverse(CorrToCholeskyBijector()), F)
    R := Rmat  # track R
    Turing.@addlogprob! logJ + logpdf(Normal(0.9, 0.01), R[1, 2])
    # add the rest of the model using F
end

The current CorrBijector() is effectively VecCholeskyBijector() ∘ CorrToCholeskyBijector()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants