subsample.check: Checks and updates the input in 'subsample'

View source: R/subsample.R

subsample.checkR Documentation

Checks and updates the input in subsample

Description

This function checks and updates the input from the user in the subsample function. If there is any invalid input, the function will be terminated and error messages will be printed.

Usage

subsample.check(
  data,
  lpmodel,
  beta.tgt,
  R,
  Rmulti,
  solver,
  norm,
  phi,
  n,
  replace,
  progress
)

Arguments

data

An data frame or a matrix.

lpmodel

An lpmodel object.

beta.tgt

The value to be tested.

R

The number of bootstrap replications.

Rmulti

The multiplier for the number of bootstrap replications. The product of Rmulti and R refers to the maximum number of bootstrap replications to be conducted if there are errors.

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.

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.

phi

The tuning parameter for the subsampling test. The size of each subsample is n^φ where φ \in [0,1].

n

The sample size. This is only required if data is omitted in the input.

replace

A boolean variable to indicate whether the function samples the data with or without replacement.

progress

The boolean variable for whether the progress bars should be displayed. If it is set as TRUE, the progress bars will be displayed while the code is running.

Value

Returns the updated parameters and objects back to the function subsample. The following information are updated:

  • data

  • lpmodel

  • solver

  • solver.name

  • norm

  • test.logical

  • logical.lb

  • logical.ub


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