Description Usage Arguments Value Author(s) References See Also Examples
Fit a univariate Bayesian linear regression model.
1 2 3 4 5 6 |
formula |
a symbolic description of the model to be fit. |
data |
an optional data frame containing the variables in the model. |
iter |
amount of iterations for the sampler to perform and return. |
burnin |
burn-in amount of iterations ignored in the trace. |
inits |
initial values for variance and betas in a |
thin |
amount of thinning to be performed |
prior_tau |
prior for the residual variance in the linear model, of the form dgamma(shape, scale). Only dgamma allowed! |
prior_b |
(vector of) priors for beta coefficients. With
|
method |
cppbr = Bayes Regression in C++, rbr = Bayes Regression in R, rgs = Bayesian Regression under Gibbs Sampling, rmhs = Bayesian Regression under Gibbs Sampling with Metropolis-Hastings step for Nonconjugate Priors |
mtsprior |
Boolean value indicating whether a Minimum Training Sample prior should be calculated. For use in conjuction with ANOVA & Bayes Factors for informative hypotheses |
verbose |
print all info in the console or not (in development!) |
dtuning |
dynamic tuning of the random walk Metropolis-Hastings step |
An object of class blimfit
, including all necessary information such as
summary, trace and original data.
Erik-Jan van Kesteren
Beland, S., Klugkist, I., Raiche, G. & Magis, D. (2012). A short introduction into Bayesian evaluation of informative hypotheses as an alternative to exploratory comparisons of multiple group means. Tutorials in Quantitative Methods for Psychology 8(2), p. 122-126.
Raftery, A. E. (1996). Hypothesis testing and model selection. Markov chain Monte Carlo in practice, 163-188.
cplots
, aplots
, BF
,
PPC
, ICBF
, DIC
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | # Most simple example with full functionality
fit1 <- blim(dist~speed, data=cars)
summary(fit1)
# More complex example with nonconjugate priors
fit2 <- blim(formula = dist~speed, data = cars, iter = 9999, burnin = 100,
inits = list(var = 200, b0 = -15, b1 = 3), thin = 0,
prior_tau = "dgamma(0.001,0.001)",
prior_b = c("dcauchy(0,2000)", "dunif(3,4.5)"),
method = "rmhs", dtuning = 1000)
summary(fit2)
# check convergence and autocorrelation
cplots(fit1)
aplots(fit1)
# calculate Bayes Factor of model 2 versus model 1
BF(fit2, fit1)
# perform posterior predictive check for normality of residuals
PPC(fit2)
# evaluate informative hypothesis in model 1
ICBF(fit1, model = "par[1] < par[2]", complement = TRUE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.