Learn R Programming

utilityFunctionTools (version 0.1.0)

compute_function_aux: Computes a continuous and smooth function according to the given utility points

Description

Computes a continuous and smooth function according to the given utility points

Usage

compute_function_aux(
  x,
  y,
  ids,
  mode = 1,
  penalty_order = 4,
  lambda_max = 10000,
  current_lambda = 1,
  n_penalty_dimensions = 1,
  ndx = 20,
  deg = 6
)

Arguments

x

a matrix or dataframe containing the certainty equivalents (x-values of utility points) for a given participant in each use case.

y

can be a vector or a matrix representing the corresponding utility values (y-values of utility points).

ids

a list containing the IDs of the participants. If not given, a list with IDs from 1 to n_observations will be created.

mode

an integer between 0, 1, 2 representing the three possible modes: multiple imputation, optimal classification or 'weak' classification. Default is optimal classification (1).

penalty_order

highest dimension (i.e., derivative) to penalize. Must be lower than deg.

lambda_max

maximum lambda used for computing the optimal lambda. It is used only in multiple imputation (mode = 0) and optimal (mode = 1). The default value is 10000.

current_lambda

lambda considered in the current iteration. Only used in multiple imputation (mode = 0) to create the combinations and as actual lambda value in 'weak' classification mode (mode = 2). The default value is 1.

n_penalty_dimensions

number of dimensions to penalise. Possible values are 1 or 2. The default value is 1.

ndx

number of intervals to partition the distance between the lowest and highest x-values of the utility points.

deg

degree of the B-spline basis. Determines the degree of the function to be estimated. If deg = 2, the estimated utility function will consist of quadratic functions.

Value

A smooth and continuous utility function.