https://github.com/epiverse-trace/quickfit
[SUSPENDED] Toolbox of model fitting helper functions
https://github.com/epiverse-trace/quickfit
distributions likelihood mle r r-package
Last synced: 3 months ago
JSON representation
[SUSPENDED] Toolbox of model fitting helper functions
- Host: GitHub
- URL: https://github.com/epiverse-trace/quickfit
- Owner: epiverse-trace
- License: other
- Created: 2023-01-12T16:52:52.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-08-07T14:47:08.000Z (about 1 year ago)
- Last Synced: 2024-08-08T15:47:09.104Z (about 1 year ago)
- Topics: distributions, likelihood, mle, r, r-package
- Language: R
- Homepage: https://epiverse-trace.github.io/quickfit/
- Size: 4.6 MB
- Stars: 2
- Watchers: 4
- Forks: 1
- Open Issues: 8
-
Metadata Files:
- Readme: README.Rmd
- License: LICENSE
Awesome Lists containing this project
README
---
output: github_document
---```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```# _quickfit_: Toolbox of model fitting helper functions
[](https://opensource.org/licenses/MIT)
[](https://github.com/{{ gh_repo }}/actions/workflows/R-CMD-check.yaml)
[](https://app.codecov.io/gh/{{ gh_repo }}?branch=main)
[](https://www.repostatus.org/#suspended)`{quickfit}` was intended to be an `R` package to help with simple model fitting tasks in epidemiology and as a central place to store helper functions used in Epiverse-TRACE.
The development of `{quickfit}` has been **suspended** it is no longer considered necessary to have a dedicated package within Epiverse-TRACE to conduct model fitting, and helper functions will remain in the package they were developed in and shared/copied directly across packages rather than requiring taking on a dependency to import them. Development may resume if the need for a utility package becomes apparent.
`{quickfit}` was developed at the [Centre for the Mathematical Modelling of Infectious Diseases](https://www.lshtm.ac.uk/research/centres/centre-mathematical-modelling-infectious-diseases) at the London School of Hygiene and Tropical Medicine as part of the [Epiverse Initiative](https://data.org/initiatives/epiverse/).
## Installation
You can install the development version of {{ packagename }} from
[GitHub](https://github.com/) with:``` r
# check whether {pak} is installed
if(!require("pak")) install.packages("pak")
pak::pak("epiverse-trace/quickfit")
```## Quick start
**The examples below show the existing functionality; this is not currently planned to be developed further.**
These examples illustrate some of the current functionalities:
```{r}
library(quickfit)
```Generate some simulated data, define a likelihood, then estimate MLE,
or MLE and 95% confidence interval based on profile likelihood:```{r}
sim_data <- rnorm(50, 4, 2)# Define likelihood function
log_l <- function(x,a,b) dnorm(x, a, b, log = TRUE)# Estimate MLE
estimate_mle(log_l, sim_data, n_param = 2, a_initial = 3, b_initial = 1)# Estimate 95% CI based on profile likelihood
calculate_profile(
log_l,
data_in = sim_data,
n_param = 2,
a_initial = 3,
b_initial = 1,
precision = 0.01
)
```Additionally, multiple distribution models can be compared (for censored and
non-censored data).```{r}
multi_fitdist(
data = rlnorm(n = 100, meanlog = 1, sdlog = 1),
models = c("lnorm", "gamma", "weibull"),
func = fitdistrplus::fitdist
)
```## Help
To report a bug please open an [issue](https://github.com/epiverse-trace/quickfit/issues/new/choose); please note that development on `{quickfit}` has been suspended, therefore it is not guaranteed that all issues will be responded to.
### Contributions
Contributions are welcome via [pull requests](https://github.com/{{ gh_repo }}/pulls).
Development on `{quickfit}` has been suspended.
However, if you think this package could be developed for a specific use case then contributions are very welcome as issues, or on the main [Epiverse Discussion board](https://github.com/orgs/epiverse-trace/discussions).
### Code of Conduct
Please note that the {{ packagename }} project is released with a
[Contributor Code of Conduct](https://github.com/epiverse-trace/.github/blob/main/CODE_OF_CONDUCT.md).
By contributing to this project, you agree to abide by its terms.