Title
add_trials.Rd
Title
Examples
bernoulli_trial() |>
trial_init() |>
add_trials() |>
add_trials()
#> # 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() |>
add_trials()
#> # 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() |>
add_trials() |>
add_trials(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
fair_coin() |>
add_trials(2)
#> # A tibble: 8 × 7
#> history t1_outcome t1_prob t2_outcome t2_prob t3_outcome t3_prob
#> <int> <chr> <dbl> <chr> <dbl> <chr> <dbl>
#> 1 1 heads 0.5 heads 0.5 heads 0.5
#> 2 2 heads 0.5 heads 0.5 tails 0.5
#> 3 3 heads 0.5 tails 0.5 heads 0.5
#> 4 4 heads 0.5 tails 0.5 tails 0.5
#> 5 5 tails 0.5 heads 0.5 heads 0.5
#> 6 6 tails 0.5 heads 0.5 tails 0.5
#> 7 7 tails 0.5 tails 0.5 heads 0.5
#> 8 8 tails 0.5 tails 0.5 tails 0.5