View source: R/modify_stancode.R
modify_stancode | R Documentation |
brms
to fit a CAR(1) modelN.B., modify_stancode(method = "car1")
resets the lower bound on the ar
parameter to zero. It is compatible with priors such as
normal()
(check to make sure it makes the expected modifications before using).
modify_stancode(
scode_raw,
modify = "car1",
var_xcens = NULL,
var_car1 = NULL,
lower_bound = NULL,
lcl = NULL
)
scode_raw |
Stan code generated by |
modify |
Specify which modification to make. The default (and currently the only option) is |
var_xcens |
For multivariate models, specify the names of censored predictor variables as a character vector. |
var_car1 |
For multivariate models, specify which variable to generate CAR(1) errors for. |
lower_bound |
An optional lower bound for left-censored parameters. The default is no lower bound. |
lcl |
A numeric vector of censoring limits for left-censored variables. Alternatively, a list of numeric vectors with censoring limits for
each variable and observation; the order should correspond to that of |
A Stan program of class brmsmodel
.
library("brms")
data <- read.csv(paste0(system.file("extdata", package = "bgamcar1"), "/data_car1.csv"))
scode <- make_stancode(bf(y ~ ar(time = x)), data)
modify_stancode(scode)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.