Comments (3)
Thanks for pointing it out. I can try it again. I don't
remember having trouble fitting it before.
I don't know how I managed to get inconsistencies in knitr
output, but I'll check it out. Maybe something to do with
caching?
These models should all fit much much better in Stan 2.10
when we bring in the CVODES ODE solvers. I plan to go and
do a much more thorough job of these models and implement
some of the standard multi-compartment models.
- Bob
On Apr 16, 2016, at 2:06 AM, Jonathan Gilligan [email protected] wrote:
I noticed that the version of the soil model at the mc-stan Case Studies page shows some inconsistencies:
For the measurement error model, the stan call and the output show 2 chains with 100 samples each (50 warmup, 50 post-warmup) but the output from print(fit_me) says that the sampling was done with 4 chains and 500 post-warmup samples each.More seriously, the traceplots show very poor mixing, but print(fit_me) shows Rhat <= 1.01, which is inconsistent with the traceplots.
So I cloned it from github and ran it, and indeed, I see lots of divergences in the pairs plot and most of the Rhat numbers for fit_me are >> 1 (many > 10).
If I increase adapt_delta to 0.95, decrease stepsize to 0.002, and allow 1000 warmup iterations before the 200 sampling iterations, the Rhat numbers reduce significantly (<= 1.4 for the first model and <= 1.1 for the second) but there are still over 30 divergent transitions in both models, and the traceplots don't look like they're mixing very well.
The pairs plot for the first model looks like there is some serious funnel action happening, most obviously between k1 and alpha21, but also between other pairs of parameters.
Maybe this is well known to you. I understand that the example-models repository is a work in progress, so please don't think I'm complaining. Just wanting to let you know in case you hadn't realized this.
sessionInfo()
R version 3.2.4 (2016-03-10)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows >= 8 x64 (build 9200)locale:
[1] LC_COLLATE=English_United States.1252 LC_CTYPE=English_United States.1252
[3] LC_MONETARY=English_United States.1252 LC_NUMERIC=C
[5] LC_TIME=English_United States.1252attached base packages:
[1] parallel stats graphics grDevices utils datasets methods baseother attached packages:
[1] SoilR_1.1-23 RUnit_0.4.31 deSolve_1.13 rstan_2.9.0-3 ggplot2_2.1.0loaded via a namespace (and not attached):
[1] Rcpp_0.12.4 grid_3.2.4 plyr_1.8.3 gtable_0.2.0 stats4_3.2.4
[6] scales_0.4.0 tools_3.2.4 munsell_0.4.3 rsconnect_0.4.2.1 inline_0.3.14
[11] colorspace_1.2-6 gridExtra_2.2.1—
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub
from example-models.
I'm thinking that the inconsistency is almost certainly a caching issue. Always a good thing to do the final run of a knitr document either setting cache=FALSE
for all the chunks or else after deleting the cache folder.
Knitr does not automatically determine dependencies between chunks, so to get the cache mechanism to work, you need to manually specify dependencies in the chunk options.
from example-models.
BTW, I really appreciate these case studies. The reason I caught this thing is that I'm reading through them very carefully to try to learn best practices. Your baseball example is super-helpful about how to recognize and deal with problems of divergence and regions of high curvature in parameter space.
from example-models.
Related Issues (20)
- `stan_demo` example 500 not working HOT 4
- Missing function in Introduction
- Error in BPA Ch.10 js_super.stan with possible fix HOT 1
- rats ref link at top of stan files is broken
- Add .data.R files for knitr models HOT 1
- Rdump format
- Reorganize the stan example repository HOT 13
- sampling() fails in Lotka-Volterra example HOT 3
- Lotka-Volterra example not running HOT 1
- BUGS Background Information for Litter Example HOT 1
- Failed to build Lotka Vollterra on Mac OS / clang HOT 9
- reduce_sum case study will be out of date once new cmdstanr pull gets merged
- Example script `fit_nyc_bym2.R` to use model `bym2_offset_only.stan` doesn't work HOT 1
- Subtle error in some capture-recapture likelihoods HOT 3
- [Error] Validate transformed params
- Survey.stan example from Cognitive Modeling - Expected end of file after end of generated quantities block. HOT 9
- Which book/chapter HOT 1
- updates to ARM model for normal_id_glm - variable name "cov" should be "x_as_mat" or something like that HOT 6
- add Python scripts to BYM12 case study HOT 5
- Parameter names for stan file HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from example-models.