predict.poisson_rt | R Documentation |
Given an object of class poisson_rt
produced with estimate_rt()
,
calculate predicted observed cases for the estimated Rt values.
Note: This function is not intended for "new x" or to produce forecasts, but
rather to examine how Rt relates to observables.
## S3 method for class 'poisson_rt'
predict(object, lambda = NULL, ...)
object |
An object of class |
lambda |
Select which lambdas from the object to use. If not provided (the default), all are returned. Note that new lambdas not originally used in the estimation procedure may be provided, but the results will be calculated by linearly interpolating the estimated Rt's. |
... |
Not used. |
A vector or matrix of predicted case counts.
y <- c(1, rpois(100, dnorm(1:100, 50, 15) * 500 + 1))
out <- estimate_rt(y, nsol = 10)
preds <- predict(out)
plot(y)
matlines(preds, lty = 1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.