stan-dev / example-models

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

BPA/Ch.07 update #82

Closed ito4303 closed 7 years ago

ito4303 commented 7 years ago

I updated the models in Ch.07 of BPA. Would you review the code?

bob-carpenter commented 7 years ago

I just realized you could simplify some of this code.

psi = inv_logit(...);
z ~ bernoulli(psi);

is equivalent to

logit_psi = ...;
z ~ bernoulli_logit(logit_psi);

We have Bernoulli that takes a parameter on the logit scale, so you don't need an explicit inv_logit. I should update the manual!

ito4303 commented 7 years ago

Thank you for reviewing the code. I'd like to repost the updated models after checking in Stan 2.13 or later.

ito4303 commented 7 years ago

I have updated the models and checked using Stan 2.14. For consistency, bernoulli() is left unchanged.

bob-carpenter commented 7 years ago

Let me know if there's anything else you want me to look at. Otherwise, you can just go ahead and merge (or I can if you'd rather).

ito4303 commented 7 years ago

Thank you for reviewing. I have no more changes in this chapter. Please merge the updates if they look good.