impute_lr: Impute values derived from linear (in)equality restrictions.

Description Usage Arguments Note Examples

Description

Partially filled records \boldsymbol{x} under linear (in)equality restrictions may reveal unique imputation solutions when the system of linear inequalities is reduced by substituting observed values. This function applies a number of fast heuristic methods before deriving all variable ranges and unique values using Fourier-Motzkin elimination.

Usage

1
2
3
4
impute_lr(dat, x, ...)

## S4 method for signature 'data.frame,validator'
impute_lr(dat, x, methods = c("zeros", "piv", "implied"), ...)

Arguments

dat

an R object carrying data

x

an R object carrying validation rules

...

arguments to be passed to other methods.

methods

What methods to use. Add 'fm' to also compute variable ranges using fourier-motzkin elimination (can be slow and may use a lot of memory).

Note

The Fourier-Motzkin elimination method can use large amounts of memory and may be slow. When memory allocation fails for a ceratian record, the method is skipped for that record with a message. This means that there may be unique values to be derived but it is too computationally costly on the current hardware.

Examples

1
2
3
v <- validate::validator(y ==2,y + z ==3, x +y <= 0)
dat <- data.frame(x=NA_real_,y=NA_real_,z=NA_real_)
impute_lr(dat,v)

deductive documentation built on March 29, 2021, 5:12 p.m.