| predict.dynamic_fit | R Documentation |
In-sample fitted values and posterior predictive replicates
## S3 method for class 'dynamic_fit'
predict(
object,
type = c("mean", "response", "prob"),
conditional = FALSE,
probs = c(0.025, 0.5, 0.975),
...
)
object |
A |
type |
|
conditional |
Logical. Leave |
probs |
Quantile probabilities for the summary. Default
|
... |
Unused. |
A list with summary (a data frame, one row per observation) and
draws (the underlying draws matrix, draws x time). For the multinomial
family summary is in long format with one row per observation and
category (columns time, category, observed, ...) and draws is a
draws x time x K array.
sim <- simulate_dynamic_poisson(40, 0.2, 2, seed = 1)
fit <- fit_dynamic_model(sim$y, nsave = 200, nburn = 100, seed = 1)
head(predict(fit)$summary) # posterior of the mean of y
head(predict(fit, type = "response")$summary) # posterior predictive
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.