param.discrete: Deifine a Discrete Parameter

Description Usage Arguments Value Examples

View source: R/params.R

Description

Deifine a Discrete Parameter

Usage

1
2
param.discrete(choices, initial = NULL, weights = NULL, ordered = FALSE,
  ...)

Arguments

choices

A vector of valid choices. Can be any type.

initial

The initial value (must be one of choices or NULL). See initial.value.

weights

Probability weights for each choice (must be of same length as choices).

ordered

TRUE if order matters, FALSE otherwise.

...

Additional arguments to be used in optimisation methods

Value

An object of type 'param.discrete'

Examples

1
2
3
4
5
6
7
8
# regular discrete parameter
param.discrete(c("inside", "outside", "I don't care"))

# ordered discrete parameter
param.discrete(c("disagree", "somewhat agree", "agreee"), ordered=TRUE)

# create a parameter that is a loaded coin
param.discrete(c(TRUE, FALSE), weights=c(0.75, 0.25))

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