efficient_round: Efficient Round

View source: R/efficient_round.R

efficient_roundR Documentation

Efficient Round

Description

Takes an approximate design, and a number of points and converts the design to an approximate design. It uses the multiplier (n - l/2) and evens the total number of observations afterwards.

Usage

efficient_round(design, n, tol = 1e-05)

Arguments

design

a dataframe with columns "Point" and "Weight" that represents a design

n

an integer that represents the desired number of observations of the exact design

tol

optional parameter for the consideration of an integer in the rounding process

Value

a data.frame with columns "Point" and "Weight" representing an exact design with n observations

Examples

design_test <- data.frame("Point" = seq(1, 5, length.out = 7),
         "Weight" = c(0.1, 0.0001, 0.2, 0.134, 0.073, 0.2111, 0.2818))

efficient_round(design_test, 20)

exact_design <- efficient_round(design_test, 21)
aprox_design <- exact_design
aprox_design$Weight <- aprox_design$Weight/sum(aprox_design$Weight)

optedr documentation built on Nov. 18, 2022, 5:12 p.m.