Title
trial_advance.Rd
Title
Examples
library(tidyverse)
bernoulli_trial() |>
trial_init() |>
trial_advance()
#> # A tibble: 4 × 5
#> history t1_outcome t1_prob t2_outcome t2_prob
#> <int> <dbl> <dbl> <dbl> <dbl>
#> 1 1 0 0.75 0 0.75
#> 2 2 0 0.75 1 0.25
#> 3 3 1 0.25 0 0.75
#> 4 4 1 0.25 1 0.25
bernoulli_trial() |>
trial_init() |>
trial_advance(2)
#> # A tibble: 8 × 7
#> history t1_outcome t1_prob t2_outcome t2_prob t3_outcome t3_prob
#> <int> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
#> 1 1 0 0.75 0 0.75 0 0.75
#> 2 2 0 0.75 0 0.75 1 0.25
#> 3 3 0 0.75 1 0.25 0 0.75
#> 4 4 0 0.75 1 0.25 1 0.25
#> 5 5 1 0.25 0 0.75 0 0.75
#> 6 6 1 0.25 0 0.75 1 0.25
#> 7 7 1 0.25 1 0.25 0 0.75
#> 8 8 1 0.25 1 0.25 1 0.25
bernoulli_trial() |>
trial_init() |>
trial_advance(2, as_ts = TRUE)
#> # A tibble: 24 × 4
#> history trial outcome prob
#> <int> <chr> <dbl> <dbl>
#> 1 1 t1 0 0.75
#> 2 1 t2 0 0.75
#> 3 1 t3 0 0.75
#> 4 2 t1 0 0.75
#> 5 2 t2 0 0.75
#> 6 2 t3 1 0.25
#> 7 3 t1 0 0.75
#> 8 3 t2 1 0.25
#> 9 3 t3 0 0.75
#> 10 4 t1 0 0.75
#> # … with 14 more rows
bernoulli_trial() |>
trial_init() |>
trial_advance() |>
trial_advance()
#> # A tibble: 8 × 7
#> history t1_outcome t1_prob t2_outcome t2_prob t3_outcome t3_prob
#> <int> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
#> 1 1 0 0.75 0 0.75 0 0.75
#> 2 2 0 0.75 0 0.75 1 0.25
#> 3 3 0 0.75 1 0.25 0 0.75
#> 4 4 0 0.75 1 0.25 1 0.25
#> 5 5 1 0.25 0 0.75 0 0.75
#> 6 6 1 0.25 0 0.75 1 0.25
#> 7 7 1 0.25 1 0.25 0 0.75
#> 8 8 1 0.25 1 0.25 1 0.25