LN_MeanReg {BayesLN} | R Documentation |
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 )
y |
Vector of observations of the response variable. |
X |
Design matrix. |
Xtilde |
Matrix of covariate patterns for which an estimate is required. |
method |
String that indicates the prior setting to adopt. Choosing |
y_transf |
Logical. If |
h |
Leverage. With the default option |
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. |
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: log(y_i)=Xβ.
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 \exp\{\tilde{x}_i^Tβ+σ^2/2\} and the posterior variance.
Fabrizi, E., & Trivisano, C. Bayesian Conditional Mean Estimation in Log-Normal Linear Regression Models with Finite Quadratic Expected Loss. Scandinavian Journal of Statistics, 43(4), 1064-1077. (2016).
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)