Science Score: 13.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
○.zenodo.json file
-
○DOI references
-
○Academic publication links
-
○Academic email domains
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (15.8%) to scientific vocabulary
Last synced: 10 months ago
·
JSON representation
Repository
Basic Info
- Host: GitHub
- Owner: dajmcdon
- License: other
- Language: R
- Default Branch: main
- Homepage: https://dajmcdon.github.io/rtestim/
- Size: 64 MB
Statistics
- Stars: 6
- Watchers: 3
- Forks: 0
- Open Issues: 0
- Releases: 1
Created over 3 years ago
· Last pushed 11 months ago
Metadata Files
Readme
License
Codeowners
README.Rmd
---
output: github_document
---
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = FALSE,
comment = "#>",
fig.path = "man/figures/README-",
fig.align = "center",
fig.height = 3,
fig.width = 6,
dpi = 300,
out.width = "80%"
)
```
# rtestim
[](https://github.com/dajmcdon/rtestim/actions/workflows/R-CMD-check.yaml)
[](https://CRAN.R-project.org/package=rtestim)
This package uses Poisson likelihood with a trend filtering penalty (a type of
regularized nonparametric regression)
to estimate the effective reproductive number, Rt.
This value roughly says "how many new infections will result from
each new infection today". Values larger than 1 indicate that an
epidemic is growing while those less than 1 indicate decline.
## Installation
You can install the development version of rtestim from
[GitHub](https://github.com/) with:
``` r
# install.packages("remotes")
remotes::install_github("dajmcdon/rtestim")
```
Or the released version on CRAN
``` r
install.packages("rtestim")
```
## Quick example
Here we create some data that "looks" like a typical wave in an epidemic.
Because the model uses regularized regression, we estimate the model
at a range of tuning parameters simultaneously.
```{r plot-data, message=FALSE, fig.align='center'}
set.seed(12345)
library(rtestim)
library(ggplot2)
dat <- data.frame(
Time = 1:101,
incident_cases = c(1, rpois(100, dnorm(1:100, 50, 15) * 500 + 1))
)
ggplot(dat, aes(Time, incident_cases)) +
geom_point(colour = "cornflowerblue") +
theme_bw()
```
We fit the model and visualize the resulting estimated sequences of $R_t$:
```{r full-fit, fig.align='center'}
mod <- estimate_rt(observed_counts = dat$incident_cases, nsol = 20)
plot(mod)
```
The additional parameter `nsol = 20` specifies the number of
tuning parameters for which $R_t$ is estimated. A built in function for
cross-validation can be used to select the tuning parameter.
```{r cv-estimate, fig.align='center'}
mod_cv <- cv_estimate_rt(dat$incident_cases, nsol = 20)
plot(mod_cv, which_lambda = "lambda.1se")
```
Owner
- Name: Daniel McDonald
- Login: dajmcdon
- Kind: user
- Location: Vancouver, BC
- Company: UBC Department of Statistics
- Website: https://dajmcdon.github.io
- Repositories: 9
- Profile: https://github.com/dajmcdon
GitHub Events
Total
- Create event: 4
- Release event: 1
- Issues event: 4
- Delete event: 1
- Issue comment event: 2
- Push event: 28
- Pull request review comment event: 2
- Pull request review event: 2
- Pull request event: 12
Last Year
- Create event: 4
- Release event: 1
- Issues event: 4
- Delete event: 1
- Issue comment event: 2
- Push event: 28
- Pull request review comment event: 2
- Pull request review event: 2
- Pull request event: 12
Packages
- Total packages: 1
-
Total downloads:
- cran 187 last-month
- Total dependent packages: 0
- Total dependent repositories: 0
- Total versions: 1
- Total maintainers: 1
cran.r-project.org: rtestim
Estimate the Effective Reproductive Number with Trend Filtering
- Homepage: https://github.com/dajmcdon/rtestim
- Documentation: http://cran.r-project.org/web/packages/rtestim/rtestim.pdf
- License: MIT + file LICENSE
-
Latest release: 1.0.0
published 12 months ago
Rankings
Dependent packages count: 26.1%
Dependent repos count: 32.1%
Average: 48.1%
Downloads: 86.3%
Maintainers (1)
Last synced:
10 months ago