Learn R Programming

deductive (version 1.0.0)

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

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

impute_lr(dat, x, ...)

# S4 method for 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).

Examples

Run this code
# NOT RUN {
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)

# }

Run the code above in your browser using DataLab