stan-dev / example-models

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

Car iar poisson edits dan #112

Closed dpsimpson closed 7 years ago

dpsimpson commented 7 years ago

Hi,

I've added some a "best practice" parameterisation to the example and a few more references. Everything runs (with tonnes of C++ warnings). I didn't suppress the warnings (even though they're basically meaningless) because Mitzi didn't.

Let me know if anything doesn't make sense. Or anything should be changed.

Best wishes

Dan

bob-carpenter commented 7 years ago

Sorry about the C++ errors. The C++ warnings are coming Boost; we would have to hack the Boost lib imported from Boost to suppress these erroneous warnings. But we're reluctant to modify Boost just to do this.

mitzimorris commented 7 years ago

this is great! merging!

dpsimpson commented 7 years ago

Brilliant!

I think adding message=F, warning=F To the code chunks will suppress the messages, but I'll leave that up to Mitzi.

D

On Mon, 10 Jul 2017 at 15:34, Mitzi Morris notifications@github.com wrote:

Merged #112 https://github.com/stan-dev/example-models/pull/112.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/stan-dev/example-models/pull/112#event-1157460544, or mute the thread https://github.com/notifications/unsubscribe-auth/AOKBBrDXXe5eSouaNP5Ko4A66ZjWBJi6ks5sMny8gaJpZM4OTRgZ .

betanalpha commented 7 years ago

What you want to do is modify your makevar file before running knitr. See http://mc-stan.org/misc/warnings.html#compiler-warnings http://mc-stan.org/misc/warnings.html#compiler-warnings.

There are a few formatting issues here and there (mostly to do with line breaks) but I figured they’ll be cleaned up in future iterations.

On Jul 10, 2017, at 3:40 PM, dpsimpson notifications@github.com wrote:

Brilliant!

I think adding message=F, warning=F To the code chunks will suppress the messages, but I'll leave that up to Mitzi.

D

On Mon, 10 Jul 2017 at 15:34, Mitzi Morris notifications@github.com wrote:

Merged #112 https://github.com/stan-dev/example-models/pull/112.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/stan-dev/example-models/pull/112#event-1157460544, or mute the thread https://github.com/notifications/unsubscribe-auth/AOKBBrDXXe5eSouaNP5Ko4A66ZjWBJi6ks5sMny8gaJpZM4OTRgZ .

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/stan-dev/example-models/pull/112#issuecomment-314212652, or mute the thread https://github.com/notifications/unsubscribe-auth/ABdNlsdGT5I1boaU2A-xK9mbpYTWy7Kyks5sMn4hgaJpZM4OTRgZ.

mitzimorris commented 7 years ago

cleaning up now. also made a version of your bym2 model for the Brooklyn data which has no offset. changing the comments in the model on the 'sigma' and 'rho' params to match what these guys are doing.

once the Rmd knits, will run the inla functions on the Brooklyn data.

there's another directory which has the R code to run the Cook, Gelman, and Rubin procedure to validate the model by replication, and I can run it over this model as well - for a given spatial structure, the scaling factor is constant, correct?

cheers, Mitzi

What you want to do is modify your makevar file before running knitr. See http://mc-stan.org/misc/warnings.html#compiler-warnings http://mc-stan.org/misc/warnings.html#compiler-warnings.

There are a few formatting issues here and there (mostly to do with line breaks) but I figured they’ll be cleaned up in future iterations.

On Jul 10, 2017, at 3:40 PM, dpsimpson notifications@github.com wrote:

Brilliant!

I think adding message=F, warning=F To the code chunks will suppress the messages, but I'll leave that up to Mitzi.

D

On Mon, 10 Jul 2017 at 15:34, Mitzi Morris notifications@github.com wrote:

Merged #112 https://github.com/stan-dev/example-models/pull/112.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/stan-dev/example-models/pull/112#event-1157460544, or mute the thread https://github.com/notifications/unsubscribe-auth/AOKBBrDXXe5eSouaNP5Ko4A66ZjWBJi6ks5sMny8gaJpZM4OTRgZ .

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/stan-dev/example-models/pull/112#issuecomment-314212652, or mute the thread https://github.com/notifications/unsubscribe-auth/ABdNlsdGT5I1boaU2A-xK9mbpYTWy7Kyks5sMn4hgaJpZM4OTRgZ.

-- You are receiving this because you modified the open/close state. Reply to this email directly or view it on GitHub: https://github.com/stan-dev/example-models/pull/112#issuecomment-314255826

dpsimpson commented 7 years ago

That's correct. The scaling is a function of the graph.

Let me know if you need any help making the priors match in inla (or with anything else)

D

On Mon, 10 Jul 2017 at 17:54, Mitzi Morris notifications@github.com wrote:

cleaning up now. also made a version of your bym2 model for the Brooklyn data which has no offset. changing the comments in the model on the 'sigma' and 'rho' params to match what these guys are doing.

once the Rmd knits, will run the inla functions on the Brooklyn data.

there's another directory which has the R code to run the Cook, Gelman, and Rubin procedure to validate the model by replication, and I can run it over this model as well - for a given spatial structure, the scaling factor is constant, correct?

cheers, Mitzi

What you want to do is modify your makevar file before running knitr. See http://mc-stan.org/misc/warnings.html#compiler-warnings http://mc-stan.org/misc/warnings.html#compiler-warnings.

There are a few formatting issues here and there (mostly to do with line breaks) but I figured they’ll be cleaned up in future iterations.

On Jul 10, 2017, at 3:40 PM, dpsimpson notifications@github.com wrote:

Brilliant!

I think adding message=F, warning=F To the code chunks will suppress the messages, but I'll leave that up to Mitzi.

D

On Mon, 10 Jul 2017 at 15:34, Mitzi Morris notifications@github.com wrote:

Merged #112 https://github.com/stan-dev/example-models/pull/112.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub <https://github.com/stan-dev/example-models/pull/112#event-1157460544 , or mute the thread < https://github.com/notifications/unsubscribe-auth/AOKBBrDXXe5eSouaNP5Ko4A66ZjWBJi6ks5sMny8gaJpZM4OTRgZ

.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub < https://github.com/stan-dev/example-models/pull/112#issuecomment-314212652>, or mute the thread < https://github.com/notifications/unsubscribe-auth/ABdNlsdGT5I1boaU2A-xK9mbpYTWy7Kyks5sMn4hgaJpZM4OTRgZ .

-- You are receiving this because you modified the open/close state. Reply to this email directly or view it on GitHub:

https://github.com/stan-dev/example-models/pull/112#issuecomment-314255826

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/stan-dev/example-models/pull/112#issuecomment-314260984, or mute the thread https://github.com/notifications/unsubscribe-auth/AOKBBq-lO7TY5N2n7Kz-A02ga7yQfDo2ks5sMp2kgaJpZM4OTRgZ .

mitzimorris commented 7 years ago

rereading Riebler et al which is beginning to make sense. I would like to add your name as author of this case study - is that OK?

how is Toronto?

we'll be in Paris from July 23 through Sept 13th. when we get back we've got a visit to Halifax promised sometime during late September/early October. after that, I'd like to get going on my plan to move to higher ground, both politically and geographically. that iceberg thing has me freaked.

cheers, Mitzi

That's correct. The scaling is a function of the graph.

Let me know if you need any help making the priors match in inla (or with anything else)

D

On Mon, 10 Jul 2017 at 17:54, Mitzi Morris notifications@github.com wrote:

cleaning up now. also made a version of your bym2 model for the Brooklyn data which has no offset. changing the comments in the model on the 'sigma' and 'rho' params to match what these guys are doing.

once the Rmd knits, will run the inla functions on the Brooklyn data.

there's another directory which has the R code to run the Cook, Gelman, and Rubin procedure to validate the model by replication, and I can run it over this model as well - for a given spatial structure, the scaling factor is constant, correct?

cheers, Mitzi

What you want to do is modify your makevar file before running knitr. See http://mc-stan.org/misc/warnings.html#compiler-warnings http://mc-stan.org/misc/warnings.html#compiler-warnings.

There are a few formatting issues here and there (mostly to do with line breaks) but I figured they’ll be cleaned up in future iterations.

On Jul 10, 2017, at 3:40 PM, dpsimpson notifications@github.com wrote:

Brilliant!

I think adding message=F, warning=F To the code chunks will suppress the messages, but I'll leave that up to Mitzi.

D

On Mon, 10 Jul 2017 at 15:34, Mitzi Morris notifications@github.com wrote:

Merged #112 https://github.com/stan-dev/example-models/pull/112.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub <https://github.com/stan-dev/example-models/pull/112#event-1157460544 , or mute the thread < https://github.com/notifications/unsubscribe-auth/AOKBBrDXXe5eSouaNP5Ko4A66ZjWBJi6ks5sMny8gaJpZM4OTRgZ

.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub < https://github.com/stan-dev/example-models/pull/112#issuecomment-314212652>, or mute the thread < https://github.com/notifications/unsubscribe-auth/ABdNlsdGT5I1boaU2A-xK9mbpYTWy7Kyks5sMn4hgaJpZM4OTRgZ .

-- You are receiving this because you modified the open/close state. Reply to this email directly or view it on GitHub:

https://github.com/stan-dev/example-models/pull/112#issuecomment-314255826

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/stan-dev/example-models/pull/112#issuecomment-314260984, or mute the thread https://github.com/notifications/unsubscribe-auth/AOKBBq-lO7TY5N2n7Kz-A02ga7yQfDo2ks5sMp2kgaJpZM4OTRgZ .

-- You are receiving this because you modified the open/close state. Reply to this email directly or view it on GitHub: https://github.com/stan-dev/example-models/pull/112#issuecomment-314262306

dpsimpson commented 7 years ago

Hi Mitzi, You can add me as an author if you want, but it feels like I'm just swanning in to your hard work and taking credit (after all, you did 95% of it!). Maybe listing me as a "contributor" would be more fair?

I thiknk I'm in NY in late September so hopefully I'll see you there (and you're always welcome here for a visit. Also there are jobs in Toronto...)

D