Rev Language Reference


dnSoftBoundUniformNormal - Soft-bounded uniform-normal distribution

A soft-bounded uniform distribution with one or two normally distributed tails outside the domain of the uniform component.

Usage

dnSoftBoundUniformNormal(Real min, Real max, RealPos sd, Probability p, String boundary)

Arguments

min : Real (pass by const reference)
The min value of the uniform distribution.
max : Real (pass by const reference)
The max value of the uniform distribution.
sd : RealPos (pass by const reference)
The standard deviation of the normal tail(s). Can be specified directly, or computed from 'p'.
Default : NULL
p : Probability (pass by const reference)
The probability of being within the uniform boundaries. Can be specified directly, or computed from 'sd'.
Default : NULL
boundary : String (pass by value)
Which boundary should be soft?
Default : both
Options : both|upper|lower

Domain Type

Details

Draws from a uniform distribution defined between the `min` and `max` values with probability `p`. The tail probability (1 - `p`) is assigned to values smaller than `min` (if `boundary="lower"`), values larger than `max` (if `boundary="upper"`), or apportioned equally between the lower and upper tails (by default, when `boundary="both"`). The probability density outside the [`min`, `max`] interval is that of a normal distribution whose standard deviation can be either automatically computed from `p` or directly specified using the `sd` argument. Exactly one of `sd` and `p` must be specified, with the unspecified value automatically computed so that the density is continuous at `min` and `max`.

Example

# Create a simple model (unclamped)
calib ~ dnSoftBoundUniformNormal( 13.6, 25, p=0.95, "upper" )
mymodel = model(calib)

# Create a move vector and a monitor vector
moves[1] = mvSlide(calib, delta=0.1, weight=1.0)
monitors[1] = mnScreen(calib, printgen=1000)

# Use MCMC to draw samples from the specified distribution
mymcmc = mcmc(mymodel, monitors, moves)
mymcmc.run(generations=200000)

See Also