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

View source: R/fsst.R

fsst.checkR Documentation

Checks and updates the input in fsst

Description

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

Usage

fsst.check(
  data,
  lpmodel,
  beta.tgt,
  R,
  Rmulti,
  lambda,
  rho,
  n,
  weight.matrix,
  solver,
  progress,
  sqrtm.method,
  sqrtm.tol,
  previous.output
)

Arguments

data

An data frame or a matrix.

lpmodel

The 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.

lambda

Parameter used to obtain the restricted estimator \widehat{\bm{β}}^r_n. A data-driven parameter lambda can be included if NA is included as part of the vector for lambda. For instance, if lambda is set as c(0.1, NA), then both 0.1 and the data-driven lambda will be applied in the fsst test. The default is to use the data-driven lambda.

rho

Parameter used in the studentization of matrices.

n

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

weight.matrix

The option used in the weighting matrix. There are three options available:

  • identity — identity matrix

  • diag — the diagonal matrix that takes the diagonal elements of the inverse of the variance matrix

  • avar — inverse of the variance matrix

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.

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.

sqrtm.method

The method used to obtain the matrix square root in the fsst procedure. This has to be a function that takes one argument that accepts a square matrix of size k x k and returns a square matrix of size k x k, where k can be the length of the β(P) vector, or the beta.obs component of the lpinfer object.

sqrtm.tol

The absolute tolerance used to check whether the matrix square root is correct. This is done by checking whether the Frobenius norm is smaller than the tolerance level, i.e., when A is the give matrix, B is the matrix square root obtained from the given sqrtm.method function, and ε is the tolerance level, the FSST test checks whether ||A - BB||_F < ε. If this does not hold, the FSST test will use the sqrtm function from the expm package to obtain the matrix square root.

previous.output

The list of outputs obtained from the previous evaluation of the procedure. This is only used in the fsst test and when previous.out contains the studentized matrix omega.i. The rest of the arguments are ignored.

Value

Returns the updated parameters back to the function fsst. The following information are updated:

  • data

  • solver

  • solver.name

  • test.logical

  • logical.lb

  • logical.ub


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