Use stan_filter() to choose indicies of samples across parameters where conditions are true.
Logical predicates defined in terms of the parameters in object
A logical scalar indicating whether the draws after the warmup period in each chain should be permuted and merged, Default: TRUE
If no elements are returned for any chain then
NULL is returned with a warning.
If there is a chain that results in no samples then the chain is dropped with a warning.
If permuted is FALSE then uneven chains may be returned depending on the result of the filter.
To comply with extract with
permuted=TRUE chains in which chaines are
assumed to be of equal size.
Chain size returned is the length of the shortest filtered chain.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
rats <- rats_example(nCores = 1) rats%>% stan_select(mu_alpha,mu_beta) rats%>% stan_select(mu_alpha,mu_beta)%>% stan_filter(mu_beta < 6) rats%>% stan_select(mu_alpha,mu_beta)%>% stan_filter(mu_beta < 6, permuted = FALSE) rats%>% stan_select(`alpha`,`alpha`,mu_alpha,mu_beta)%>% stan_filter(mu_beta < 6 & `alpha` > 240)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.