-
-
Notifications
You must be signed in to change notification settings - Fork 479
Update basic_distributions syntax #190
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
Update basic_distributions syntax #190
Conversation
Nice! Thanks! Do you check using rstan 2.26? cmdstan adds a _model suffix and rstan should as well to avoid the problem. |
Ah good call, yep no errors under RStan 2.26 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The auto-formatter from stanc3 suggests a bit different formatting in some places, though I guess its a matter of personal taste a bit so feel free to ignore.
Thanks for doing this!
matrix[2,2] Sigma = [[1, 0.1], | ||
[0.1, 1]]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
matrix[2,2] Sigma = [[1, 0.1], | |
[0.1, 1]]; | |
matrix[2,2] Sigma = [[1, 0.1], [0.1, 1]]; |
cov_matrix[3] S = [[2, 0, 0], | ||
[0, 1, 0], | ||
[0, 0, 0.5]]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cov_matrix[3] S = [[2, 0, 0], | |
[0, 1, 0], | |
[0, 0, 0.5]]; | |
cov_matrix[3] S = [[2, 0, 0], [0, 1, 0], [0, 0, 0.5]]; |
cov_matrix[2] S = [[2, 0], | ||
[0, 0.5]]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cov_matrix[2] S = [[2, 0], | |
[0, 0.5]]; | |
cov_matrix[2] S = [[2, 0], [0, 0.5]]; |
basic_distributions/wishart2.stan
Outdated
|
||
for (m in 1:4) | ||
for (n in 1:(m-1)) | ||
S[m,n] <- S[n,m]; | ||
S[m,n] = S[n,m]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the above was filling the lower triangular parts we could use symmetrize_from_lower_tri but no sense complicating I guess.
cov_matrix[2] S = [[2, 0], | ||
[0, 0.5]]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cov_matrix[2] S = [[2, 0], | |
[0, 0.5]]; | |
cov_matrix[2] S = [[2, 0], [0, 0.5]]; |
basic_distributions/wishart2x2.stan
Outdated
matrix[2,2] W = [[sd1^2, cov], | ||
[cov, sd2^2]]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
matrix[2,2] W = [[sd1^2, cov], | |
[cov, sd2^2]]; | |
matrix[2,2] W = [[sd1 ^ 2, cov], [cov, sd2 ^ 2]]; |
Just for the example models I think I'd prefer to leave the matrix declarations in the matrix layout (rather than a one-liner), so that the |
Yeah, its why I said these are optional. Let me know when to take another look. |
Works for me! Ready for another look |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
I'm going to start (slowly & sporadically) updating the syntax in these example models to modern Stan language, and remove deprecated syntax.
This PR updates the models in the
basic_distributions
folder. I've checked that all models parse under Stanc3 (with the exception of a known issue