random.value: Generate a random parameter value

Description Usage Arguments Value Examples

View source: R/params.R

Description

Generate a random parameter value

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
random.value(param, n = 1, seed = NULL)

## S3 method for class 'param.discrete'
random.value(param, n = 1, seed = NULL)

## S3 method for class 'param.real'
random.value(param, n = 1, seed = NULL)

## S3 method for class 'param.distributed'
random.value(param, n = 1, seed = NULL)

## S3 method for class 'param.distr.int'
random.value(param, n = 1, seed = NULL)

## S3 method for class 'param.fixed'
random.value(param, n = 1, seed = NULL)

Arguments

param

An object of type 'param'

n

The number of values to generate

seed

The random seed

Value

n valid random parameter values

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
p <- param.discrete(c('heads', 'tails'))
random.value(p)
random.value(p, n=10)

p <- param.real(c(0, 100))
random.value(p, n=10)

p <- param.normal(50, 10)
random.value(p, n=10)

p <- param.normal.int(50, 10)
random.value(p, n=10)

paleolimbot/easyoptim documentation built on May 24, 2019, 6:12 p.m.