| logLik.mvgam | R Documentation |
mvgam objectsCompute pointwise Log-Likelihoods from fitted mvgam objects
## S3 method for class 'mvgam'
logLik(object, linpreds, newdata, family_pars, include_forecast = TRUE, ...)
object |
|
linpreds |
Optional |
newdata |
Optional |
family_pars |
Optional |
include_forecast |
Logical. If |
... |
Ignored |
A matrix of dimension n_samples x n_observations containing the pointwise
log-likelihood draws for all observations in newdata. If no newdata is supplied,
log-likelihood draws are returned for all observations that were originally fed to
the model (training observations and, if supplied to the
original model via the newdata argument in mvgam,
testing observations)
## Not run:
# Simulate some data and fit a model
simdat <- sim_mvgam(n_series = 1, trend_model = 'AR1')
mod <- mvgam(y ~ s(season, bs = 'cc', k = 6),
trend_model = AR(),
data = simdat$data_train,
burnin = 300,
samples = 300,
chains = 2)
# Extract logLikelihood values
lls <- logLik(mod)
str(lls)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.