View source: R/educational_sequences.R
| simulate_event_log | R Documentation |
Simulate grouped educational event logs
simulate_event_log(
groups = 5L,
actors = 10L,
courses = 1L,
states = NULL,
n_states = 8L,
state_categories = "all",
sequence_length = c(10L, 30L),
achievement_levels = c("low", "medium", "high"),
achievement_probabilities = NULL,
start_time = as.POSIXct("2020-01-01", tz = "UTC"),
interval_range = c(60, 600),
transitions = NULL,
initial = NULL,
seed = NULL,
...,
batch = NULL
)
groups |
Number of groups. |
actors |
Actors per group. |
courses |
Number or labels of courses. |
states, n_states, state_categories |
State-space options. |
sequence_length |
Fixed length or minimum/maximum range. |
achievement_levels |
Achievement labels. |
achievement_probabilities |
Achievement probabilities, one per level and
summing to one. When |
start_time |
Initial timestamp. Every actor's first event is placed at this time. |
interval_range |
Minimum and maximum seconds between an actor's consecutive events, drawn uniformly. |
transitions |
Common matrix, one matrix per group, or |
initial |
Initial probabilities. |
seed |
Optional random seed. |
... |
Advanced options passed to |
batch |
Optional single positive whole number. When given, the
simulator runs |
A long-form simulab_sim base data.frame with one row per actor
event and columns group, id, course, achievement, period,
state, and timestamp. as.data.frame(x, what = ) also returns
transitions (group, from, to, probability), actors
(group, id, course, achievement), groups (group, actors),
wide (one row per actor, columns id, S1, ..., plus actor metadata),
and one_hot (the event log with state replaced by indicator columns).
result <- simulate_event_log(groups = 2, actors = 10, sequence_length = 8, seed = 1)
head(result)
components(result)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.