evaluate_cross_validation {utilityFunctionTools}R Documentation

Evaluates the cross validation function.

Description

Evaluates the cross validation function.

Usage

evaluate_cross_validation(
  xi,
  yi,
  lambda = 1,
  n_penalty_dimensions = 1,
  penalty_order = 4,
  ndx = 20,
  deg = 6,
  cross_validation_mode = 0
)

Arguments

xi

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

yi

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

lambda

lambda is the penalization weight used to compute the initial estimate. The default value is 1.

n_penalty_dimensions

number of dimensions (i.e., derivatives) to penalize. Possible values are 1 or 2. The default value is 1.

penalty_order

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

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.

cross_validation_mode

determines which cross validation mode should be used. If 0, then the cross validation method is leave-one-third-out. If 1, then the cross validation method is a theoretical leave-one-out, i.e., based on a formula. The default value is 1.

Value

Returns, for the given utility points and (possibly default) settings, the predictive quality of the estimated utility function according to cross validation as a function of a specified penalty weight lambda.

Examples

x <- c(0.0000000, 0.2819824, 0.3007812, 0.4375000, 0.5231934, 0.7784882, 0.8945312, 1.0000000)
y <- c(0.0000, 0.1250, 0.2500, 0.5000, 0.6250, 0.6875, 0.7500, 1.0000)
evaluate_cross_validation(x, y, .5)

[Package utilityFunctionTools version 0.1.1 Index]