stan_filter: Return post-warmup samples with matching conditions

Description Usage Arguments Details Value See Also Examples

View source: R/stan_filter.R

Description

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

Usage

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

Arguments

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

Details

Value

stanfit object

See Also

Other filtering: stan_slice(), stan_thin_n()

Examples

 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)

metrumresearchgroup/shredder documentation built on Sept. 1, 2020, 5:36 p.m.