# Define parameters
num_elements <- 3
average_sequence_length <- 5
sequence_length_sd <- 1
length_func <- function() {
rnorm(1, mean = average_sequence_length, sd = sequence_length_sd)
}
transition_matrix <- matrix(c(0.1, 0.6, 0.3,
0.2, 0.5, 0.3,
0.3, 0.3, 0.4), nrow = 3, byrow = TRUE)
first_element_probs <- c(0.3, 0.4, 0.3)
# Generate a sequence
generate_sequence(length_func, transition_matrix, first_element_probs)
Run the code above in your browser using DataLab