Description Usage Arguments Value Examples
This implements generalized additive models (GAMs) via the basis functions available in the splines and splines2 packages. For example, you can use bs(), ns(), cSpline(), iSpline(), mSpline(), or the base R function poly() to generate basis functions for the variables intended for non-linear modeling. The basis functions are regularized using a hierarchical prior where the shrinkage parameter for each predictor is given a DuMouchel's prior. Note that predictor specific means for each variable represented by a basis function of n terms, all n terms share a shrinkage parameter. This is standard procedure for GAMs.
1 2 3 |
formula |
the model formula |
data |
a data frame |
family |
one of "gaussian", "st" (Student-t with nu=3), "binomial", or "poisson". |
log_lik |
Should the log likelihood be monitored? The default is FALSE. |
iter |
How many post-warmup samples? Defaults to 4000. |
warmup |
How many warmup samples? Defaults to 1000. |
adapt |
How many adaptation steps? Defaults to 1000. |
chains |
How many chains? Defaults to 4. |
thin |
Thinning interval. Defaults to 1. |
method |
Defaults to "rjparallel". Otherwise, "rjags" (single core run). |
cl |
Use parallel::makeCluster(# clusters) to specify clusters for the parallel methods. Defaults to two cores. |
... |
Other arguments to run.jags. |
df |
degrees of freedom for prior. |
s |
The desired prior scale. Defaults to 1. Is automatically squared within the model so select a number here on the standard deviation scale. |
A run.jags object
1 | gamBayes()
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.