{"id":26496725,"url":"https://github.com/lilyreber/cfinversion","last_synced_at":"2026-05-18T08:07:15.283Z","repository":{"id":264668204,"uuid":"890500505","full_name":"lilyreber/cfinversion","owner":"lilyreber","description":"Python package for characteristic functions inversion","archived":false,"fork":false,"pushed_at":"2025-02-21T17:13:20.000Z","size":3191,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-25T13:44:39.521Z","etag":null,"topics":["characteristic-functions","numerical-methods","python","statistics"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lilyreber.png","metadata":{"files":{"readme":"README.md","changelog":null,"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}},"created_at":"2024-11-18T17:14:15.000Z","updated_at":"2025-02-23T16:24:15.000Z","dependencies_parsed_at":"2025-01-09T20:27:41.609Z","dependency_job_id":"9ab4a7d7-5197-4fd9-9a7a-4854621d8aab","html_url":"https://github.com/lilyreber/cfinversion","commit_stats":null,"previous_names":["lilyreber/numerical-inversion-of-characteristic-functions","lilyreber/cfinversion"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/lilyreber/cfinversion","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lilyreber%2Fcfinversion","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lilyreber%2Fcfinversion/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lilyreber%2Fcfinversion/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lilyreber%2Fcfinversion/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lilyreber","download_url":"https://codeload.github.com/lilyreber/cfinversion/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lilyreber%2Fcfinversion/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33170447,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-18T05:43:36.989Z","status":"ssl_error","status_checked_at":"2026-05-18T05:43:19.133Z","response_time":71,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["characteristic-functions","numerical-methods","python","statistics"],"created_at":"2025-03-20T12:42:13.420Z","updated_at":"2026-05-18T08:07:15.279Z","avatar_url":"https://github.com/lilyreber.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Characteristic functions inversion package\n[![Tests](https://github.com/lilyreber/Numerical-inversion-of-characteristic-functions/actions/workflows/python-package.yml/badge.svg)](https://github.com/lilyreber/Numerical-inversion-of-characteristic-functions/actions/workflows/python-package.yml)\n![GitHub License](https://img.shields.io/github/license/lilyreber/Numerical-inversion-of-characteristic-functions)\n\n\nThe characteristic function is the Fourier transform of a random variable distribution. One of the ways to define the distribution law is to define a characteristic function. In many probabilistic models, only the characteristic functions are available to us, and not the densities themselves, which complicates the modeling process and the evaluation of numerical characteristics. The reconstruction of the distribution function or density of a random variable by its characteristic function by analytical methods is often an extremely difficult task, therefore it is necessary to resort to the use of numerical methods.\n\n\n\n## Installation\n\nClone the repository:\n\n```bash\ngit clone https://github.com/lilyreber/Numerical-inversion-of-characteristic-functions.git\n```\n\nInstall dependencies:\n\n```bash\npoetry install\n```\n\n## Usage example\n```python\nimport numpy as np\nimport matplotlib.pyplot as plt\n\nimport CFInvert.CharFuncInverter.Bohman.BohmansInverters as bi\nfrom CFInvert.Distributions.uniform import Unif \nfrom CFInvert.Standardizer import Standardizer\n\n# Uniform distribution parameters\na = -100\nb = 20\nunif_distr = Unif(a, b)\n\n# Create an array of points for plotting\nt = np.linspace(-200, 200, 1000)\n\n# Calculate the exact distribution function for uniform distribution \nunif_cdf = unif_distr.cdf(t)\n\n# Standardization of a random variable\nm = (a + b) / 2  # Expectation\nvar = ((b - a) ** 2) / 12  # Variance\nst = Standardizer(m=m, sd=(var**0.5))\n\n# The characteristic function of a standardized random variable\nz_chr = st.standardize_chf(unif_distr.chr)\n\n# Initialization and configuration of the inverter (Bohmann method)\ninverter = bi.BohmanE(N=1e3)\ninverter.fit(z_chr)\n\n# Approximate distribution function for a standardized random variable\napprox_z_cdf = inverter.cdf\n\n# Approximate distribution function for the initial random variable\napprox_cdf = st.unstandardize_cdf(approx_z_cdf)\napprox_cdf_values = approx_cdf(t)\n\n# Plotting graphs\nplt.figure(figsize=(10, 6))\nplt.plot(t, unif_cdf, label=\"The exact distribution function\", linewidth=2, color=\"blue\")\nplt.plot(t, approx_cdf_values, label=\"Approximate distribution function\", linestyle=\"--\", linewidth=2, color=\"red\")\n\nplt.title(\"Comparison of exact and approximate distribution functions\", fontsize=16)\nplt.xlabel(\"x\", fontsize=14)\nplt.ylabel(\"F(x)\", fontsize=14)\nplt.legend(fontsize=12)\nplt.grid(True, linestyle=\"--\", alpha=0.7)\nplt.axvline(x=a, color=\"green\", linestyle=\":\", label=f\"a = {a}\")\nplt.axvline(x=b, color=\"purple\", linestyle=\":\", label=f\"b = {b}\")\nplt.legend(fontsize=12)\nplt.tight_layout()\n\nplt.show()\n```\n![example](examples/plots/uniform.png)\n\n## Requirements\n\n- python 3.10+\n- numpy 2.2.0+\n- scipy 1.15.0+\n- matplotlib 3.9.3+\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flilyreber%2Fcfinversion","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flilyreber%2Fcfinversion","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flilyreber%2Fcfinversion/lists"}