Skip to contents

Extracts models fixed-effect terms for every modeled distribution parameter.

Usage

fixef(object, summary = TRUE, probs = c(0.055, 0.945))

Arguments

object

An object of class cumhist

summary

Whether summary statistics should be returned instead of raw sample values. Defaults to TRUE

probs

The percentiles used to compute summary, defaults to 89% credible interval.

Value

tibble with values or summary, NULL if not fixed effects were used.

Examples

# \donttest{
br_fit <- fit_cumhist(br_singleblock,
                      state = "State",
                      duration = "Duration",
                      fixed_effects = "Time")
#> 
#> SAMPLING FOR MODEL 'historylm' NOW (CHAIN 1).
#> Chain 1: 
#> Chain 1: Gradient evaluation took 0 seconds
#> Chain 1: 1000 transitions using 10 leapfrog steps per transition would take 0 seconds.
#> Chain 1: Adjust your expectations accordingly!
#> Chain 1: 
#> Chain 1: 
#> Chain 1: Iteration:    1 / 2000 [  0%]  (Warmup)
#> Chain 1: Iteration:  200 / 2000 [ 10%]  (Warmup)
#> Chain 1: Iteration:  400 / 2000 [ 20%]  (Warmup)
#> Chain 1: Iteration:  600 / 2000 [ 30%]  (Warmup)
#> Chain 1: Iteration:  800 / 2000 [ 40%]  (Warmup)
#> Chain 1: Iteration: 1000 / 2000 [ 50%]  (Warmup)
#> Chain 1: Iteration: 1001 / 2000 [ 50%]  (Sampling)
#> Chain 1: Iteration: 1200 / 2000 [ 60%]  (Sampling)
#> Chain 1: Iteration: 1400 / 2000 [ 70%]  (Sampling)
#> Chain 1: Iteration: 1600 / 2000 [ 80%]  (Sampling)
#> Chain 1: Iteration: 1800 / 2000 [ 90%]  (Sampling)
#> Chain 1: Iteration: 2000 / 2000 [100%]  (Sampling)
#> Chain 1: 
#> Chain 1:  Elapsed Time: 49.13 seconds (Warm-up)
#> Chain 1:                262.176 seconds (Sampling)
#> Chain 1:                311.306 seconds (Total)
#> Chain 1: 
#> Warning: There were 878 transitions after warmup that exceeded the maximum treedepth. Increase max_treedepth above 10. See
#> https://mc-stan.org/misc/warnings.html#maximum-treedepth-exceeded
#> Warning: Examine the pairs() plot to diagnose sampling problems
#> Warning: The largest R-hat is 1.14, indicating chains have not mixed.
#> Running the chains for more iterations may help. See
#> https://mc-stan.org/misc/warnings.html#r-hat
#> Warning: Bulk Effective Samples Size (ESS) is too low, indicating posterior means and medians may be unreliable.
#> Running the chains for more iterations may help. See
#> https://mc-stan.org/misc/warnings.html#bulk-ess
#> Warning: Tail Effective Samples Size (ESS) is too low, indicating posterior variances and tail quantiles may be unreliable.
#> Running the chains for more iterations may help. See
#> https://mc-stan.org/misc/warnings.html#tail-ess
fixef(br_fit)
#> # A tibble: 2 x 5
#>   DistributionParameter Term  Estimate    `5.5%`  `94.5%`
#>   <fct>                 <fct>    <dbl>     <dbl>    <dbl>
#> 1 shape                 Time  -0.00348 -0.00684  0.000195
#> 2 scale                 Time   0.00378  0.000158 0.00728 
# }