create_set: Create set of samples by sampling with LHS and then checking...

Description Usage Arguments Value Functions References Examples

Description

create_set creates sample that stay within constraints.

Usage

1
2
3
4
5
6
7
create_set(input_values = NULL, input_names = NULL, sample_count,
  constraints, model_data, model_data_formula = NULL,
  add_model_data_col = FALSE, create_input_values = NULL)

create_sample(input_values, input_names, sample_count)

keep_satisfied(sampled, constrained)

Arguments

input_values

List

input_names

Character vector

sample_count

Numeric vector length one.

constraints

Character vector that is either "none" of is using only variable names that are specified in the input_values List argument. This character vector is evaluated in an environment created for the sampled data on the variables, and its evaluation results in a Logical vector that that subsets sampled.

model_data

Optional data.frame with the data that was used to build the model. This is used if one wants to ensure that all parameters tested are in the convex hull of the data used to build the model that is now being analyzed. This uses the WhatIf package in the Suggest field of the eat description file.

model_data_formula

optional formula for WhatIf package.

add_model_data_col

optional Logical for whether to add col

create_input_values

Instead of the input_values and input_names args which lead the function to use LHS and create the samples that way you can provide a function to this arg that takes an arg for how many samples to create and returns a data.frame with that many rows of samples.

sampled

Output of create sample_sample

constrained

Logical vector

Value

Returns a data.frame of samples.

Returns a data.frame of samples.

Returns a data.frame of samples thats the same or less rows as input.

Functions

References

B. Beachkofski, R. Grandhi, in 43rd AIAA/ASME/ASCE/AHS/ASC Structures, Structural Dynamics, and Materials Conference (American Institute of Aeronautics; Astronautics, 2002; http://arc.aiaa.org/doi/abs/10.2514/6.2002-1274).

R. Carnell, Lhs Latin Hypercube Samples (2012), (available at http://cran.r-project.org/web/packages/lhs/index.html).

Examples

1
2
3
4
fake_constraints <- "param1 < 0.5 & param2 > 0.5"
fake_data <- data.frame(param1 = runif(100), param2 = runif(100))
fake_constraints <- with(fake_data, eval(parse(text=fake_constraints)))
keep_satisfied(fake_data, fake_constraints)

JohnNay/sa documentation built on May 7, 2019, 12:01 p.m.