{"id":22852935,"url":"https://github.com/vgherard/fcci","last_synced_at":"2025-04-30T09:21:22.078Z","repository":{"id":56934261,"uuid":"353066591","full_name":"vgherard/fcci","owner":"vgherard","description":"Feldman-Cousins Confidence Intervals","archived":false,"fork":false,"pushed_at":"2022-01-08T20:02:23.000Z","size":136,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-20T09:55:39.006Z","etag":null,"topics":["confidence-intervals","physics","r","statistics"],"latest_commit_sha":null,"homepage":"https://vgherard.github.io/fcci","language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vgherard.png","metadata":{"files":{"readme":"README.Rmd","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-03-30T16:22:50.000Z","updated_at":"2023-03-03T23:16:03.000Z","dependencies_parsed_at":"2022-08-21T00:40:30.778Z","dependency_job_id":null,"html_url":"https://github.com/vgherard/fcci","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vgherard%2Ffcci","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vgherard%2Ffcci/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vgherard%2Ffcci/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vgherard%2Ffcci/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vgherard","download_url":"https://codeload.github.com/vgherard/fcci/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251674984,"owners_count":21625716,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["confidence-intervals","physics","r","statistics"],"created_at":"2024-12-13T06:09:59.348Z","updated_at":"2025-04-30T09:21:22.024Z","avatar_url":"https://github.com/vgherard.png","language":"R","funding_links":[],"categories":[],"sub_categories":[],"readme":"---\noutput: github_document\n---\n\n\u003c!-- README.md is generated from README.Rmd. Please edit that file --\u003e\n\n```{r, include = FALSE}\nknitr::opts_chunk$set(\n  collapse = TRUE,\n  comment = \"#\u003e\",\n  fig.path = \"man/figures/README-\",\n  out.width = \"100%\"\n)\n```\n\n# fcci\n\n\u003c!-- badges: start --\u003e\n[![Project Status: Active – The project has reached a stable, usable state and is being actively developed.](https://www.repostatus.org/badges/latest/active.svg)](https://www.repostatus.org/#active)\n[![R-CMD-check](https://github.com/vgherard/fcci/workflows/R-CMD-check/badge.svg)](https://github.com/vgherard/fcci/actions)\n[![Codecov test coverage](https://codecov.io/gh/vgherard/fcci/branch/master/graph/badge.svg)](https://app.codecov.io/gh/vgherard/fcci?branch=master)\n[![CRAN status](https://www.r-pkg.org/badges/version/fcci)](https://CRAN.R-project.org/package=fcci)\n[![R-universe status](https://vgherard.r-universe.dev/badges/fcci)](https://vgherard.r-universe.dev/)\n[![Website](https://img.shields.io/badge/Website-here-blue)](https://vgherard.github.io/fcci/)\n[![Tweet](https://img.shields.io/twitter/url/http/shields.io.svg?style=social)](https://twitter.com/intent/tweet?text={fcci}: Feldman-Cousins Confidence Intervals in R\u0026url=https://vgherard.github.io/r2r\u0026via=ValerioGherardi\u0026hashtags=rstats,statistics,physics,confidenceintervals)\n\u003c!-- badges: end --\u003e\n\n`fcci` is an R package providing support for building [Feldman-Cousins](https://doi.org/10.1103/PhysRevD.57.3873) confidence \nintervals.\n\n## Motivation\n\nThe Feldman-Cousins construction was originally developed in the context of \nHigh-Energy Physics, as a consistent method for building classical (frequentist) confidence intervals for Poisson rates of rare events. In experiments which expect only few events, it is often the case that the number of observed events is actually zero or, more generally, lower than the expected number of spurious background events (if the latter is significantly larger than zero). \n\nIn these situations, classical central intervals (such as those produced by `stats::poisson.test()`) are not satisfying, as they can lead both to significant overcoverage and to non-physical negative rates in the presence of a non-negligible background. Moreover, a naive special treatment of boundary values, which chooses to report an upper limit or a confidence interval depending on the data (the so-called [\"flip-flopping\" policy](https://doi.org/10.1103/PhysRevD.57.3873)), can lead to undercoverage.\n\nFeldman and Cousins provide a unified treatment of boundary and regular values, by explicitly constructing the [Neyman confidence belt](https://en.wikipedia.org/wiki/Neyman_construction) for physical rates, using an ordering for count values based on a likelihood ratio.\n\n## Installation\n\nYou can install the latest release of `fcci` from [CRAN](https://CRAN.R-project.org/package=fcci) using:\n\n``` r\ninstall.packages(\"fcci\")\n```\n\nand the development version from [my R-universe](https://vgherard.r-universe.dev/) with:\n\n``` r\ninstall.packages(\"fcci\", repos = \"https://vgherard.r-universe.dev/\")\n```\n## Example\n\n```{r}\nlibrary(fcci)\n```\n\nTo compute a confidence interval for, e.g., a Poisson rate, use:\n\n```{r}\n# 95% C.L. interval for n = 10 events and b = 2 expected background events\nconfint_pois(n = 10, b = 2, cl = 0.95)\n```\n\nLet us compare the 68% C.L. intervals for $n=0$ events and no background \nobtained from `fcci` and from `stats::poisson.test()` \n\n```{r}\nconfint_pois(n = 0, cl = 0.68)\nstats::poisson.test(0, conf.level = 0.68, alternative = \"two.sided\")$conf.int\n```\n\nNotice that the latter is significantly larger, and it corresponds in fact to\nan 84% C.L. *upper limit* on the rate:\n\n```{r}\nstats::poisson.test(0, conf.level = 0.84, alternative = \"less\")$conf.int\n```\n\n## Getting Help\n\nFor further help, you can consult the reference page of the `fcci` [website](https://vgherard.github.io/fcci/) or [open an issue](https://github.com/vgherard/fcci/issues) on the GitHub repository of `fcci`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvgherard%2Ffcci","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvgherard%2Ffcci","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvgherard%2Ffcci/lists"}