Learn R Programming

EDISON (version 1.1.1)

ProposeDiscrete: Propose a new discrete value.

Description

This function proposes a new discrete parameter, based on the previous value, within the given proposal range, making sure that the maximum range is not exceeded.

Usage

ProposeDiscrete(params.old, proposal.range, max.range)

Arguments

params.old
Old parameter value (an integer).
proposal.range
Range for new proposal (an integer).
max.range
Maximum value for new proposal (an integer).

Value

Returns the new proposed parameter, which will be an integer in the range [0, max.range], and within at most proposal.range of params.old.

See Also

proposeContinuous

Examples

Run this code

# Previous parameter value
param = rpois(1, 5)

# Propose new value within range [0, 10], with proposal width 2
new.param = ProposeDiscrete(param, 2, 10)

Run the code above in your browser using DataLab