You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
From this post on the forum, calling posterior_predict and requesting ndraws greater than the number of post-warmup draws in the model gives an error from the sample.int function (reprex below).
It would probably be better to have an input validation step for the ndraws value:
Reprex:
library(brms)
#> Loading required package: Rcpp#> Loading 'brms' package (version 2.17.0). Useful instructions#> can be found by typing help('brms'). A more detailed introduction#> to the package is available through vignette('brms_overview').#> #> Attaching package: 'brms'#> The following object is masked from 'package:stats':#> #> arfit<- brm(time~age, data=kidney,
iter=100, chains=1,
backend="cmdstanr")
#> Start sampling#> Running MCMC with 1 chain...#> #> Chain 1 WARNING: There aren't enough warmup iterations to fit the #> Chain 1 three stages of adaptation as currently configured. #> Chain 1 Reducing each adaptation stage to 15%/75%/10% of #> Chain 1 the given number of warmup iterations: #> Chain 1 init_buffer = 7 #> Chain 1 adapt_window = 38 #> Chain 1 term_buffer = 5 #> Chain 1 Iteration: 1 / 100 [ 1%] (Warmup) #> Chain 1 Iteration: 51 / 100 [ 51%] (Sampling) #> Chain 1 Iteration: 100 / 100 [100%] (Sampling) #> Chain 1 finished in 0.1 seconds.pp<- posterior_predict(fit, ndraws=200)
#> Error in sample.int(length(x), size, replace, prob): cannot take a sample larger than the population when 'replace = FALSE'
From this post on the forum, calling
posterior_predict
and requestingndraws
greater than the number of post-warmup draws in the model gives an error from thesample.int
function (reprex below).It would probably be better to have an input validation step for the
ndraws
value:Reprex:
Created on 2022-06-28 by the reprex package (v2.0.1)
The text was updated successfully, but these errors were encountered: