referencePoints: Delivers the Reference Points

Description Usage Arguments Details Value References Examples

Description

This function delivers reference points for other functions to use, specifically for functions based on prospect theory. With the reference points you can calculate gains and losses relative to a single reference point. We base our knowledge and assumptions to calculate gains and losses from a paper, please see source and references [1].

Usage

1
2
referencePoints(dataset, userid, refps = NULL, attr = NULL,
  cost_ids = NULL, forceRefps = TRUE)

Arguments

dataset

a data.frame with the user generated data from a product configurator. See Details of decisionMatrix for more information about which data should included in this argument.

userid

an integer vector indicating for which user the output of this function should be calculated. This functions is vectorised in this argument, i.e. you may enter more userIDs simultaneously.

refps

a list of numeric vectors, one for each user. Reference Points: each point corresponds to one attribute, therefore the amount of attributes and of refps entered, should be equal. Default assumes the refps as the default values of the initial product configuration for each user. You may fully or partially enter your own reference points, check below for more info.

attr

attribute IDs, vector of integer numbers corresponding to the attributes (columns) you desire to use.

cost_ids

argument used to convert selected cost attributes into benefit attributes. Integer vector. Cost type attributes have the characteristic, that a lower value means the user is better off than with a higher value. E.g. price is often considered a cost type attribute. Should be equal to attr input or a subset of it.

forceRefps

logical, default value is TRUE. If values are given to refps, it forces the user to enter a value for all attributes, regardless if you entered just one attribute ID in attr. If you wish to manually enter only one refps value for one attr and let the function calculate the other ones, you have to give NA as input for each attribute you want calculated. See the second example.

Alternatively, you can set forceRefps and avoid given a value (NA or numeric) for each attribute. However, do this at your own risk, since the argument is intended for development only.

rounds

integer vector, text option or a list of integer vectors. Which steps of the configuration process should be shown? Defaults are first and last step. Text options are all, first, last. Alternatively, a vector of arbitrarily chosen rounds can be entered as well.

Details

Reference Points can be many things, such as defaults, aspiration levels, status quo, etc. Here we provide the tools to read the reference points from the given data, i.e. reference points are assumed to be default (first) values in the decision matrix.

refps If values are given to refps, the function forces the user to enter a value for all attributes, regardless if you entered just one attribute ID in attr. If you wish to manually enter only one refps value for one attr and let the function calculate the other ones, you have to give NA as input for each attribute you want calculated. See the second example.

dataset We assume the input data.frame has following columns usid = User IDs, round = integers indicating which round the user is in (0-index works best for round), atid = integer column for referring the attribute ID (1 indexed), selected = numeric value of the attribute for a specific, given round, selectable = amount of options the user can chose at a given round, with the current configuration. This is a necessary parameter.

userid is a necessary parameter, without it you'll get a warning. Default is NULL.

rounds If you need to compute different rounds for each user you enter, this argument accepts a list of integer vectors indicating which rounds should be used for each user. The function does not read names, it works in the order the list was given.

cost_ids If attr and cost_ids differ, the functions will first compute the entire decision matrix using the cost_ids and only in the end will it 'subset' the result to the desired attr.

Value

a list of numeric vectors representing a reference point for each attribute. Length of the vectors will be the amount of attributes IDs in attr.

References

[1] Fan, Z. P., Zhang, X., Chen, F. D., & Liu, Y. (2013). Multiple attribute decision making considering aspiration-levels: A method based on prospect theory. Computers & Industrial Engineering, 65(2), 341-350.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
#Not Runnable yet
referencePoints(myData, 9:11, attr=1:3)
referencePoints(myData, 9:11, attr=1:3, refps=(NA, 10, NA))
# Example above calculates refps for attr 1,3 and 4. For attr 2 it returns 20.
referencePoints(myData, 9:11, attr=1:3, cost_ids = 4) #Attr 4 will not be outputted
referencePoints(data, 6, refps=c(0,-10,9,2))
referencePoints(myData, 9:10, attr = c(1,4), cost_ids=4)

#Some examples that throw an error
referencePoints(myData, 9:11, attr=1:3, cost_ids = 4, refps=100) #Error:Not enough refps entered
#' referencePoints(data, refps=c(0,0,0), attr=c(1,4)) # Same error as previous example

avilesd/productConfig documentation built on May 11, 2019, 4:08 p.m.