randomClickstreams | R Documentation |
Generates a list of clickstreams by randomly walking through a given transition matrix.
randomClickstreams(
states,
startProbabilities,
transitionMatrix,
meanLength,
n = 100
)
states |
Names of all possible states. |
startProbabilities |
Start probabilities for all states. |
transitionMatrix |
Matrix of transition probabilities. |
meanLength |
Average length of the click streams. |
n |
Number of click streams to be generated. |
Returns a list of clickstreams.
Michael Scholz michael.scholz@th-deg.de
fitMarkovChain
, readClickstreams
,
print.Clickstreams
# generate a simple list of click streams
states <- c("a", "b", "c")
startProbabilities <- c(0.2, 0.5, 0.3)
transitionMatrix <- matrix(c(0, 0.4, 0.6, 0.3, 0.1, 0.6, 0.2, 0.8, 0), nrow = 3)
cls <- randomClickstreams(states, startProbabilities, transitionMatrix, meanLength = 5, n = 10)
print(cls)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.