lossMatrix: Loss matrix

Description Usage Arguments Details Value References Examples

Description

Creates the Loss matrix parting from a decision matrix and a vector containing the reference points (typically the status-quo). A loss represents a positive difference between a given value in the decision matrix and its corresponding reference point [1,2]. This functions is intended to use only for single referene point theories, not for multiple reference point approaches. For the latter, refer to overallDRP, and overallTRP.

Usage

1
2
lossMatrix(dataset, userid = NULL, attr = NULL, rounds = NULL,
  refps = NULL, cost_ids = NULL)

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.

attr

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

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.

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.

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.

Details

The returned lossMatrix has: ncol = number of attributes you selected or all(default) and nrow= number of rounds you selected or the first and last(default) for a selected user. Results are unnamed.

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.

attr Default calculates with all attributes. Attributes are automatically read from provided table, it is important you always provide the complete dataset so that the package functions properly. Moreover the attributes will not be sorted. Output columns are returned in the ordered they were inputed.

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.

refps If you only want to see the results for one attribute you may enter only a couple of reference points but you have to tell the function which attributes you want to use those referene points for. So the amount of attr and of refps should be the same. Moreover the functions always orders de attr, so be sure to input the reference point also in an ascending order corresponding to their attributes. (refps will not be ordered)

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 loss matrices, one for each user.

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.

[2]Kahneman, D., & Tversky, A. (1979). Prospect theory: An analysis of decision under risk. Econometrica: Journal of the Econometric Society, 263-291.

Examples

1
2
3
4
5
#Not Runnable yet
lossMatrix(pc_config_data, 9:11)
lossMatrix(my_data, userid = 11, rounds="all")
lossMatrix(keyboard_data, 60, refps = c(1,3,4,0), cost_ids = 4)
lossMatrix(data1, 2, rounds = "last", attr = 1, cost_ids=1)

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