This function produces a point estimate for the log-normal distribution quantile of fixed level quant
.
LN_QuantReg(
y,
X,
Xtilde,
quant,
method = "weak_inf",
guess_s2 = NULL,
y_transf = TRUE,
CI = TRUE,
method_CI = "exact",
alpha_CI = 0.05,
type_CI = "two-sided",
rel_tol_CI = 1e-05,
nrep = 1e+05
)
Vector of observations of the response variable.
Design matrix.
Covariate patterns of the units to estimate.
Number between 0 and 1 that indicates the quantile of interest.
String that indicates the prior setting to adopt. Choosing "weak_inf"
a weakly informative prior setting is adopted, whereas selecting
"optimal"
the hyperparameters are fixed trough a numerical optimization algorithm
aimed at minimizing the frequentist MSE.
Specification of a guess for the variance if available. If not, the sample estimate is used.
Logical. If TRUE
, the y
vector is assumed already log-transformed.
Logical. With the default choice TRUE
, the posterior credibility interval is computed.
Level of credibility of the posterior interval.
String that indicates the type of interval to compute: "two-sided"
(default),
"UCL"
(i.e. Upper Credible Limit) for upper one-sided intervals or "LCL"
(i.e. Lower
Credible Limit) for lower one-sided intervals.
Level of relative tolerance required for the integrate
procedure or for the infinite sum.
Default set to 1e-5
.
Number of simulations for the C.I. in case of method="simulation"
and for the posterior of the coefficients vector.
The function returns the prior parameters and their posterior values, summary statistics of the parameters \(\beta\) and \(\sigma^2\), and the estimate of the specified quantile: the posterior mean and variance are provided by default. Moreover the user can control the computation of posterior intervals.
The function allows to carry out Bayesian inference for the conditional quantiles of a sample that is assumed log-normally distributed.
The design matrix containing the covariate patterns of the sampled units is X
, whereas Xtilde
contains the covariate patterns of the unit to predict.
The classical log-normal linear mixed model is assumed and the quantiles are estimated as: $$\theta_p(x)=exp(x^T\beta+\Phi^{-1}(p))$$.
A generalized inverse Gaussian prior is assumed for the variance in the log scale \(\sigma^2\), whereas a flat improper prior is assumed for the vector of coefficients \(\beta\).
Two alternative hyperparamters setting are implemented (choice controlled by the argument method
): a weakly
informative proposal and an optimal one.