markov_model: Markov model for the online attribution problem.

Description Usage Arguments Value Author(s) Examples

View source: R/ChannelAttribution.R

Description

Estimate a k-order Markov model from customer journey data. Differently from markov_model, this function iterates estimation until convergence is reached and enables multiprocessing.

Usage

1
2
3
4
markov_model(Data, var_path, var_conv, var_value=NULL, var_null=NULL, 
             order=1, nsim_start=1e5, max_step=NULL, out_more=FALSE, sep=">", 
             ncore=1, nfold=10, seed=0, conv_par=0.05, rate_step_sim=1.5, 
             verbose=TRUE)

Arguments

Data

data.frame containing customer journeys data.

var_path

column name containing paths.

var_conv

column name containing total conversions.

var_value

column name containing total conversion value.

var_null

column name containing total paths that do not lead to conversions.

order

Markov Model order.

nsim_start

minimum number of simulations used in computation.

max_step

maximum number of steps for a single simulated path. if NULL, it is the maximum number of steps found into Data.

out_more

if TRUE, transition probabilities between channels and removal effects will be returned.

sep

separator between the channels.

ncore

number of threads used in computation.

nfold

how many repetitions are used to verify if convergence has been reached at each iteration.

seed

random seed. Giving this parameter the same value over different runs guarantees that results will not vary.

conv_par

convergence parameter for the algorithm. The estimation process ends when the percentage of variation of the results over different repetions is less than convergence parameter.

rate_step_sim

number of simulations used at each iteration is equal to the number of simulations used at previous iteration multiplied by rate_step_sim.

verbose

if TRUE, additional information about process convergence will be shown.

Value

An object of class data.frame with the estimated number of conversions and the estimated conversion value attributed to each channel.

Author(s)

Davide Altomare (info@channelattribution.net).

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
## Not run: 

library(ChannelAttribution)

data(PathData) 

#Estimate a Makov model using total conversions
markov_model(Data, var_path="path", "total_conversions")

#Estimate a Makov model using total conversions and revenues
markov_model(Data, "path", "total_conversions",
var_value="total_conversion_value")

#Estimate a Makov model using total conversions, revenues and paths that do not lead to conversions
markov_model(Data, "path", "total_conversions",
var_value="total_conversion_value", var_null="total_null")

#Estimate a Makov model returning transition matrix and removal effects
markov_model(Data, "path", "total_conversions",
var_value="total_conversion_value", var_null="total_null", out_more=TRUE)

#Estimate a Markov model using 4 threads
markov_model(Data, "path", "total_conversions",
var_value="total_conversion_value", ncore=4)


## End(Not run)

ChannelAttribution documentation built on July 27, 2020, 9:06 a.m.