Skip to contents

Define prior distributions for types of parameters or specific parameters within a model. For a complete list of types and parameters available for a given model, see get_parameters().

Usage

prior(distribution, type, coefficient = NA, lower_bound = NA, upper_bound = NA)

Arguments

distribution

A distribution statement for the prior (e.g., normal(0, 2)). For a complete list of available distributions, see the Stan documentation at https://mc-stan.org/docs/.

type

The type of parameter to apply the prior to. Parameter types will vary by model. Use get_parameters() to see list of possible types for the chosen model.

coefficient

Name of a specific parameter within the defined parameter type. If NA (the default), the prior is applied to all parameters within the type.

lower_bound

Optional. The lower bound where the distribution should be truncated.

upper_bound

Optional. The upper bound where the distribution should be truncated.

Value

A dcmprior object.

See also

Examples

prior(normal(0, 2), type = "intercept")
#> # A tibble: 1 × 3
#>   type      coefficient prior       
#>   <chr>     <chr>       <chr>       
#> 1 intercept NA          normal(0, 2)

c(prior(beta(5, 17), type = "slip"),
  prior(beta(5, 25), type = "guess"))
#> # A tibble: 2 × 3
#>   type  coefficient prior      
#>   <chr> <chr>       <chr>      
#> 1 slip  NA          beta(5, 17)
#> 2 guess NA          beta(5, 25)