sample_params: sample values in given distribution

View source: R/sample_params.R

sample_paramsR Documentation

sample values in given distribution

Description

sample values in given distribution

Usage

sample_params(bounds_list, n, seed = NULL)

Arguments

bounds_list

Either a (optionnally named) list containing a vector of upper and lower bounds (ub and lb), or a named list containing for each parameter the list of situations per group (sit_list) and the vector of upper and lower bounds (one value per group) (ub and lb)

n

The number of values to sample for each parameter

seed

The seed of the random generator (optional, default value=NULL)

Details

For the moment only works with uniform distributions but will be hopefully soon extended to any distribution. Use genetic LHS (from lhs package)

Value

A vector or data.frame containing the sampled values (nrow=n)

Examples


bounds_list <- list(lb = c(0, 1, 2), ub = c(1, 2, 3))
CroptimizR:::sample_params(bounds_list, 5)



SticsRPacks/CroptimizR documentation built on Dec. 16, 2024, 11:54 a.m.