blop: Bilevel Optimization Problem Matching Solvers

Description Usage Arguments Details Value Author(s) Examples

View source: R/blopmatch.r

Description

blop matches all rows i in X to j!=i. This function is a wrapper of both blopi_lpsolve and blopi_glpk.

Usage

1
2
3
4
5
6
7
8
9
blop(X, Treat = rep(-1, nrow(X)), exact = NULL, solver = "glpk",
  W = diag(ncol(X)), p = 1)

blopi_lpsolve(xi, X, D = NULL)

blopi_glpk(xi, X, D = NULL)

## S3 method for class 'blopmatch_match'
as.matrix(x, ...)

Arguments

X

Numeric matrix of size n*K.

Treat

Integer vector of size n. Group indicator. Can be either -1 (no group), 0 (control) or 1 (treatment).

exact

Numeric matrix with n rows. When specified, exact matching is performed on those variables (see matching_group).

solver

A character scalar. Either "glpk" or "lpsolve".

W

Numeric matrix of size K*K. When W is equal to solve(var(X)), it is the Mahalanobis norm.

p

Numeric scalar. See weighted_norm.

xi

Numeric vector of length k. Ith individual covariates.

D

Numeric vector. Distances vector (internal use only).

Details

Both W and p are passed to weighted_norm.

Value

In the case of blop, a list of class blopmatch_match:

matches

A list of size N with the BLOP solutions

status

An integer vector of length N. A value equal to one indicates that the problem was binded.

X

Original matrix X passed to the function.

Author(s)

George G. Vega Yon

Examples

1
2
3
4
5
6
7
8
set.seed(123)

X <- matrix(rnorm(10*2), ncol=2)
ans <- blop(X)

plot(ans)

data(lalonde, package="MatchIt")

gvegayon/blopmatch documentation built on May 17, 2019, 9:30 a.m.