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

Confusing warning for low-sample-size runs #116

Open
alashworth opened this issue Mar 12, 2019 · 2 comments
Open

Confusing warning for low-sample-size runs #116

alashworth opened this issue Mar 12, 2019 · 2 comments

Comments

@alashworth
Copy link
Owner

Issue by davidmanheim
Friday Sep 09, 2016 at 15:34 GMT
Originally opened as stan-dev/stan#2064


Summary:

When running Stan programs with low sample sizes (under 300 samples,) Stan returns a (confusing/spurious?) warning regarding the warmup.

Description:

When running an analysis with a sample size under 300, the following warning is generated;

WARNING: The initial buffer, adaptation window, and terminal buffer overflow the total number of warmup iterations.
Defaulting to a 15%/75%/10% partition, {List of used valuesfor each}

Reproducible Steps:

In R, run;

library(rstan)
stanmodelcode <- "
data {
int<lower=0> N;
real y[N];
} 

parameters {
real mu;
} 

model {
target += normal_lpdf(mu | 0, 10);
target += normal_lpdf(y  | mu, 1);
} 
"

y = rnorm(20) 
dat = list(N = 20, y = y); 
fit = stan(model_code = stanmodelcode, model_name = "example", 
            data = dat, iter = 290, chains = 3, sample_file = 'norm.csv',
            verbose = TRUE)

Current Output:

SAMPLING FOR MODEL 'example' NOW (CHAIN 1).
WARNING: The initial buffer, adaptation window, and terminal buffer
         overflow the total number of warmup iterations.
         Defaulting to a 15%/75%/10% partition,
           init_buffer = 21
           adapt_window = 110
           term_buffer = 14

Chain 1, Iteration:   1 / 290 [  0%]  (Warmup)
{etc. - Runs fine}

Expected Output:

No warning, or perhaps;

WARNING: The number of warmup iterations is below the recommended amount.

Additional Information

This error message occurs even when you specify the number of the buffers and window to rstan;

fit <- stan(model_code = stanmodelcode, model_name = "example", 
            data = dat, iter = 200, chains = 1, 
            control=list(c(adapt_init_buffer=10, adapt_term_buffer=10, adapt_window=10)),verbose =TRUE) 

Current Version:

v2.12.0

@alashworth
Copy link
Owner Author

Comment by bob-carpenter
Friday Sep 09, 2016 at 17:20 GMT


I agree that would be a better warning message.

As an aside, we try to separate usage of "sample" and "draw", with a single sample being made up of multiple draws.

@alashworth
Copy link
Owner Author

Comment by bob-carpenter
Thursday Mar 30, 2017 at 20:32 GMT


Add another message that "warmup is less than the recommended minimum 150 iterations" and then continue to dump a more detailed message that indicates it's just detail.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant