estimate_model {utilityFunctionTools}R Documentation

Estimates the model

Description

Estimates the model

Usage

estimate_model(
  xi,
  yi,
  lambda = 1,
  n_penalty_dimensions = 1,
  penalty_order = 4,
  ndx = 20,
  deg = 6,
  cross_validation_mode = 0,
  return_estimate = 0,
  left_out_xi = c(),
  left_out_yi = c()
)

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.

return_estimate

parameter that indicates whether or not to return the (initially) estimated coefficients. Default is false.

left_out_xi

needed for cross validation: the x-values of the points that are left out for fitting the model, so that they can be predicted

left_out_yi

needed for cross validation: the y-values of the points that are left out for fitting the model, so that they can be predicted

Value

Returns the sum of residuals of the prediction of the left-out points using cross validation. If specified, additionally returns the estimated coefficients of the utility function (in the B-spline basis).

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)
estimate_model(x, y, .5)

[Package utilityFunctionTools version 0.1.1 Index]