Description Usage Arguments Details Value Author(s) References See Also Examples
The function cpef
numerically estimates a
canonical parameter of the three-parameter exponential
family of distributions that includes two different types
of prior distributions (log-gamma and normal). See
‘Details’ and Lee 2013 for more
information.
1 2 3 4 5 |
y |
a numeric vector of length |
hparam |
a numeric vector of length |
apriori |
a character string of length |
method |
a name of numerical method to be used for
fitting the |
ztrunc |
a logical value; Is the zero truncated?;
Defaults to |
verbose |
a logical value; Be more verbose about the
process by displaying messages; Defaults to
|
start |
a starting value for a canonical parameter to be fitted. |
initrun |
a logical value; Would you like to run the
function |
control |
a list of parameters for controlling the fitting process. See ‘Details’. |
proposal |
a list of parameters for controlling the fitting process. See ‘Details’. |
The function cpef
stands for a three-parameter
exponenital family of distributions of a parameter which
is canonically parameterized. This family of
distributions has a conjugacy of log-gamma and normal
priors to a (zero-truncated) Poisson sampling model.
Numericall methods are implemented for both cases of
ztrunc=TRUE
and ztrunc=FALSE
on this family
of distributions that is a general form including both
apriori=lgamma
and apriori=normal
.
LA
(Laplace approximation) is the implementation
of that in the study Tierney, Kass, and Kadane
1989. The correction const
defaults to 2e1
(log-scaled value).
MH
(Metropolis-Hasting algorithm) is the
implementation of that in the study Chib and
Greenberg 1995. nchains
and nburns
defaults to 2e3
and 5e2
. Normal
distribution with mu=log(mean(y))
and
sigma=sd(y)
is chosen for a proposal distribution
to generate a candidate sample.
IS
(Importance sampling) is the implementation of
that in the study Denny 2001. ess
(effective sample size) is computed with an importance
sample of size n=1e3
. cpef
is recursively
used with method=LA
for having the best guess for
a mean value mu
of a proposal distribution.
AS
(Analytic soluation) is available only and only
if ztrunc=FALSE
and apriori=lgamma
.
AQ
(Adaptive quadrture) is the direct integration
approach in terms of the canonical parameter theta
using the R function integrate
on infinite
interval.
The list of components returned from cpef
depends
on what numerical method is employed. All input paramters
are inherited. The commonly returned components are:
theta |
The estimated canonical parameter of length
|
ess |
The effective sample size if
|
sratio |
The ratio of
determinants of two hessian matrices if |
accept.rate |
The proportion of candidate samples
that are accepted in the chain of length |
Chel Hee Lee <gnustats@gmail.com>
Tierney L., Kass R. and Kadane J. (1989). “Fully Exponential Laplace Approximations to Expectations and Variances of Nonpositive Functions.” _Journal of the American Statistical Association_, *84*(407), pp. 710-716.
Chib S. and Greenberg E. (1995). “Understanding the Metropolis-Hastings Algorithm.” _The American Statistician_, *49*(4), pp. 327-335.
Denny M. (2001). “Introduction to importance sampling in rare-event simulations.” _European Journal of Physics_, *22*(4), pp. 403.
Lee (2013) “Imprecise inferential framework”, PhD thesis.
R Core Team (2013). R: A language and environment for statistical computing. R Foundation for Statistical Computing, Vienna, Austria. URL http://www.R-project.org/.
optim
, integrate
,
update
, model
,
iprior
1 2 3 4 5 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.