Description Usage Arguments Details Value Author(s) See Also Examples
This function constrains the value(s) of a scalar, vector, matrix, or
array to a specified interval, [a,b]. In Bayesian inference, it
is often used both to truncate a parameter to an interval, such as
p(theta) in [a,b]. The interval
function is often used in conjunction with the dtrunc
function to truncate the prior probability distribution associated
with the constrained parameter. While dtrunc
prevents
assigning density outside of its interval and re-estimates density
within the interval, the interval
function is used to prevent
the parameter from moving outside of the interval in the first place.
After the parameter is constrained to an interval in
IterativeQuadrature
, LaplaceApproximation
,
LaplacesDemon
, PMC
, or
VariationalBayes
, the constrained parameter should be
updated back into the parm
vector, so the algorithm knows it
has been constrained.
This is unrelated to the probability interval (see
p.interval
and LPL.interval
).
1 |
x |
This required argument is a scalar, vector, matrix or array,
and its elements will be constrained to the interval
[ |
a |
This optional argument allows the specification of the lower
bound of the interval, and defaults to |
b |
This optional argument allows the specification of the upper
bound of the interval, and defaults to |
reflect |
Logical. When |
It is common for a parameter to be constrained to an interval. For
example, a scale parameter is positive-only. Nonetheless, the user
should consider re-parameterizing by transforming the constrained
parameter to the real line. To continue the example, a scale parameter
may be log-transformed. A parameter that is re-parameterized to the
real line often mixes better in MCMC, exhibiting a higher effective
sample size (ESS
), and each evaluation of the model
specification function is faster as well. Nonetheless, there are
many cases where it is better for the parameter to be constrained to
an interval.
The interval
function returns a scalar, vector, matrix, or
array in accord with its argument, x
. Each element is
constrained to the interval [a
,b
].
Statisticat, LLC. software@bayesian-inference.com
dtrunc
,
ESS
,
IterativeQuadrature
,
LaplaceApproximation
,
LaplacesDemon
,
LPL.interval
,
PMC
,
p.interval
,
VariationalBayes
.
1 2 3 4 5 6 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.