| forecast.lfq_fit | R Documentation |
Projects lineage frequencies forward in time using the fitted model. Prediction uncertainty is quantified by parametric simulation from the estimated parameter distribution.
## S3 method for class 'lfq_fit'
forecast(
object,
horizon = 28L,
ci_level = 0.95,
n_sim = 1000L,
sampling_noise = TRUE,
effective_n = 100L,
...
)
object |
An |
horizon |
Number of days to forecast. Default 28 (4 weeks). |
ci_level |
Confidence level for prediction intervals. Default 0.95. |
n_sim |
Number of parameter draws for prediction intervals. Default 1000. |
sampling_noise |
Logical; add multinomial sampling noise to
prediction intervals? Default |
effective_n |
Effective sample size for multinomial sampling noise. Default 100, corresponding to a typical weekly sequencing volume per reporting unit. Smaller values produce wider (more conservative) prediction intervals. |
... |
Unused. |
An lfq_forecast object (tibble subclass) with columns:
Date.
Lineage name.
Median predicted frequency.
Lower prediction bound.
Upper prediction bound.
"fitted" or "forecast".
sim <- simulate_dynamics(n_lineages = 3,
advantages = c("A" = 1.2, "B" = 0.8), seed = 1)
fit <- fit_model(sim, engine = "mlr")
fc <- forecast(fit, horizon = 21)
fc
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.