  The direct sampling method proposed by Walker et al. (JCGS 2011) can generate
draws from weighted distributions possibly having intractable normalizing
constants. The method may be of interest as a useful tool in situations which
require drawing from an unfamiliar distribution. However, the original
algorithm can have difficulty producing draws in some situations. The present
work restricts attention to a univariate setting where the weight function and
base distribution of the weighted target density meet certain criteria. Here, a
variant of the direct sampler is proposed which uses a step function to
approximate the density of a particular augmented random variable on which the
method is based. Knots for the step function can be placed strategically to
ensure the approximation is close to the underlying density. Variates may then
be generated reliably while largely avoiding the need for manual tuning or
rejections. A rejection sampler based on the step function allows exact draws
to be generated from the target with lower rejection probability in exchange
for increased computation. Several applications of the proposed sampler
illustrate the method: generating draws from the Conway-Maxwell Poisson
distribution, a Gibbs sampler which draws the dependence parameter in a random
effects model with conditional autoregression structure, and a Gibbs sampler
which draws the degrees-of-freedom parameter in a regression with t-distributed
errors.
