logLik.JMbayes {JMbayes} | R Documentation |
Log-Likelihood for Joint Models
Description
Computes the log-likelihood for a fitted joint model.
Usage
## S3 method for class 'JMbayes'
logLik(object, thetas, b, priors = TRUE, marginal.b = TRUE,
marginal.thetas = FALSE, full.Laplace = FALSE, useModes = TRUE, ...)
Arguments
object |
an object inheriting from class |
thetas |
a list with values for the joint model's parameters. This should have the same structure as
the |
b |
a numeric matrix with random effects value. This should have the same structure as
the |
priors |
logical, if |
marginal.b |
logical, if |
marginal.thetas |
logical, if |
full.Laplace |
logical, if |
useModes |
logical, if |
... |
extra arguments; currently none is used. |
Details
Let denote the vectors of longitudinal responses,
the observed event time, and
the event indicator for subject
(
). Let also
denote the probability
density function (pdf) for the linear mixed model,
the pdf for the survival submodel, and
the multivariate normal pdf for the random effects, where
denotes the full parameter vector. Then,
if
priors = TRUE
, and marginal.b = TRUE
, function logLik()
computes
where denotes the prior distribution for the parameters. If
priors = FALSE
the prior is excluded from the
computation, i.e.,
and when
marginal.b = FALSE
, then the conditional on the random effects log-likelihood is computed, i.e.,
when
priors = TRUE
and
when priors = FALSE
.
Value
a numeric scalar of class logLik
with the value of the log-likelihood. It also has
the attributes df
the number of parameter (excluding the random effects), and nobs
the number of subjects.
Author(s)
Dimitris Rizopoulos d.rizopoulos@erasmusmc.nl
References
Rizopoulos, D., Hatfield, L., Carlin, B. and Takkenberg, J. (2014). Combining dynamic predictions from joint models for longitudinal and time-to-event data using Bayesian model averaging. Journal of the American Statistical Association. to appear.
See Also
Examples
## Not run:
lmeFit <- lme(log(serBilir) ~ ns(year, 2), data = pbc2,
random = ~ ns(year, 2) | id)
survFit <- coxph(Surv(years, status2) ~ 1, data = pbc2.id, x = TRUE)
jointFit <- jointModelBayes(lmeFit, survFit, timeVar = "year")
logLik(jointFit)
logLik(jointFit, priors = FALSE)
logLik(jointFit, marginal.b = FALSE)
## End(Not run)