evaluate_solution.optim: Evaluate MSE Equation (using optim)

View source: R/MinMSET.R

evaluate_solution.optimR Documentation

Evaluate MSE Equation (using optim)

Description

This function calls evaluate_solution, but since optim requires fn and gr to have the same parameters, it has two additional ones.

Usage

evaluate_solution.optim(par,
                        data,
                        evaluation_function = evaluate_solution,
                        swap_treatment_function = NULL,
                        mse_weights = NULL,
                        change = NULL,
                        prev_index_list = NULL)

Arguments

par

a treatment assignment. The treatment and the data must have the same number of observations (rows).

data

a matrix containing the covariate vectors for each attribute.

evaluation_function

the function used to evaluate the MSE treatment. Default is evaluate_solution, which does not take into account outcome or treatment weights. Other options are evaluate_solution_vector and evaluate_solution_matrix.

swap_treatment_function

the parameter is only needed for optim, it does not play any role.

mse_weights

a vector containing the mse_weights for each treatment, or a matrix containing the mse_weights for treatments and outcomes and scaling factors.

change

the parameter is only needed for optim, it does not play any role.

prev_index_list

the parameter is only needed for optim, it does not play any role.

Value

Returns the mean square error value for the current treatment assignment.

Author(s)

Sebastian Schneider sschneider@coll.mpg.de; sebastian@sebastianschneider.eu, Giulia Baldini giulia.baldini@uni-bonn.de

References

Schneider and Schlather (2017),

See Also

ginv, optim

Examples

input <- matrix(1:30, nrow = 10, ncol = 3)

evaluate_solution.optim(par = c(0, 1, 1, 1, 1, 0, 0, 0, 0, 0),
                        input)

minMSE documentation built on March 18, 2022, 8:05 p.m.