View source: R/tef_fitAll2brms.R
tef_fitAll2brms | R Documentation |
This method has been superceded by TEbrm
. Please use
that method instead.
tef_fitAll2brms(
TEs3s,
fixef = NA,
nIter = 2000,
nChains = 3,
nCores = 2,
errFun = NA,
prior_dispersion = 2
)
TEs3s |
TEfitAll model |
fixef |
Parameters vary as random effects by the TEs3s grouping variable. However, if you have main effects (e.g., group differences), enter them as a data frame here. |
nIter |
number of iterations |
nChains |
number of chains |
nCores |
number of cores |
errFun |
the error function to use. Defaults to the same as the TEfitAll model, if possible. |
prior_dispersion |
This number, multiplied by the SD of each TEfitAll parameter, is used as the prior SD for that parameter. |
Passes a TEfitAll
model to [nonlinear mixed-effects Bayesian] fitting using
brms-package
. Note that, due to the extensive time needed to
fit brms-package
models,
this function is less tested than most functions in the TEfits
package. Functionality is
experimental.
Priors for nonlinear parameters are informed by the distributions of parameters in the TEfitAll
object [models].
However, any fixed effects should be minimally influenced by these priors
TEfitAll
bernoulli
models are fit using either bernoulli
or Beta
response
distributions in brms
depending on whether the TEfitAll
distrIibution is
binary. TEfitAll
logcosh
models are fit using a asym_laplace
response distribution
in brms predicting the .5 quantile.
If sampling issues occur, increased number of iterations are recommended. Also, running one chain at a time
may help; these models should later be merged using brms::combine_models()
.
A brms-package
nonlinear mixed-effects model object.
Under development. Partial functionality.
## Not run:
dat <- anstrain
dat$condition <- rep(c('A','B'),each=500)
# Model with time and one categorical fixed effect
mod_tef <- TEfitAll(dat[,c('acc','trialNum')], groupingVar = dat$subID)
mod_brm <- tef_fitAll2brms(mod_tef,nChains=1,fixef=data.frame(condition=dat$condition))
# Model with time, one categorical fixed effect, and one by-groupingVar (subID) random slope
dat$absRat <- scale(abs(dat$ratio))
mod_tef <- TEfitAll(dat[,c('acc','trialNum',"absRat")], groupingVar = dat$subID,covarTerms=list(pRate=c(F)))
mod_brm <- tef_fitAll2brms(mod_tef,nChains=1,fixef=data.frame(condition=dat$condition))
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.