decision_rule | R Documentation |
The ‘decision_rule' R6 class serves to define individuals’decision rules. The object stores information about the decision rule: a list of formulas to be applied on the data; the associated random noise terms, transformation rules and choice selection pattern.
formula
A list of formulas associated with respective alternatives.
noise
A list of noise specifications on per alternative basis.
transformation
The desired transformation to be applied. The transformation should be a function of Total Utility (TU). The default transforamtion is 'expr(exp(TU) / sum(exp(TU)))'
choice
The desired criteria should be declared as function.
add_noise()
Append a list of 'call' noise definitions to the noise field.
decision_rule$add_noise(...)
...
The noise is declared as randomisation function (ex: 'evd::rgumbel(loc = 0, scale = 1)')
add_formulas()
Append a list of 'call' formula definitions to the formula field.
decision_rule$add_formulas(...)
...
The formulas should be defined in the same order as alternatives the individual will face (ex: 'Age + 2*Quality, 1.5*Age + Quality^2')
modify_transformation()
Specify transformation to applied on Total Utility for individual within each choice set.
decision_rule$modify_transformation(transformation)
transformation
The desired transformation to be applied. The transformation should be a function of Total Utility (TU). The default transforamtion is 'expr(exp(TU) / sum(exp(TU)))'
modify_choice()
The choice rule represents the criteria of individual's final choice.
decision_rule$modify_choice(choice)
choice
The desired criteria should be declared as function. The default value is 'max()' (assuming the individual chooses the alternative with higher associated probability).
clone()
The objects of this class are cloneable with this method.
decision_rule$clone(deep = FALSE)
deep
Whether to make a deep clone.
drule <- decision_rule$new() drule$add_noise(rnorm(), rnorm(sd = 2)) drule$add_formulas(Age + 2 * Quality, 1.5 * Age + Quality^2) drule$modify_transformation(TU) drule$modify_choice(min())
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.