Last active
December 23, 2021 22:14
-
-
Save JakeJing/41780766b4b41b0f66ddedd13b2e16f3 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
my_lkjcorr_fun = " | |
functions { | |
// generate lkj correlation matrix (R) | |
matrix my_lkj_corr_rng(int K, real eta) { | |
return lkj_corr_rng(K, eta); | |
} | |
// generate cholesky factor L_corr of a correlation matrix R | |
matrix my_lkj_corr_chol_rng(int K, real eta){ | |
return lkj_corr_cholesky_rng(K, eta); | |
} | |
// perform triangular matrix multiplication L*L^T | |
matrix my_multiply_lower_tri_self_transpose(matrix L){ | |
return multiply_lower_tri_self_transpose(L); | |
} | |
} | |
" | |
expose_stan_functions(stanc(model_code = my_lkjcorr_fun)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment