File: generateRandomDesign.Rd

package info (click to toggle)
r-cran-paramhelpers 1.14-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 992 kB
  • sloc: ansic: 102; sh: 13; makefile: 2
file content (57 lines) | stat: -rw-r--r-- 2,354 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/generateRandomDesign.R
\name{generateRandomDesign}
\alias{generateRandomDesign}
\title{Generates a random design for a parameter set.}
\usage{
generateRandomDesign(n = 10L, par.set, trafo = FALSE)
}
\arguments{
\item{n}{(\code{integer(1)})\cr
Number of samples in design.
Default is 10.}

\item{par.set}{\link{ParamSet}\cr
Parameter set.}

\item{trafo}{(\code{logical(1)})\cr
Transform all parameters by using theirs respective transformation
functions. Default is \code{FALSE}.}
}
\value{
\link{data.frame}. Columns are named by the ids of the parameters. If the
\code{par.set} argument contains a vector parameter, its corresponding column
names in the design are the parameter id concatenated with 1 to dimension
of the vector. The result will have an \code{logical(1)} attribute
\dQuote{trafo}, which is set to the value of argument \code{trafo}.
}
\description{
The following types of columns are created:
\tabular{ll}{
numeric(vector)   \tab  \code{numeric}  \cr
integer(vector)   \tab  \code{integer}  \cr
discrete(vector)  \tab  \code{factor} (names of values = levels) \cr
logical(vector)   \tab  \code{logical}
}
If you want to convert these, look at \code{\link[BBmisc:convertDataFrameCols]{BBmisc::convertDataFrameCols()}}. For
discrete vectors the levels and their order will be preserved, even if not
all levels are present.

The algorithm simply calls \code{\link[=sampleValues]{sampleValues()}} and arranges the result in a
data.frame.

Parameters are trafoed (potentially, depending on the setting of argument
\code{trafo}); dependent parameters whose constraints are unsatisfied are set to
\code{NA} entries.

\code{generateRandomDesign} will NOT work if there are dependencies over multiple
levels of parameters and the dependency is only given with respect to the
\dQuote{previous} parameter. A current workaround is to state all
dependencies on all parameters involved. (We are working on it.)

Note that if you have trafos attached to your params, the complete creation
of the design (except for the detection of invalid parameters w.r.t to their
\code{requires} setting) takes place on the UNTRANSFORMED scale. So this function
samples from a uniform density over the param space on the UNTRANSFORMED
scale, but not necessarily the transformed scale.
}