ProposeDiscrete: Propose a new discrete value.

Description Usage Arguments Value Author(s) See Also Examples

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

1
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

proposeContinuous

Examples

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

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


Search within the EDISON package
Search all R packages, documentation and source code

Questions? Problems? Suggestions? or email at ian@mutexlabs.com.

Please suggest features or report bugs with the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.