r descr_models("poisson_reg", "stan")
This engine has no tuning parameters.
Some relevant arguments that can be passed to set_engine()
:
chains
: A positive integer specifying the number of Markov chains. The default is 4.iter
: A positive integer specifying the number of iterations for each chain (including warmup). The default is 2000.seed
: The seed for random number generation. cores
: Number of cores to use when executing the chains in parallel.prior
: The prior distribution for the (non-hierarchical) regression coefficients. The "stan"
engine does not fit any hierarchical terms. prior_intercept
: The prior distribution for the intercept (after centering all predictors). See [rstan::sampling()] and [rstanarm::priors()] for more information on these and other options.
r uses_extension("poisson_reg", "stan", "regression")
library(poissonreg) poisson_reg() %>% set_engine("stan") %>% translate()
Note that the refresh
default prevents logging of the estimation process. Change this value in set_engine()
to show the MCMC logs.
For prediction, the "stan"
engine can compute posterior intervals analogous to confidence and prediction intervals. In these instances, the units are the original outcome. When std_error = TRUE
, the standard deviation of the posterior distribution (or posterior predictive distribution as appropriate) is returned.
The "Fitting and Predicting with parsnip" article contains examples for poisson_reg()
with the "stan"
engine.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.