Description Usage Arguments Details Value See Also Examples

Use stan_filter() to choose indicies of samples across parameters where conditions are true.

1 | ```
stan_filter(object, ..., permuted = TRUE)
``` |

`object` |
stanfit object |

`...` |
Logical predicates defined in terms of the parameters in object |

`permuted` |
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.

stanfit object

Other filtering:
`stan_slice()`

,
`stan_thin_n()`

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[1]`,`alpha[2]`,mu_alpha,mu_beta)%>%
stan_filter(mu_beta < 6 & `alpha[1]` > 240)
``` |

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.