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

Dmenne BUG #29

Merged
merged 13 commits into from
Aug 12, 2015
Merged

Dmenne BUG #29

merged 13 commits into from
Aug 12, 2015

Conversation

dmenne
Copy link
Contributor

@dmenne dmenne commented Aug 7, 2015

  • 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.

As of Aug 4, 2015
./Ch.10/sesame_one_pred_2b.stan
./Ch.10/sesame_one_pred_b.stan
./Ch.12/radon_group_chr.stan
./Ch.12/radon_intercept_chr.stan
./Ch.12/radon_no_pool_chr.stan
./Ch.13/13.4_UnderstandingCorrelationsBetweenIntercepts&Slopes.R
./Ch.13/earnings_latin_square_chr.stan
./Ch.13/earnings_vary_si_chr.stan
./Ch.13/pilots_chr.stan
./Ch.13/radon_inter_vary_chr.stan
./Ch.13/radon_vary_si_chr.stan
./Ch.14/pilots_chr.stan

./Ch.16/16.3_FittingAndUnderstangingAVaryingInterceptMultilevelModelUsingRStan.R
./Ch.17/17.2_radon_multi_varying_coef.stan
./Ch.17/17.5_multilevel_poisson.stan
./Ch.17/17.6_multilevel_ordered_categorical.stan
./Ch.17/17.7_latent_glm.stan
./Ch.17/17.7_robit.stan
./Ch.19/item_response.stan
./Ch.19/radon_chr.stan
./Ch.19/radon_redundant_chr.stan
./Ch.20/hiv_chr.stan
./Ch.20/hiv_inter_chr.stan
./Ch.21/finite_populations.stan
./Ch.21/multiple_comparison.stan
./Ch.21/r_sqr.stan
./Ch.21/radon_vary_intercept_floor.stan
./Ch.21/radon_vary_intercept_floor_chr.stan
./Ch.21/radon_vary_intercept_floor2_chr.stan
./Ch.21/radon_vary_intercept_nofloor_chr.stan
./Ch.22/anova_radon_nopred_chr.stan
./Ch.23/educational_subsidy.stan
./Ch.23/electric.stan
./Ch.23/electric_1a_chr.stan
./Ch.23/electric_1b_chr.stan
./Ch.23/electric_1c_chr.stan
./Ch.23/electric_chr.stan
./Ch.24/dogs_check.stan
./Ch.24/dogs_log.stan
./Ch.3/kidscore_momhs.stan
./Ch.4/earn_height.stan
./Ch.8/8.2_FakeDataSimulationToUnderstandResidualPlots.R
The suggested correction in

http://stats.stackexchange.com/questions/143359/when-is-mu-a-used-in-this-stan-example
is not correct.

Changed variable names to those used in equation 13.9, i.e. gamma and
delta instead of a and b. Removed unused mu_a and mu_b, and added common
mu to really force gamma and delta into approx N(0,).
Add rats_stanified, with flat priors and avoiding sigma-squared detours.
Print mean and stddev for all models, BUGS and Gelfand (original citation).
Check random default initialization
Compare with BUGS result in manual
Add simplified version that does not use tau but estimates sigma directly.
Narrower alpha priors (from 1000 to 1)
Merge branch 'dmenne-dev-bugs' of https://github.com/dmenne/example-models into dmenne-dev-bugs

Conflicts:
	bugs_examples/vol1/surgical/surgical.R
	bugs_examples/vol1/surgical/surgical_stanified.stan
@benlambertStan
Copy link

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:

#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
Copy link
Contributor Author

dmenne commented Aug 7, 2015

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:

#29 #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 #29 (comment) . https://github.com/notifications/beacon/AAe5o-tR1FCwcyov5AH9AP2NZiq3dfvJks5olKi3gaJpZM4Fnigi.gif

@benlambertStan
Copy link

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:

#29 #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 #29 (comment) . https://github.com/notifications/beacon/AAe5o-tR1FCwcyov5AH9AP2NZiq3dfvJks5olKi3gaJpZM4Fnigi.gif


Reply to this email directly or view it on GitHub.

@syclik
Copy link
Member

syclik commented Aug 7, 2015

@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
Copy link
Member

syclik commented Aug 7, 2015

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
Copy link

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
Copy link
Contributor

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.

  • Bob

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!).

  • Bob

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
Copy link
Contributor Author

dmenne commented Aug 10, 2015

@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
Copy link
Contributor Author

dmenne commented Aug 10, 2015

@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
Copy link
Contributor

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
Copy link
Member

syclik commented Aug 12, 2015

@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.

syclik added a commit that referenced this pull request Aug 12, 2015
@dmenne fixed a lot of the bugs examples.
@syclik syclik merged commit d14ef75 into stan-dev:master Aug 12, 2015
@syclik syclik mentioned this pull request Aug 12, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants