Description Usage Arguments Details Value See Also
Fit a Bayesian semiparametric model that includes subject-specific curves.
1 2 3 4 5 6 7 8 9 10 11 12 |
fixed |
A formula y ~ x1 + x2 ... specifying the response and fixed effects. This routine looks up the variable from the data, before looking at the environment where the formula is defined. |
data |
A data frame with at least three columns ( |
spline |
A list of formulae of splines s(x, by =, ...). This routine looks up the variable from the data, before looking at the environment where the formula is defined. See [s()] for more details. |
random |
A formula ~ u1 specifying the random effect term. Only one random effect is allowed at the moment. In the future, this argument might take a list of fomulae (so each formula corresponds to a random effect), or implement something like nlme::lme or lme4::lmer. |
size |
The number of samples to be drawn from the posterior. |
burn |
The number of samples to burn before recording. Default to
one-tenth of |
ridge |
Use ridge regression or linear mixed effect models? |
init |
List of matrices of the coefficients, containing |
prior |
List of hyperparameters of the covariance priors. |
This model is fitted in a Bayesian framework, that is, this routine gives the
samples drawing from the posterior distribution associated to each regression
coefficients. The population (mean) curves are penalised with a difference
matrix of order deg + 1
. The knots are equally spaced between
range(data$x)
.
The intercepts for all splines, other than the subject-specific splines, are removed by default. This is to ensure that the intercept term in the spline is not spanning the same space as the (potential) main effect terms (and consequently having an unidentifiable model). For subject-specific splines, since all the coefficients are penalised, including an intercept will not result in an unidentifiable model.
Therefore, the intercept should be added manually either by setting 'intercept = TRUE' or adding it as fixed effects.
A list with posterior means, samples and information of the basis functions.
[s()] for spline specification.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.