ProposeDiscrete {EDISON} | R Documentation |
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
.
Author(s)
Frank Dondelinger
See Also
Examples
# Previous parameter value
param = rpois(1, 5)
# Propose new value within range [0, 10], with proposal width 2
new.param = ProposeDiscrete(param, 2, 10)
[Package EDISON version 1.1.1 Index]