stan-dev / example-models

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

Dmenne BUG #29

Closed dmenne closed 9 years ago

dmenne commented 9 years ago

To discuss: there is a warning to increment in old version "rats_vec_unit.stan". Result seem ok, and I do not understand what to do; I tend to remove the example, it is not very useful, but try to understand first.

benlambertStan commented 9 years ago

Hi,

I'm also going through the example models in BUGS. Is it worth me continuing on volume 2 so as not to duplicate the workload?

Best,

Ben

On 7 Aug 2015, at 15:17, Dieter Menne notifications@github.com wrote:

Add R test programs to rats, pump, seeds, surgical (1-4, Volume 1) examples of BUGS manual. Added ".stanified" versions of Stan-programs to better reflect recommened practices. -- using vectorized if possible -- replace 1/sigmasquared contortions by sigma -- delete duplicate or non-required files -- somewhat narrower or wider (=default) priors -- test if program converges by running with default random init instead of the constant init. To discuss: there is a warning to increment in old version "rats_vec_unit.stan". Result seem ok, and I do not understand what to do; I tend to remove the example, it is not very useful, but try to understand first.

You can view, comment on, or merge this pull request online at:

https://github.com/stan-dev/example-models/pull/29

Commit Summary

Quick and dirty R script to find the stan files without sample R Corrected pilot examples to be close to ARM13.5 Delete duplicate data files. Vectorize Pump example Add R test program for seeds (BUGS vol 1, 3) Add constrained to zero coefficients as in chapter 3.1 of BUGS manual Corrected WinBUGS link. Links are still incorrect in the individiual files, will be corrected in bulk later. Add R program with plot to created Figure 6 in BUGS manual. Add R program with plot to creat Figure 6 and Figure 7 (ranking) in BUGS manual. Plot Figure 6/7 in manual File Changes

A .gitignore (4) M ARM/Ch.13/13.5_Non-NestedModels.R (6) M ARM/Ch.13/pilots.stan (32) A ARM/UnmatchedStanFiles.R (22) M bugs_examples/README.txt (8) A bugs_examples/vol1/pump/pump.R (51) M bugs_examples/vol1/pump/pump.stan (18) A bugs_examples/vol1/rats/rats.R (74) A bugs_examples/vol1/rats/rats_stanified.stan (39) D bugs_examples/vol1/rats/rats_vec.data.R (22) D bugs_examples/vol1/rats/rats_vec_unit.data.R (22) A bugs_examples/vol1/seeds/seeds.R (107) A bugs_examples/vol1/seeds/seeds_centered.stan (40) A bugs_examples/vol1/seeds/seeds_stanified.stan (34) A bugs_examples/vol1/surgical/surgical.R (64) D bugs_examples/vol1/surgical/surgical_simple.init.R (1) D bugs_examples/vol1/surgical/surgical_simple.stan (11) A bugs_examples/vol1/surgical/surgical_stanified.stan (32) A example-models.Rproj (16) Patch Links:

https://github.com/stan-dev/example-models/pull/29.patch https://github.com/stan-dev/example-models/pull/29.diff — Reply to this email directly or view it on GitHub.

dmenne commented 9 years ago

Hi, Ben,

I do this for my own education, but then Bob asked me to submit a pull request.

It certainly would be good to coordinate. What have you done already? Dividing by the volume line seems ok, but I don’t mind trying other examples.

Dieter

