randomClicks-method: Generates a Sequence of Clicks

randomClicksR Documentation

Generates a Sequence of Clicks

Description

Generates a Sequence of Clicks

Usage

randomClicks(object, startPattern, dist)

Arguments

object

The MarkovChain used for generating the next click(s)

startPattern

Pattern containing the first clicks of a user. A Pattern object with an empty sequence is also possible.

dist

(Optional) The number of clicks that should be generated (default is 1).

Methods

list("signature(object = \"MarkovChain\")")

Generates a sequence of clicks by randomly walking through the transition graph of a given MarkovChain object.

Author(s)

Michael Scholz michael.scholz@th-deg.de

See Also

fitMarkovChain

Examples


# fitting a simple Markov chain and predicting the next click
clickstreams <- c("User1,h,c,c,p,c,h,c,p,p,c,p,p,o",
               "User2,i,c,i,c,c,c,d",
               "User3,h,i,c,i,c,p,c,c,p,c,c,i,d",
               "User4,c,c,p,c,d",
               "User5,h,c,c,p,p,c,p,p,p,i,p,o",
               "User6,i,h,c,c,p,p,c,p,c,d")
cls <- as.clickstreams(clickstreams, header = TRUE)
mc <- fitMarkovChain(cls)
startPattern <- new("Pattern", sequence = c("h", "c"))
predict(mc, startPattern)


clickstream documentation built on Sept. 27, 2023, 5:06 p.m.