stan-dev / example-models

Example models for Stan
http://mc-stan.org/
772 stars 479 forks source link

update model files to remove deprecated syntax #131

Closed mitzimorris closed 1 year ago

mitzimorris commented 6 years ago

Stan 2.17.1+ returns warnings:

Warning (non-fatal): Comments beginning with # are deprecated.  Please use // in place of # for line comments.
Warning (non-fatal): assignment operator <- deprecated in the Stan language; use = instead.
Warning (non-fatal): increment_log_prob(...); is deprecated and will be removed in the future.
Warning (non-fatal): the if_else() function is deprecated.  Use the conditional operator '?:' instead.
Warning: Deprecated function 'cauchy_log'; please replace suffix '_log' with '_lpdf' for density functions or '_lpmf' for mass functions
....
  1. Change comments # to //
  2. Change assignment operator <- to =
  3. Change increment_log_prob( to target +=
  4. Change if_else() to ?:
  5. change function names, syntax for all functions _log() - name change, use | instead of comma after initial arg

Additional best practice: use compound declare/define whenever possible