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

Update models to stanc3 synatx #330

Closed
rok-cesnovar opened this issue Jan 27, 2021 · 3 comments
Closed

Update models to stanc3 synatx #330

rok-cesnovar opened this issue Jan 27, 2021 · 3 comments
Labels
good first issue Good for newcomers

Comments

@rok-cesnovar
Copy link
Member

Summary:

Example: https://mc-stan.org/docs/2_26/stan-users-guide/QR-reparameterization-section.html

The transformed data could be rewritten from

transformed data {
  matrix[N, K] Q_ast;
  matrix[K, K] R_ast;
  matrix[K, K] R_ast_inverse;
  // thin and scale the QR decomposition
  Q_ast = qr_thin_Q(x) * sqrt(N - 1);
  R_ast = qr_thin_R(x) / sqrt(N - 1);
  R_ast_inverse = inverse(R_ast);
}

to

transformed data {
  // thin and scale the QR decomposition
  matrix[N, K] Q_ast = qr_thin_Q(x) * sqrt(N - 1);
  matrix[K, K] R_ast = qr_thin_R(x) / sqrt(N - 1);
  matrix[K, K] R_ast_inverse = inverse(R_ast);
}

So removing deprecated syntax and use shorter and cleaner sytnax where possible.

Essentialy what @andrjohns did in stan-dev/example-models#190.

This is a good issue for anyone looking to contribute but doesnt know where to start.

@rok-cesnovar rok-cesnovar added the good first issue Good for newcomers label Jan 27, 2021
@caesoma
Copy link

caesoma commented Feb 11, 2021

Is this just replacing the separate type specification with the full specification and assignment for the example models in this Part 1?

@rok-cesnovar
Copy link
Member Author

rok-cesnovar commented Feb 11, 2021

Yes, mostly replacing separate declaration and assignment to a one-liner. I was aiming to get this fixed wherever we do this in the user guide but fixing it in any chapter would be more than welcome!

@mitzimorris
Copy link
Member

done via #720

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

No branches or pull requests

3 participants