{"id":13666087,"url":"https://github.com/masspastore/overlapping","last_synced_at":"2025-04-26T12:30:54.445Z","repository":{"id":201586418,"uuid":"142033559","full_name":"masspastore/overlapping","owner":"masspastore","description":"Estimation of Overlapping in Empirical Distributions.","archived":false,"fork":false,"pushed_at":"2019-10-17T09:40:57.000Z","size":749,"stargazers_count":8,"open_issues_count":2,"forks_count":3,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-04-22T08:44:56.403Z","etag":null,"topics":["package","r"],"latest_commit_sha":null,"homepage":"","language":"TeX","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/masspastore.png","metadata":{"files":{"readme":"README.md","changelog":"NEWS","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2018-07-23T15:28:15.000Z","updated_at":"2025-02-22T01:03:27.000Z","dependencies_parsed_at":null,"dependency_job_id":"a9d020a3-e33f-4135-a99f-ec5b72dbb701","html_url":"https://github.com/masspastore/overlapping","commit_stats":null,"previous_names":["masspastore/overlapping"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/masspastore%2Foverlapping","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/masspastore%2Foverlapping/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/masspastore%2Foverlapping/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/masspastore%2Foverlapping/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/masspastore","download_url":"https://codeload.github.com/masspastore/overlapping/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250986268,"owners_count":21518480,"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":["package","r"],"created_at":"2024-08-02T06:00:57.684Z","updated_at":"2025-04-26T12:30:54.028Z","avatar_url":"https://github.com/masspastore.png","language":"TeX","funding_links":[],"categories":["TeX","R"],"sub_categories":[],"readme":"# overlapping\n### Estimation of Overlapping in Empirical Distributions\n\nOverlapping can be defined as the area intersected by two or more probability density functions. The main idea of this package is to offer an easy way to quantify the similarity (or the difference) between two or more empirical distributions by using the overlap between their kernel density estimates.\n\n# Set up\n\nTo install this github version type in R:\n\n```{r}\n# if devtools is not installed yet: \n# install.packages( \"devtools\" )  \nlibrary( devtools )\ninstall_github( \"masspastore/overlapping\" )\n```\n\n# Main function\n\nThe main function, **overlap**, provides an approximation of the overlapping area of two or more kernel density estimations from empirical data.\n\n* **overlap**\n    + Input: a list of numerical vectors to be compared; each vector is an element of the list.\n    + Output: a data frame with information used for computing overlapping (only for graphical purposes) and estimated overlapped areas relative to each couple of distributions.\n     \n### Note\n\nThe function `overlap()` calls the `density()` function for computing kernel density estimates. Consequently, the estimation of overlapping area depends on method used in this latter function. The algorithm used in `density.default` disperses the mass of the empirical distribution function over a regular grid of at least 512 points and then uses the fast Fourier transform to convolve this approximation with a discretized version of the kernel and then uses linear approximation to evaluate the density at the specified points (see `help(density)` for details).\n\n# Examples\n\n```{r,results=\"markup\"}\nset.seed( 20150605 )\n\n### EXAMPLE 1\n# creating a list with three different empirical distributions\nx \u003c- list( X1 = rnorm(100), X2 = rt(50,8), X3 = rchisq(80,2) )\n\nout \u003c- overlap( x, plot = TRUE )\nout$OV # estimated overlapped areas \n\n### EXAMPLE 2\n# simulate eight random samples\ndataList \u003c- list()\nfor (j in 1:8) dataList \u003c- c(dataList, list(rnorm(30)))\n\nOV \u003c- overlap(dataList) # compute overlapping for all pairs\nhead(OV$DD) # see the first rows of this data set\ntable(OV$DD$k)        # k indicates the pairs\n\n# plot all pairs\nggplot(OV$DD, aes(x,y1))+facet_wrap(~k)+geom_ribbon(aes(ymin=0,ymax=y1),alpha=.3,fill=\"red\")+\n  geom_ribbon(aes(ymin=0,ymax=y2),alpha=.3,fill=\"blue\")+xlab(\"\")+ylab(\"\")\n\n# choose a single pair to be represented\nK \u003c- \"Y1-Y2\" \ndata \u003c- subset(OV$DD, k==K) # create a subset \n\n# plot it\nggplot(data, aes(x,y1))+geom_ribbon(aes(ymin=0,ymax=y1),alpha=.3,fill=\"red\")+\n  geom_ribbon(aes(ymin=0,ymax=y2),alpha=.3,fill=\"blue\")+\n  ggtitle(paste0(\"Overlap Y1-Y2 = \",round(OV$OV[K]*100,2),\"%\"))+xlab(\"\")+ylab(\"\")\n```\n\n### Support/Bug Reports\n\nUsers may contact the author at `massimiliano.pastore[at]unipd.it` for support or to report issues.\n\n# References\n\nPastore, M. (2018). Overlapping: a R package for Estimating Overlapping in Empirical Distributions. The Journal of Open Source Software, 3 (32), 1023. URL: https://doi.org/10.21105/joss.01023\n\nPastore, M., Calcagnì, A. (2019). Measuring Distribution Similarities Between Samples: A Distribution-Free Overlapping Index. Frontiers in Psychology, 10:1089. URL: https://doi.org/10.3389/fpsyg.2019.01089\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmasspastore%2Foverlapping","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmasspastore%2Foverlapping","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmasspastore%2Foverlapping/lists"}