{ "info": { "author": "James Warner", "author_email": "james.e.warner@nasa.gov", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: Apache Software License", "Operating System :: OS Independent", "Programming Language :: Python :: 2.7" ], "description": "MLMCPy - **M**ulti-**L**evel **M**onte **C**arlo with **Py**thon\n===================================================================\n\nBuild Status Coverage Status\n\nGeneral\n--------\n\nMLMCPy is an open source Python implementation of the Multi-Level Monte Carlo (MLMC) method for uncertainty propagation. Once a user defines their computational model and specifies the uncertainty in the model input parameters, MLMCPy can be used to estimate the expected value of a quantity of interest to within a specified precision. Support is available to perform the required model evaluations in parallel (if mpi4py is installed) and extensions of the MLMC method are provided to calculate more advanced statistics (e.g., covariance, CDFs). \n\nDependencies\n--------------\n\nMLMCPy is intended for use with Python 2.7 and relies on the following packages:\n\n* numpy\n* scipy\n* mpi4py (optional for running in parallel)\n* pytest (optional for running unit tests)\n\nExample Usage\n---------------\n\n```python\n'''\nSimple example of propagating uncertainty through a spring-mass model using MLMC. \nEstimates the expected value of the maximum displacement of the system when the spring \nstiffness is a random variable. See the /examples/spring_mass/from_model/ for more details.\n'''\n\nimport numpy as np\nimport sys\n\nfrom MLMCPy.input import RandomInput\nfrom MLMCPy.mlmc import MLMCSimulator\n\n# Add path for example SpringMassModel to sys path.\nsys.path.append('./examples/spring_mass/from_model/spring_mass')\nimport SpringMassModel\n\n# Step 1 - Define random variable for spring stiffness:\n# Need to provide a sampleable function to create RandomInput instance in MLMCPy\ndef beta_distribution(shift, scale, alpha, beta, size):\n return shift + scale*np.random.beta(alpha, beta, size)\n\nstiffness_distribution = RandomInput(distribution_function=beta_distribution,\n shift=1.0, scale=2.5, alpha=3., beta=2.)\n\n# Step 2 - Initialize spring-mass models. Here using three levels with MLMC.\n# defined by different time steps\nmodel_level1 = SpringMassModel(mass=1.5, time_step=1.0)\nmodel_level2 = SpringMassModel(mass=1.5, time_step=0.1)\nmodel_level3 = SpringMassModel(mass=1.5, time_step=0.01)\nmodels = [model_level1, model_level2, model_level3]\n\n# Step 3 - Initialize MLMC & predict max displacement to specified error (0.1).\nmlmc_simulator = MLMCSimulator(stiffness_distribution, models)\n[estimates, sample_sizes, variances] = mlmc_simulator.simulate(epsilon=1e-1)\n\n```\n\nGetting Started\n----------------\nThe best way to get started with MLMCPy is to take a look at the scripts in the examples/ directory. A simple example of propagating uncertainty through a spring mass system can be found in the ``examples/spring_mass/from_model`` directory. There is a second example that demonstrates the case where a user has access to input-output data from multiple levels of models (rather than a model they can directly evaluate) in the ``examples/spring_mass/from_data/`` directory. For more information, see the source code documentation in ``docs/MLMCPy_documentation.pdf`` (a work in progress).\n\nTests\n------\nThe tests can be performed by running \"py.test\" from the tests/ directory to ensure a proper installation.\n\nDevelopers\n-----------\n\nUQ Center of Excellence
\nNASA Langley Research Center
\nHampton, Virginia
\n\nThis software was funded by and developed under the High Performance Computing Incubator (HPCI) at NASA Langley Research Center.
\n\nContributors: James Warner (james.e.warner@nasa.gov), Luke Morrill, Juan Barrientos\n\n\nLicense\n--------\n\nCopyright 2018 United States Government as represented by the Administrator of the National Aeronautics and Space Administration. No copyright is claimed in the United States under Title 17, U.S. Code. All Other Rights Reserved.\n\nDisclaimers\nNo Warranty: THE SUBJECT SOFTWARE IS PROVIDED \"AS IS\" WITHOUT ANY WARRANTY OF ANY KIND, EITHER EXPRESSED, IMPLIED, OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, ANY WARRANTY THAT THE SUBJECT SOFTWARE WILL CONFORM TO SPECIFICATIONS, ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR FREEDOM FROM INFRINGEMENT, ANY WARRANTY THAT THE SUBJECT SOFTWARE WILL BE ERROR FREE, OR ANY WARRANTY THAT DOCUMENTATION, IF PROVIDED, WILL CONFORM TO THE SUBJECT SOFTWARE. THIS AGREEMENT DOES NOT, IN ANY MANNER, CONSTITUTE AN ENDORSEMENT BY GOVERNMENT AGENCY OR ANY PRIOR RECIPIENT OF ANY RESULTS, RESULTING DESIGNS, HARDWARE, SOFTWARE PRODUCTS OR ANY OTHER APPLICATIONS RESULTING FROM USE OF THE SUBJECT SOFTWARE. FURTHER, GOVERNMENT AGENCY DISCLAIMS ALL WARRANTIES AND LIABILITIES REGARDING THIRD-PARTY SOFTWARE, IF PRESENT IN THE ORIGINAL SOFTWARE, AND DISTRIBUTES IT \"AS IS.\"\u2028\n\nWaiver and Indemnity: RECIPIENT AGREES TO WAIVE ANY AND ALL CLAIMS AGAINST THE UNITED STATES GOVERNMENT, ITS CONTRACTORS AND SUBCONTRACTORS, AS WELL AS ANY PRIOR RECIPIENT. IF RECIPIENT'S USE OF THE SUBJECT SOFTWARE RESULTS IN ANY LIABILITIES, DEMANDS, DAMAGES, EXPENSES OR LOSSES ARISING FROM SUCH USE, INCLUDING ANY DAMAGES FROM PRODUCTS BASED ON, OR RESULTING FROM, RECIPIENT'S USE OF THE SUBJECT SOFTWARE, RECIPIENT SHALL INDEMNIFY AND HOLD HARMLESS THE UNITED STATES GOVERNMENT, ITS CONTRACTORS AND SUBCONTRACTORS, AS WELL AS ANY PRIOR RECIPIENT, TO THE EXTENT PERMITTED BY LAW. RECIPIENT'S SOLE REMEDY FOR ANY SUCH MATTER SHALL BE THE IMMEDIATE, UNILATERAL TERMINATION OF THIS AGREEMENT.\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/NASA/MLMCPy", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "MLMCPy", "package_url": "https://pypi.org/project/MLMCPy/", "platform": "", "project_url": "https://pypi.org/project/MLMCPy/", "project_urls": { "Homepage": "https://github.com/NASA/MLMCPy" }, "release_url": "https://pypi.org/project/MLMCPy/0.1.0/", "requires_dist": [ "numpy", "scipy" ], "requires_python": "", "summary": "Multi-Level Monte Carlo with Python", "version": "0.1.0" }, "last_serial": 5113517, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "fdf66da37ac7fb16b49089d62009bd37", "sha256": "3bf4dab111005f1f9d4923abc5b844b4fbc0d3e6d30557f71cbe9c6b2ad029ff" }, "downloads": -1, "filename": "MLMCPy-0.0.1-py2-none-any.whl", "has_sig": false, "md5_digest": "fdf66da37ac7fb16b49089d62009bd37", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 30141, "upload_time": "2018-12-13T21:07:25", "url": "https://files.pythonhosted.org/packages/d4/2a/215ec8abe408c902cc449fac8737b16a57a42b64104dfa727549c53906d6/MLMCPy-0.0.1-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "61af527772bdaecdf0b6ccef20cc9363", "sha256": "c214daaad245616328529c2b721286ad9aa1ca0675c18a33e75fb1e877f2de9f" }, "downloads": -1, "filename": "MLMCPy-0.0.1.tar.gz", "has_sig": false, "md5_digest": "61af527772bdaecdf0b6ccef20cc9363", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13852, "upload_time": "2018-12-13T21:07:27", "url": "https://files.pythonhosted.org/packages/d5/3f/424affa4f1bb09b03525650cd95ba8099866243943c0095b8191d4383d53/MLMCPy-0.0.1.tar.gz" } ], "0.1.0": [ { "comment_text": "", "digests": { "md5": "2e784fcf17916a7130ae082b77795d1c", "sha256": "fe7859e2919ec6d50bb1864cac683cc9565b97037d2ab56f80969208f4054af2" }, "downloads": -1, "filename": "MLMCPy-0.1.0-py2-none-any.whl", "has_sig": false, "md5_digest": "2e784fcf17916a7130ae082b77795d1c", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 31724, "upload_time": "2019-04-08T12:17:35", "url": "https://files.pythonhosted.org/packages/41/b8/f1396004fb9dcdf78aec8878842d43307d85a9a72d14157cf3351e7069b6/MLMCPy-0.1.0-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "408b379bc3337aab21d46fc7529620c2", "sha256": "c2e1eae1bf3bd87cac829410657c5154911cc6ce6096421f1cd51922bda04aa3" }, "downloads": -1, "filename": "MLMCPy-0.1.0.tar.gz", "has_sig": false, "md5_digest": "408b379bc3337aab21d46fc7529620c2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14789, "upload_time": "2019-04-08T12:17:36", "url": "https://files.pythonhosted.org/packages/52/a8/c41854306aa416d2c8f5f49c96de4e78f49bd4cca36a3d446b45654fe69a/MLMCPy-0.1.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "2e784fcf17916a7130ae082b77795d1c", "sha256": "fe7859e2919ec6d50bb1864cac683cc9565b97037d2ab56f80969208f4054af2" }, "downloads": -1, "filename": "MLMCPy-0.1.0-py2-none-any.whl", "has_sig": false, "md5_digest": "2e784fcf17916a7130ae082b77795d1c", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 31724, "upload_time": "2019-04-08T12:17:35", "url": "https://files.pythonhosted.org/packages/41/b8/f1396004fb9dcdf78aec8878842d43307d85a9a72d14157cf3351e7069b6/MLMCPy-0.1.0-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "408b379bc3337aab21d46fc7529620c2", "sha256": "c2e1eae1bf3bd87cac829410657c5154911cc6ce6096421f1cd51922bda04aa3" }, "downloads": -1, "filename": "MLMCPy-0.1.0.tar.gz", "has_sig": false, "md5_digest": "408b379bc3337aab21d46fc7529620c2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14789, "upload_time": "2019-04-08T12:17:36", "url": "https://files.pythonhosted.org/packages/52/a8/c41854306aa416d2c8f5f49c96de4e78f49bd4cca36a3d446b45654fe69a/MLMCPy-0.1.0.tar.gz" } ] }