bnrm | R Documentation |
Neo-normal model using brms
bnrm(
formula,
data,
family = msnburr(),
prior = NULL,
data2 = NULL,
sample_prior = "no",
knots = NULL,
drop_unused_levels = TRUE,
stanvars = NULL,
fit = NA,
save_pars = getOption("brms.save_pars", NULL),
init = NULL,
chains = 4,
iter = 2000,
warmup = floor(iter/2),
thin = 1,
cores = getOption("mc.cores", 1),
threads = getOption("brms.threads", NULL),
opencl = getOption("brms.opencl", NULL),
normalize = getOption("brms.normalize", TRUE),
control = list(adapt_delta = 0.9),
algorithm = getOption("brms.algorithm", "sampling"),
backend = getOption("brms.backend", "rstan"),
future = getOption("future", FALSE),
silent = 1,
seed = NA,
save_model = NULL,
stan_model_args = list(),
file = NULL,
file_compress = TRUE,
file_refit = getOption("brms.file_refit", "never"),
empty = FALSE,
rename = TRUE,
...
)
formula |
An object of class |
data |
An object of class |
family |
the neo-normal distribution as response in regression:msnburr(),msnburr2a(),gmsnburr(),jfst() default argument in family is vectorize=TRUE. if not vectorize, give argument vectorize=FALSE, example:msnburr(vectorize=FALSE) |
prior |
One or more |
data2 |
A named |
sample_prior |
Indicate if draws from priors should be drawn
additionally to the posterior draws. Options are |
knots |
Optional list containing user specified knot values to be used
for basis construction of smoothing terms. See
|
drop_unused_levels |
Should unused factors levels in the data be
dropped? Defaults to |
stanvars |
An optional |
fit |
An instance of S3 class |
save_pars |
An object generated by |
init |
Initial values for the sampler. If |
chains |
Number of Markov chains (defaults to 4). |
iter |
Number of total iterations per chain (including warmup; defaults to 2000). |
warmup |
A positive integer specifying number of warmup (aka burnin)
iterations. This also specifies the number of iterations used for stepsize
adaptation, so warmup draws should not be used for inference. The number
of warmup should not be larger than |
thin |
Thinning rate. Must be a positive integer. Set |
cores |
Number of cores to use when executing the chains in parallel,
which defaults to 1 but we recommend setting the |
threads |
Number of threads to use in within-chain parallelization. For
more control over the threading process, |
opencl |
The platform and device IDs of the OpenCL device to use for
fitting using GPU support. If you don't know the IDs of your OpenCL device,
|
normalize |
Logical. Indicates whether normalization constants should
be included in the Stan code (defaults to |
control |
A named |
algorithm |
Character string naming the estimation approach to use.
Options are |
backend |
Character string naming the package to use as the backend for
fitting the Stan model. Options are |
future |
Logical; If |
silent |
Verbosity level between |
seed |
The seed for random number generation to make results
reproducible. If |
save_model |
Either |
stan_model_args |
A |
file |
Either |
file_compress |
Logical or a character string, specifying one of the
compression algorithms supported by |
file_refit |
Modifies when the fit stored via the |
empty |
Logical. If |
rename |
For internal use only. |
... |
Further arguments passed to Stan.
For |
Fit a neo-normal model that using brm function in brms package.All arguments in this functions follow arguments of brm function, except family
An object of class brmsfit
, which contains the posterior
draws along with many other useful information about the model. Use
methods(class = "brmsfit")
for an overview on available methods.
Achmad Syahrul Choir
Buerkner,P-C (2017). brms: An R Package for Bayesian Multilevel
Models Using Stan. Journal of Statistical Software, 80(1), 1-28.
doi:10.18637/jss.v080.i01
Choir, A. S. (2020). The New Neo-Normal Distributions and their Properties. Disertation. Institut Teknologi Sepuluh Nopember.
Iriawan, N. (2000). Computationally Intensive Approaches to Inference in Neo-Normal Linear Models. Curtin University of Technology.
library(neodistr)
x<-runif(100)
e<-rmsnburr(100,0,1,0.8)
y<-0.5+0.8*x+e
data<-data.frame(y,x)
fit <- bnrm(
y ~ x, data = data,
family = msnburr())
summary(fit)
pp <- posterior_predict(fit)
ppe <- posterior_epred(fit)
loo(fit)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.