bm | R Documentation |
Fit a Bayesian model
bm(x, ...) ## S3 method for class 'formula' bm( x, data = NULL, n_save = 1000L, n_burn = 500L, options = set_options(), mh = set_mh(), verbose = TRUE, W, X_SLX, type = c("lm", "slx", "sar", "sem", "sdm", "sdem", "sv"), ... ) ## S3 method for class 'bm' bm(x, n_save = 1000L, n_burn = 0L, verbose = TRUE, ...) blm(...) bslx(...) bsar(...) bsem(...) bsdm(...) bsdem(...) bsv(...)
x |
Formula or |
... |
Not used. |
data |
A |
n_save, n_burn |
Integer scalar. Number of draws for the burn-in period and to store for inference. |
options |
Settings for the prior setup. See |
mh |
Settings to tune the Metropolis-Hastings step. See |
verbose |
Logical scalar. Whether to print status updates. |
W |
Numeric matrix (or function to construct one) with the spatial connectivities. |
X_SLX |
Numeric matrix with explanatory variables that should be lagged spatially. |
type |
Character scalar used to specify the desired model. |
Returns a list with draws from the specified Bayesian model and an object to obtain further samples.
N <- 100L beta <- 1:5 X <- matrix(rnorm(N * 5), N, 5) y <- X %*% beta + rnorm(N) bm(y ~ X, n_burn = 100, n_draw = 100) # Reproduce the linear model in Kuschnig (2022) blm(log(sales) ~ log(price / cpi) + log(ndi / cpi) + factor(name) + factor(year), data = cigarettes)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.