estbounds: Estimate bounds with shape restrictions

View source: R/estbounds.R

estboundsR Documentation

Estimate bounds with shape restrictions

Description

This function estimates the bounds subject to the shape constraints. The estimation is done via a two-step procedure with either the 1-norm or the 2-norm.

Usage

estbounds(
  data = NULL,
  lpmodel,
  kappa = 0,
  norm = 2,
  estimate = TRUE,
  solver = NULL
)

Arguments

data

An data frame or a matrix.

lpmodel

The lpmodel object.

kappa

The tuning parameter used in the second step of the two-step procedure for obtaining the bounds subject to the shape constraints. It can be any nonnegative number.

norm

The norm used in the optimization problem. It can be either a 1-norm or a 2-norm. See the details section of estbounds for a list of accepted strings.

estimate

A boolean variable to indicate whether the bounds should be estimated or not.

solver

The name of the linear and quadratic programming solver that is used to obtain the solution to linear and quadratic programs. The solvers supported by this package are cplexAPI, gurobi, limSolve and Rcplex.

Details

The following input for norm will be interpreted as the 1-norm:

  • 1 (numeric)

  • "1" (string)

  • "L1"

  • "one"

  • "o"

  • "taxicab"

The following input for norm will be interpreted as the 2-norm:

  • 2 (numeric)

  • "2" (string)

  • "L2"

  • "two"

  • "t"

  • "e"

  • "euclidean"

Value

Returns the bounds subject to the shape constraints.

ub

The upper bound.

lb

The lower bound.

mincriterion

The objective value of the first-stage problem (i.e. mincriterion).

est

The indicator of whether estimation is involved in the estimation.

call

The function that has been called.

norm

The norm used.

ub.status

The status of the optimization problem for the upper bound.

lb.status

The status of the optimization problem for the lower bound.

solver

The name of the solver used.

Example

  source("./example/dgp_missingdata.R") # Change directory if necessary
  J <- 5
  N <- 1000
  data <- missingdata_draw(J = J, n = N, seed = 1, prob.obs = .5)
  lpm <- missingdata_lpm(J = J, info = "full", data = data)
  estbounds(data = data,
            lpmodel = lpm,
            norm = 2,
            solver = "gurobi",
            estimate = TRUE)

More examples

More examples can be found in the estbounds_example.R file under the example subdirectory of the installation directory for the lpinfer package.


conroylau/lpinfer documentation built on Oct. 23, 2022, 9:21 a.m.