Last chance! 50% off unlimited learning
Sale ends in
This function produces a bayesian estimate of the conditional log-normal mean assuming a GIG prior for the variance and an improper prior for the regression coefficients of the linear regression in the log scale.
LN_MeanReg(
y,
X,
Xtilde,
method = "weak_inf",
y_transf = TRUE,
h = NULL,
CI = TRUE,
alpha_CI = 0.05,
type_CI = "two-sided",
nrep = 1e+05
)
The function returns a list including the prior and posterior parameters, the point estimate of the log-normal mean conditioned with respect to the covariate
points included in Xtilde
. It consists of the mean of the posterior
distribution for the functional
Vector of observations of the response variable.
Design matrix.
Matrix of covariate patterns for which an estimate is required.
String that indicates the prior setting to adopt. Choosing "weak_inf"
a weakly
informative prior setting is adopted, whereas selecting
"optimal"
the hyperparameters are aimed at minimizing the frequentist MSE.
Logical. If TRUE
, the y
vector is already assumed as log-transformed.
Leverage. With the default option NULL
, the average leverage is used.
Logical. With the default choice TRUE
, the posterior credibility interval is computed.
Level of alpha that determines the credibility (1-alpha_CI
) 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.
Number of simulations.
In this function the same procedure as LN_Mean is implemented allowing for the inclusion of covariates.
Bayesian point and interval estimates for the response variabile in the original scale are provided considering the model:
library(BayesLN)
data("fatigue")
# Design matrices
Xtot <- cbind(1, log(fatigue$stress), log(fatigue$stress)^2)
X <- Xtot[-c(1,13,22),]
y <- fatigue$cycle[-c(1,13,22)]
Xtilde <- Xtot[c(1,13,22),]
#Estimation
LN_MeanReg(y = y,
X = X, Xtilde = Xtilde,
method = "weak_inf", y_transf = FALSE)
Run the code above in your browser using DataLab