| LN_Mean | R Documentation |
This function produces a Bayesian estimate of the log-normal mean, assuming a GIG prior for the variance and an improper flat prior for the mean in the log scale.
LN_Mean(
x,
method = "weak_inf",
x_transf = TRUE,
CI = TRUE,
alpha_CI = 0.05,
type_CI = "two-sided",
nrep = 1e+05
)
x |
Vector containing the sample. |
method |
String that indicates the prior setting to adopt. Choosing |
x_transf |
Logical. If |
CI |
Logical. With the default choice |
alpha_CI |
Level of alpha that determines the credibility (1- |
type_CI |
String that indicates the type of interval to compute: |
nrep |
Number of simulations for the computation of the credible intervals. |
Summarizing the posterior mean of the log-normal expectation might be delicate since several
common priors used for the variance do not produces posteriors with finite moments. The proposal by Fabrizi and Trivisano (2012) of adopting a generalized inverse Gaussian (GIG)
prior for the variance in the log scale \sigma^2 has been implemented. Moreover, they discussed how to specify the hyperparameters according to two different aims.
Firstly, a weakly informative
prior allowed to produce posterior credible intervals with good frequentist properties, whereas a prior aimed at minimizing the point estimator
MSE was proposed too. The choice between the two priors can be made through the argument method.
The point estimates are exact values, whereas the credible intervals are provided through simulations from the posterior distribution.
The function returns a list which includes the prior and posterior parameters, the point estimate of the log-normal mean that consists in the mean of the posterior
distribution of the functional \exp\{\mu+\sigma^2/2\} and the posterior variance.
Fabrizi, E., & Trivisano, C. Bayesian estimation of log-normal means with finite quadratic expected loss. Bayesian Analysis, 7(4), 975-996. (2012).
# Load data
data("NCBC")
# Optimal point estimator
LN_Mean(x = NCBC$al, x_transf = FALSE, method = "optimal", CI = FALSE)
# Weakly informative prior and interval estimation
LN_Mean(x = NCBC$al, x_transf = FALSE, type_CI = "UCL")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.