{ "info": { "author": "Makoto Okada, Kenji Yamanishi and Naoki Masuda", "author_email": "naoki.masuda@bristol.ac.uk", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Intended Audience :: Science/Research", "License :: OSI Approved :: MIT License", "Programming Language :: Python", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Topic :: Software Development" ], "description": "# exp_mixture_model\nMaximum likelihood estimation and model selection for the exponential mixture model (i.e., mixture of exponential distributions)\n\nWhen you use this code, please cite the following paper:\n\nMakoto Okada, Kenji Yamanishi, Naoki Masuda.\nLong-tailed distributions of inter-event times as mixtures of exponential distributions.\narXiv:19xx.xxxxx\n\n\n\n\n## Installation\n``exp_mixture_model`` is hosted on PyPI. So, one can install it by running\n```python\npip install exp_mixture_model\n```\nIf you want to install from source, clone the exp_mixture_model git repository by running\n```python\ngit clone https://github.com/naokimas/exp_mixture_model.git\n```\n\nThen, navigate to the top-level of the cloned directory and run\n```python\npython setup.py install\n```\n\nYou can test our code by running\n```python\npython setup.py test\n```\n\nIf you use Anaconda, you may install required packages by running\n```python\nconda install --file requirements.txt\n```\n\n## Quick Use\nFit an EMM to data stored in a file (e.g. sample.dat) by running\n```python\npython emmfit.py -f sample.dat -k 10\n```\n- '10' is the initial number of components. \n- 'sample.dat' is provided as part of this package. It is synthetic data that we generated by running\n```python\nfrom emm import generate_emm\nx = generate_emm(1000, 10)\n```\n\nTo select the best model among EMMs with different numbers of components, don't specify 'k' and instead specify the model selection criterion using '-c' as follows.\n```python\npython emmfit.py -f sample.dat -c DNML\n```\n- One can specify either 'marginal_log_likelihood', 'joint_log_likelihood', 'AIC', 'BIC', 'AIC_LVC', 'BIC_LVC', 'NML_LVC', or 'DNML' as the argument of '-c'.\n- Default is 'DNML'. \n\nCheck details of the usage by running\n```python\npython emmfit.py --help\n```\n\n## Usage\nFit an EMM to data by running\n```python\nfrom exp_mixture_model import EMM\nx = [1.5, 2.3, ...] # data can be either a list or numpy array\n#\n# Alternatively, one can load data from a file using numpy as follows.\n#\n# import numpy as np\n# x = np.loadtxt(\"sample.dat\")\n#\nmodel = EMM()\npi, mu = model.fit(x) # estimate the parameters\nmodel.print_result() # print 'k_final' (i.e., the estimated effective number of components) and the estimated parameters\nmodel.plot_survival_probability() # plot the survival probability (= cumulative complementary distribution function) for the estimated EMM and the given data 'x'.\n```\n\nSelect the number of components based on a model selection criterion by running\n```python\nfrom exp_mixture_model import EMMs\nx = [1.5, 2.3, ...]\nemms = EMMs()\nemms.fit(x) # fit EMMs with different values of 'k', i.e., the number of components. The default uses 13 values of 'k'. This process is computationally heavy.\nbest_model = emms.select('DNML') # select the best number of components under the 'DNML' criterion. One can specify either 'marginal_log_likelihood', 'joint_log_likelihood', 'AIC', 'BIC', 'AIC_LVC', 'BIC_LVC', 'NML_LVC', or 'DNML' as the argument of 'emms.select'.\nemms.print_result_table() # print the values of 'k_final', likelihoods, and 'DNML' for each 'k' value\nbest_model.print_result() # print 'k_final' and the estimated parameter values of the selected EMM\n```\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/naokimas/exp_mixture_model", "keywords": "exponential mixture model,model selection,normalized maximum likelihood", "license": "MIT License", "maintainer": "", "maintainer_email": "", "name": "exp-mixture-model", "package_url": "https://pypi.org/project/exp-mixture-model/", "platform": "", "project_url": "https://pypi.org/project/exp-mixture-model/", "project_urls": { "Homepage": "https://github.com/naokimas/exp_mixture_model" }, "release_url": "https://pypi.org/project/exp-mixture-model/1.0.0/", "requires_dist": [ "numpy", "scipy", "pandas", "matplotlib" ], "requires_python": "", "summary": "Maximum likelihood estimation and model selection of EMMs", "version": "1.0.0" }, "last_serial": 4950418, "releases": { "1.0.0": [ { "comment_text": "", "digests": { "md5": "459aa4e09e386940ac9cd064eea49035", "sha256": "304745fbe04a64158b0756c5879f673bb95f4c80ce22c71d5eefdbbac4cec1b5" }, "downloads": -1, "filename": "exp_mixture_model-1.0.0-py3-none-any.whl", "has_sig": false, "md5_digest": "459aa4e09e386940ac9cd064eea49035", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 11245, "upload_time": "2019-03-17T14:42:19", "url": "https://files.pythonhosted.org/packages/47/1c/6c1245beb4fae5b7ccb08f26099962e24537922ec3b430c6251ea86e12ce/exp_mixture_model-1.0.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "7c52161904b68b38531b49b839ac7fd6", "sha256": "2d43d96c70abe36be44e6c40d77f36459a79d9539bf02282c552c563b052f5f2" }, "downloads": -1, "filename": "exp_mixture_model-1.0.0.tar.gz", "has_sig": false, "md5_digest": "7c52161904b68b38531b49b839ac7fd6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11135, "upload_time": "2019-03-17T14:42:21", "url": "https://files.pythonhosted.org/packages/21/84/521daba1ccd2b357580b4bb5c730de54ee72780d3f61b9d854b01e4348f0/exp_mixture_model-1.0.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "459aa4e09e386940ac9cd064eea49035", "sha256": "304745fbe04a64158b0756c5879f673bb95f4c80ce22c71d5eefdbbac4cec1b5" }, "downloads": -1, "filename": "exp_mixture_model-1.0.0-py3-none-any.whl", "has_sig": false, "md5_digest": "459aa4e09e386940ac9cd064eea49035", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 11245, "upload_time": "2019-03-17T14:42:19", "url": "https://files.pythonhosted.org/packages/47/1c/6c1245beb4fae5b7ccb08f26099962e24537922ec3b430c6251ea86e12ce/exp_mixture_model-1.0.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "7c52161904b68b38531b49b839ac7fd6", "sha256": "2d43d96c70abe36be44e6c40d77f36459a79d9539bf02282c552c563b052f5f2" }, "downloads": -1, "filename": "exp_mixture_model-1.0.0.tar.gz", "has_sig": false, "md5_digest": "7c52161904b68b38531b49b839ac7fd6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11135, "upload_time": "2019-03-17T14:42:21", "url": "https://files.pythonhosted.org/packages/21/84/521daba1ccd2b357580b4bb5c730de54ee72780d3f61b9d854b01e4348f0/exp_mixture_model-1.0.0.tar.gz" } ] }