subsample.bs.fn: Carries out one bootstrap replication for the subsampling...

View source: R/subsample.R

subsample.bs.fnR Documentation

Carries out one bootstrap replication for the subsampling test

Description

This function carries out the one bootstrap replication of the subsampling test. This function is used in the subsample.bs function via the future_map function.

Usage

subsample.bs.fn(
  x,
  data,
  lpmodel,
  beta.tgt,
  norm,
  m,
  solver,
  replace,
  n,
  pbar,
  eval.count,
  n.bs,
  any.list,
  progress,
  omega.hat
)

Arguments

x

This is either the list of indices that represent the bootstrap replications, or the list of bootstrap components of the lpmodel object passed from the user.

data

An data frame or a matrix.

lpmodel

An lpmodel object.

beta.tgt

The value to be tested.

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.

m

The size of each subsample.

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.

replace

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

n

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

pbar

The progress bar object.

eval.count

The count for the number of times the future_map function has been called. If this object is zero, it means that the future_map function is being called for the first time in this subprocedure. Otherwise, it means that the future_map function has been called for more than once. This situation typically refers to the situations where there are some errors in the first time of the replications.

n.bs

The total number of replications to be conducted in this procedure.

any.list

This object contains information on whether any components in the lpmodel object is a list.

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.

omega.hat

The estimator of the asymptotic variance.

Value

Returns a list of output that are obtained from the subsampling procedure:

Ts

The bootstrap test statistic.

beta

The bootstrap estimate of beta.obs.

msg

An error message (if applicable).


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