{"id":21882959,"url":"https://github.com/ibab/python-mle","last_synced_at":"2025-05-05T14:41:39.926Z","repository":{"id":26435290,"uuid":"29885951","full_name":"ibab/python-mle","owner":"ibab","description":"A Python package for performing Maximum Likelihood Estimates","archived":false,"fork":false,"pushed_at":"2020-05-03T18:27:20.000Z","size":102,"stargazers_count":126,"open_issues_count":24,"forks_count":31,"subscribers_count":12,"default_branch":"master","last_synced_at":"2025-04-26T10:12:01.190Z","etag":null,"topics":[],"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/ibab.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}},"created_at":"2015-01-26T22:50:59.000Z","updated_at":"2025-03-22T21:10:12.000Z","dependencies_parsed_at":"2022-08-29T06:01:05.827Z","dependency_job_id":null,"html_url":"https://github.com/ibab/python-mle","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ibab%2Fpython-mle","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ibab%2Fpython-mle/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ibab%2Fpython-mle/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ibab%2Fpython-mle/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ibab","download_url":"https://codeload.github.com/ibab/python-mle/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252516106,"owners_count":21760725,"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":[],"created_at":"2024-11-28T09:38:04.132Z","updated_at":"2025-05-05T14:41:39.909Z","avatar_url":"https://github.com/ibab.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# python-mle\n\n[![Build Status](https://travis-ci.org/ibab/python-mle.svg?branch=master)](https://travis-ci.org/ibab/python-mle)\n\nA Python package for performing Maximum Likelihood Estimates.\n\nInspired by [RooFit](https://root.cern.ch/drupal/content/roofit) and [pymc](https://github.com/pymc-devs/pymc).\n\nmle is a Python framework for constructing probability models and estimating their parameters from data using the [Maximum Likelihood](http://en.wikipedia.org/wiki/Maximum_likelihood) approach.\nWhile being less flexible than a full Bayesian probabilistic modeling framework, it can handle larger datasets (\u003e 10^6 entries) and more complex statistical models.\n\nTo achieve maximum performance, this package (like pymc) uses [Theano](http://deeplearning.net/software/theano/tutorial/) to optimize and compile statistical models.\nThis also means that models can automatically be evaluated using multiple CPU cores or GPUs.\nDerivatives used for the likelihood optimization are calculated using automatic differentiation.\n\nCurrently, the package is only a basic prototype and will change heavily in the future.\n\n## Example\n\n```python\nimport numpy as np\nfrom mle import *\n\n# Define model\nx = var('x', observed=True, vector=True)\ny = var('y', observed=True, vector=True)\n\na = var('a')\nb = var('b')\nsigma = var('sigma')\n\nmodel = Normal(y, a * x + b, sigma)\n\n# Generate data\nxs = np.linspace(0, 2, 20)\nys = 0.5 * xs + 0.3 + np.random.normal(0, 0.1, 20)\n\n# Fit model to data\nresult = model.fit({'x': xs, 'y': ys}, {'a': 1, 'b': 1, 'sigma': 1})\nprint(result)\n```\n\n```\nOptimization terminated successfully.\n         Current function value: -21.632165\n         Iterations: 25\n         Function evaluations: 38\n         Gradient evaluations: 38\n   status: 0\n  success: True\n     njev: 38\n     nfev: 38\n hess_inv: array([[  1.55949709e-04,  -2.06891597e-06,   4.52439923e-06],\n       [ -2.06891597e-06,   8.94222021e-04,  -8.85856496e-04],\n       [  4.52439923e-06,  -8.85856496e-04,   1.21017793e-03]])\n      fun: -21.632165325132977\n        x: {'a': 0.44739489680783401, 'b': 0.31133017710324606, 'sigma': 0.082040126713057424}\n  message: 'Optimization terminated successfully.'\n      jac: array([ -8.72776888e-07,   5.92010624e-08,   8.06620475e-08])\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fibab%2Fpython-mle","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fibab%2Fpython-mle","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fibab%2Fpython-mle/lists"}