Von: benlambertStan [mailto:notifications@github.com] Gesendet: Freitag, 7. August 2015 15:23 An: stan-dev/example-models example-models@noreply.github.com Cc: Dieter Menne dieter.menne@menne-biomed.de Betreff: Re: [example-models] Dmenne BUG (#29)

Hi,

I'm also going through the example models in BUGS. Is it worth me continuing on volume 2 so as not to duplicate the workload?

Best,

Ben

On 7 Aug 2015, at 15:17, Dieter Menne < mailto:notifications@github.com notifications@github.com> wrote:

Add R test programs to rats, pump, seeds, surgical (1-4, Volume 1) examples of BUGS manual. Added ".stanified" versions of Stan-programs to better reflect recommened practices. -- using vectorized if possible -- replace 1/sigmasquared contortions by sigma -- delete duplicate or non-required files -- somewhat narrower or wider (=default) priors -- test if program converges by running with default random init instead of the constant init. To discuss: there is a warning to increment in old version "rats_vec_unit.stan". Result seem ok, and I do not understand what to do; I tend to remove the example, it is not very useful, but try to understand first.

You can view, comment on, or merge this pull request online at:

https://github.com/stan-dev/example-models/pull/29 https://github.com/stan-dev/example-models/pull/29

Commit Summary

Quick and dirty R script to find the stan files without sample R Corrected pilot examples to be close to ARM13.5 Delete duplicate data files. Vectorize Pump example Add R test program for seeds (BUGS vol 1, 3) Add constrained to zero coefficients as in chapter 3.1 of BUGS manual Corrected WinBUGS link. Links are still incorrect in the individiual files, will be corrected in bulk later. Add R program with plot to created Figure 6 in BUGS manual. Add R program with plot to creat Figure 6 and Figure 7 (ranking) in BUGS manual. Plot Figure 6/7 in manual File Changes

A .gitignore (4) M ARM/Ch.13/13.5_Non-NestedModels.R (6) M ARM/Ch.13/pilots.stan (32) A ARM/UnmatchedStanFiles.R (22) M bugs_examples/README.txt (8) A bugs_examples/vol1/pump/pump.R (51) M bugs_examples/vol1/pump/pump.stan (18) A bugs_examples/vol1/rats/rats.R (74) A bugs_examples/vol1/rats/rats_stanified.stan (39) D bugs_examples/vol1/rats/rats_vec.data.R (22) D bugs_examples/vol1/rats/rats_vec_unit.data.R (22) A bugs_examples/vol1/seeds/seeds.R (107) A bugs_examples/vol1/seeds/seeds_centered.stan (40) A bugs_examples/vol1/seeds/seeds_stanified.stan (34) A bugs_examples/vol1/surgical/surgical.R (64) D bugs_examples/vol1/surgical/surgical_simple.init.R (1) D bugs_examples/vol1/surgical/surgical_simple.stan (11) A bugs_examples/vol1/surgical/surgical_stanified.stan (32) A example-models.Rproj (16) Patch Links:

https://github.com/stan-dev/example-models/pull/29.patch https://github.com/stan-dev/example-models/pull/29.patch https://github.com/stan-dev/example-models/pull/29.diff https://github.com/stan-dev/example-models/pull/29.diff — Reply to this email directly or view it on GitHub.

— Reply to this email directly or view it on GitHub https://github.com/stan-dev/example-models/pull/29#issuecomment-128697791 . https://github.com/notifications/beacon/AAe5o-tR1FCwcyov5AH9AP2NZiq3dfvJks5olKi3gaJpZM4Fnigi.gif

benlambertStan commented 9 years ago

Hi Dieter,

I've also gone through most of the examples you mention, as well as the dogs and beta blockers examples from volume 1. Will commit my models to the GitHub next week sometime.

I'll start to look at volume 2 examples now.

Cheers,

Ben

On 7 Aug 2015, at 15:29, Dieter Menne notifications@github.com wrote:

Hi, Ben,

I do this for my own education, but then Bob asked me to submit a pull request.

It certainly would be good to coordinate. What have you done already? Dividing by the volume line seems ok, but I don’t mind trying other examples.

Dieter

Von: benlambertStan [mailto:notifications@github.com] Gesendet: Freitag, 7. August 2015 15:23 An: stan-dev/example-models example-models@noreply.github.com Cc: Dieter Menne dieter.menne@menne-biomed.de Betreff: Re: [example-models] Dmenne BUG (#29)

Hi,

I'm also going through the example models in BUGS. Is it worth me continuing on volume 2 so as not to duplicate the workload?

Best,

Ben

On 7 Aug 2015, at 15:17, Dieter Menne < mailto:notifications@github.com notifications@github.com> wrote:

Add R test programs to rats, pump, seeds, surgical (1-4, Volume 1) examples of BUGS manual. Added ".stanified" versions of Stan-programs to better reflect recommened practices. -- using vectorized if possible -- replace 1/sigmasquared contortions by sigma -- delete duplicate or non-required files -- somewhat narrower or wider (=default) priors -- test if program converges by running with default random init instead of the constant init. To discuss: there is a warning to increment in old version "rats_vec_unit.stan". Result seem ok, and I do not understand what to do; I tend to remove the example, it is not very useful, but try to understand first.

You can view, comment on, or merge this pull request online at:

https://github.com/stan-dev/example-models/pull/29 https://github.com/stan-dev/example-models/pull/29

Commit Summary

Quick and dirty R script to find the stan files without sample R Corrected pilot examples to be close to ARM13.5 Delete duplicate data files. Vectorize Pump example Add R test program for seeds (BUGS vol 1, 3) Add constrained to zero coefficients as in chapter 3.1 of BUGS manual Corrected WinBUGS link. Links are still incorrect in the individiual files, will be corrected in bulk later. Add R program with plot to created Figure 6 in BUGS manual. Add R program with plot to creat Figure 6 and Figure 7 (ranking) in BUGS manual. Plot Figure 6/7 in manual File Changes

A .gitignore (4) M ARM/Ch.13/13.5_Non-NestedModels.R (6) M ARM/Ch.13/pilots.stan (32) A ARM/UnmatchedStanFiles.R (22) M bugs_examples/README.txt (8) A bugs_examples/vol1/pump/pump.R (51) M bugs_examples/vol1/pump/pump.stan (18) A bugs_examples/vol1/rats/rats.R (74) A bugs_examples/vol1/rats/rats_stanified.stan (39) D bugs_examples/vol1/rats/rats_vec.data.R (22) D bugs_examples/vol1/rats/rats_vec_unit.data.R (22) A bugs_examples/vol1/seeds/seeds.R (107) A bugs_examples/vol1/seeds/seeds_centered.stan (40) A bugs_examples/vol1/seeds/seeds_stanified.stan (34) A bugs_examples/vol1/surgical/surgical.R (64) D bugs_examples/vol1/surgical/surgical_simple.init.R (1) D bugs_examples/vol1/surgical/surgical_simple.stan (11) A bugs_examples/vol1/surgical/surgical_stanified.stan (32) A example-models.Rproj (16) Patch Links:

https://github.com/stan-dev/example-models/pull/29.patch https://github.com/stan-dev/example-models/pull/29.patch https://github.com/stan-dev/example-models/pull/29.diff https://github.com/stan-dev/example-models/pull/29.diff — Reply to this email directly or view it on GitHub.

— Reply to this email directly or view it on GitHub https://github.com/stan-dev/example-models/pull/29#issuecomment-128697791 . https://github.com/notifications/beacon/AAe5o-tR1FCwcyov5AH9AP2NZiq3dfvJks5olKi3gaJpZM4Fnigi.gif

— Reply to this email directly or view it on GitHub.

syclik commented 9 years ago

@benlambertStan, I would suggest you put what you have on a public branch now rather than wait another week to do so. Since we have a little momentum, it would be great if you coordinated and compared models.

I'd be interested in what both of you are trying to do in terms of having models run. This is related to #26.

syclik commented 9 years ago

and thanks, @dmenne.

@benlambertStan, if you've already looked at this pull request and think everything is reasonable, either write that as a comment or feel free to merge into the branch. If you don't get to it, I'll do it soon.

benlambertStan commented 9 years ago

Yes, will do - it will be good to compare across both of our runs.

On 7 Aug 2015, at 17:18, Daniel Lee notifications@github.com wrote:

and thanks, @dmenne.

@benlambertStan, if you've already looked at this pull request and think everything is reasonable, either write that as a comment or feel free to merge into the branch. If you don't get to it, I'll do it soon.

— Reply to this email directly or view it on GitHub.

bob-carpenter commented 9 years ago

I'll second what Daniel said --- it's better to get things into a branch and commit early and often. You can create a GitHub issue to coordinate work if you both want to keep working on it.

Thanks.

P.S. We're about to figure out how to add developer names to all the files we create in all of our public repos to both clear up copyright issues and assign credit (or "blame" as GitHub would call it!).

On Aug 7, 2015, at 6:19 PM, benlambertStan notifications@github.com wrote:

Yes, will do - it will be good to compare across both of our runs.

On 7 Aug 2015, at 17:18, Daniel Lee notifications@github.com wrote:

and thanks, @dmenne.

@benlambertStan, if you've already looked at this pull request and think everything is reasonable, either write that as a comment or feel free to merge into the branch. If you don't get to it, I'll do it soon.

— Reply to this email directly or view it on GitHub.

— Reply to this email directly or view it on GitHub.

dmenne commented 9 years ago

@syclik I see your point in #26: it would be good to have TravisCI run these examples as a testbed. It was not the priority for me, my own interest is in using these examples to get rid of BUG-habits. The examples are a bit too close to the BUGs version, which is fine for a starter. I am also not fluent in makefiles, using interactive mode most of the time

My suggestion: please modify one of our examples so it fits your requirements. Adding testthat or whatever? Then I could try to follow that path.

I also had considered to create the examples in Notebook format (http://rmarkdown.rstudio.com/r_notebook_format.html) so that comments could be inserted.

dmenne commented 9 years ago

@syclik As a separate point: the links to bug on top of each file are still incorrect. I wanted to correct these globally, but it would mean that all files, even the non-revised ones, will be changed and need to be merged. What's the recommended procedure to follow?

bob-carpenter commented 9 years ago

Pull request. Merge early and often with the develop (or master) in this case.

On Aug 10, 2015, at 10:27 AM, Dieter Menne notifications@github.com wrote:

@syclik As a separate point: the links to bug on top of each file are still incorrect. I wanted to correct these globally, but it would mean that all files, even the non-revised ones, will be changed and need to be merged. What's the recommended procedure to follow?

— Reply to this email directly or view it on GitHub.

syclik commented 9 years ago

@dmenne, this looks great. I'll merge now.

I still don't know what we want to do for automatic running / testing. If you have ideas, comment on #26.