Description Usage Arguments Value Notes Examples

View source: R/NobBS_stratified.R

Produces nowcasts stratified by a single variable of interest, e.g. by geographic unit (province/state/region) or by age group.

1 2 3 4 5 6 7 | ```
NobBS.strat(data, now, units, onset_date, report_date, strata,
moving_window = NULL, max_D = NULL, cutoff_D = NULL,
quiet = TRUE, proportion_reported = 1, specs = list(dist =
c("Poisson", "NB"), alpha1.mean.prior = 0, alpha1.prec.prior = 0.001,
alphat.shape.prior = 0.001, alphat.rate.prior = 0.001, beta.priors =
NULL, param_names = NULL, conf = 0.95, dispersion.prior = NULL, nAdapt =
1000, nChains = 1, nBurnin = 1000, nThin = 1, nSamp = 10000))
``` |

`data` |
A time series of reporting data in line list format (one row per case), with a column |

`now` |
An object of datatype |

`units` |
Time scale of reporting. Options: "1 day", "1 week". |

`onset_date` |
In quotations, the name of the column of datatype |

`report_date` |
In quotations, the name of the column of datatype |

`strata` |
In quotations, the name of the column indicating the stratifying variable. |

`moving_window` |
Size of moving window for estimation of cases (numeric). The moving window size should be specified in the same date units as the reporting data (i.e. specify 7 to indicate 7 days, 7 weeks, etc). Default: NULL, i.e. takes all historical dates into consideration. |

`max_D` |
Maximum possible delay observed or considered for estimation of the delay distribution (numeric). Default: (length of unique dates in time series)-1 ; or, if a moving window is specified, (size of moving window)-1 |

`cutoff_D` |
Consider only delays d<= |

`quiet` |
Suppress all output and progress bars from the JAGS process. Default: TRUE. |

`proportion_reported` |
A decimal greater than 0 and less than or equal to 1 representing the proportion of all cases expected to be reported. Default: 1, e.g. 100 percent of all cases will eventually be reported. For asymptomatic diseases where not all cases will ever be reported, or for outbreaks in which severe under-reporting is expected, change this to less than 1. |

`specs` |
A list with arguments specifying the Bayesian model used: |

The function returns a list with the following elements: `estimates`

, a 5-column data frame containing estimates for each date in the window of predictions (up to "now") with corresponding date of case onset, lower and upper bounds of the prediction interval, and the number of cases for that onset date reported up to 'now'; `estimates.inflated`

, a Tx4 data frame containing estimates inflated by the proportion_reported for each date in the time series (up to "now") with corresponding date of case onset, lower and upper bounds of the prediction interval, and the number of cases for that onset date reported up to 'now'; `nowcast.post.samples`

, vector of 10,000 samples from the posterior predictive distribution of the nowcast, and `params.post`

, a 10,000xN dataframe containing 10,000 posterior samples for the "N" parameters specified in specs[["param_names"]]. See McGough et al. 2019 (https://www.biorxiv.org/content/10.1101/663823v1) for detailed explanation of parameters.

'NobBS' requires that JAGS (Just Another Gibbs Sampler) is downloaded to the system. JAGS can be downloaded at <http://mcmc-jags.sourceforge.net/>.

1 2 3 4 5 6 7 |

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.