rpsg_riskratioprog: Maximizes ratio of risk functions with linear constraints

Description Usage Arguments Value Author(s) References See Also Examples

View source: R/rpsg_riskratioprog.R

Description

Finds a maximum for a problem specified by

max_x[\frac{d^{T}x-risk2(x)}{risk1(x)}]

subject to

A \cdot x= b

Aeq \cdot x= beq

lb ≤q x ≤q ub

where
A, Aeq are matrices;
d, x are vectors;
b, beq, lb, ub are vectors or scalars;
risk1(x), risk2(x) functions are linear combinations of PSG risk functions, PSG deterministic functions, or PSG utility functions. List of PSG functions for riskratioprog

Usage

1
rpsg_riskratioprog(model, stroptions = NULL)

Arguments

model

list with data for optimization problem. Some components are optional. Names of list members:

model$risk1

character with name of PSG function in denominator. List of PSG functions for riskratioprog

model$risk2

character with name of PSG function in numerator. List of PSG functions for riskratioprog

model$w1

parameter (numeric) of the PSG function model$risk1;

model$w2

parameter (numeric) of the PSG function model$risk2;

model$H1

matrix for PSG function model$risk1;

model$H2

matrix for PSG function model$risk2;

model$c1

vector of benchmark for PSG function model$risk1;

model$c2

vector of benchmark for PSG function model$risk2;

model$p1

vector of probabilities for PSG function model$risk1;

model$p2

vector of probabilities for PSG function model$risk2;

model$d

vector for linear component in numerator;

model$Aineq

matrix for linear inequality constraint;

model$bineq

vector or scalars for linear inequality constraint;

model$Aeq

matrix for linear equality constraint;

model$beq

vector for linear equality constraint;

model$lb

vector of lower bounds for x;

model$ub

vector of upper bounds for x;

model$x0

initial point for x.

stroptions

list with additional optimization options:

stroptions$solver

character with name of optimization solver: VAN (default), CAR, BULDOZER, TANK;

stroptions$precision

number of digits that solver tries to obtain in objective (default = 7);

stroptions$time.limit

time in seconds restricting the duration of the optimization process;

stroptions$linearization1

number 0 or 1, controls internal representation of risk function model$risk1, which can speed up the optimization process (used with CAR and TANK solvers);

stroptions$linearization2

number 0 or 1, controls internal representation of risk function model$risk2, which can speed up the optimization process (used with CAR and TANK solvers);

stroptions$stages

number of stages of the optimization process. This parameter should be specified for VaR, Probability, and Cardinality groups of functions, default = 9;

stroptions$types

number that specifies the variables types of a problem. If Types is defined as column-vector, it should include as many components as number of variables Problem includes. The components of column-vector can possess the values 0 - for variables of type real, or 1- for variables of type boolean, or 2 - for variables of type integer. If Types is defined as one number (0, or 1, or 2) than all variables types real, or boolean, or integer respectively;

stroptions$mip1

number that specifies the linearization of functions model$risk1 and using MIP capabilities of Gurobi. Active only in VANGRB, CARGRB or HELI solvers (which are based on Gurobi optimization solvers and are available only if Gurobi is installed).

stroptions$mip2

number that specifies the linearization of functions model$risk2 and using MIP capabilities of Gurobi. Active only in VANGRB, CARGRB or HELI solvers (which are based on Gurobi optimization solvers and are available only if Gurobi is installed).

stroptions$save.to.text

character with path to the folder for storing problem in General (Text) Format of PSG.

Value

list results with solution results:

results$status

status of solved problem;

results$objective

optimal value of objective function;

results$gap

difference between objective value in obtained point and Lower estimate of optimal value;

results$optimal.point

optimal point;

results$ineq.constraint.value

optimal values of left hand sides of linear inequality constraint;

results$ineq.constraint.residual

residual of linear inequality constraint;

results$eq.constraint.value

optimal values of left hand sides of linear equality constraint;

results$eq.constraint.residual

residual of linear equality constraint;

results$function.value

optimal values of PSG functions defined in problem;

results$loading.time

data loading time;

results$preprocessing.time

preprocessing time;

results$solving.time

solving time.

Author(s)

Stan Uryasev [aut, cre, cph], Grigoriy Zrazhevsky [aut], Viktor Kuzmenko [aut], Alex Zrazhevsky [aut]

Maintainer: Stan Uryasev <stan.uryasev@aorda.com>

References

American Optimal Decisions
Portfolio Safeguard Help

See Also

rpsg_riskprog rpsg_riskconstrprog

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#Problem:
#Find x = (x1,x2,x3,x4) maximizing
#f(x) = Average Gain(x)/Partial Moment Penalty for Loss(x)
#subject to
#x1+x2+x3+x4+x5 = 1
#x1+x3 <= 0.6
#x2+x4+x5 <= 0.5
#0 <= x1 <= 0.5, 0 <= x2 <= 0.5, 0.3 <= x3 <= 0.5, 0 <= x4 <= 0.5, 0 <= x5 <= 0.5

input.model <- list()
input.model$risk1 <- "pm_pen"
input.model$w1 <- -1
input.model$risk2 <- "avg"
H1 <- c(0.11, 0.04, -0.12, 0.01, -0.05,
       -0.01, -0.1, 0.03, 0.21, 0.01,
       0.05, 0.2, 0.07, -0.03, -0.12,
       -0.1, 0.14, 0.04, -0.1, 0.09,
       0.08, -0.02, -0.2, 0.07, -0.01,
       0.17, 0.3, -0.12, -0.02, 0.08)
input.model$H1 <- matrix(H1,ncol = 5,byrow = TRUE)
input.model$c1 <- c(0.06, -0.1, 0.12, 0.01, -0.06, 0.11)
input.model$H2 <- input.model$H1
input.model$c2 <- input.model$c1
input.model$Aineq <- matrix(c(1,0, 1, 0, 0, 0, 1, 0, 1, 1),ncol = 5,byrow = TRUE)
input.model$bineq <- c(0.6, 0.5)
input.model$Aeq <- matrix(c(1.0, 1.0, 1.0, 1.0, 1.0),nrow = 1)
input.model$beq <- 1.0
input.model$lb <- c(0.0, 0.0, 0.3, 0.0, 0.0)
input.model$ub <- c(0.5, 0.5, 0.5, 0.5, 0.5)

options<-list()
options$solver <- "van"
options$precision <- 7

results <- rpsg_riskratioprog(input.model,options)

print(results)

PSGExpress documentation built on July 26, 2019, 5:02 p.m.