{ "info": { "author": "Abraham Lee", "author_email": "tisimst@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Education", "Intended Audience :: Science/Research", "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3.0", "Programming Language :: Python :: 3.1", "Programming Language :: Python :: 3.2", "Programming Language :: Python :: 3.3", "Topic :: Education", "Topic :: Scientific/Engineering", "Topic :: Scientific/Engineering :: Mathematics", "Topic :: Scientific/Engineering :: Physics", "Topic :: Software Development", "Topic :: Software Development :: Libraries", "Topic :: Software Development :: Libraries :: Python Modules", "Topic :: Utilities" ], "description": "===============================\n``soerp`` Package Documentation\n===============================\n\nOverview\n========\n\n``soerp`` is the Python implementation of the original Fortran code `SOERP` \nby N. D. Cox to apply a second-order analysis to `error propagation`_ (or \nuncertainty analysis). The ``soerp`` package allows you to **easily** and \n**transparently** track the effects of uncertainty through mathematical \ncalculations. Advanced mathematical functions, similar to those in the standard \nmath_ module can also be evaluated directly.\n\nIn order to correctly use ``soerp``, the **first eight statistical moments** \nof the underlying distribution are required. These are the *mean*, *variance*, \nand then the *standardized third through eighth moments*. These can be input \nmanually in the form of an array, but they can also be **conveniently \ngenerated** using either the **nice constructors** or directly by using the \ndistributions from the ``scipy.stats`` sub-module. See the examples below for \nusage examples of both input methods. The result of all calculations generates a \n*mean*, *variance*, and *standardized skewness and kurtosis* coefficients.\n\n\nRequired Packages\n=================\n\n- ad_ : For first- and second-order automatic differentiation (install this first).\n\n- NumPy_ : Numeric Python\n\n- SciPy_ : Scientific Python (the nice distribution constructors require this)\n\n- Matplotlib_ : Python plotting library\n\nBasic examples\n==============\n\nLet's begin by importing all the available constructors::\n\n >>> from soerp import * # uv, N, U, Exp, etc.\n\nNow, we can see that there are several equivalent ways to specify a statistical distribution, say a Normal distribution with a mean value of 10 and a standard deviation of 1:\n\n- Manually input the first 8 moments (mean, variance, and 3rd-8th standardized central moments)::\n\n >>> x = uv([10, 1, 0, 3, 0, 15, 0, 105])\n\n- Use the ``rv`` kwarg to input a distribution from the ``scipy.stats`` module::\n\n >>> x = uv(rv=ss.norm(loc=10, scale=1))\n\n- Use a built-in convenience constructor (typically the easiest if you can)::\n\n >>> x = N(10, 1)\n\nA Simple Example\n----------------\n\nNow let's walk through an example of a three-part assembly stack-up::\n\n >>> x1 = N(24, 1) # normally distributed\n >>> x2 = N(37, 4) # normally distributed\n >>> x3 = Exp(2) # exponentially distributed\n >>> Z = (x1*x2**2)/(15*(1.5 + x3))\n\nWe can now see the results of the calculations in two ways:\n\n#. The usual ``print`` statement (or simply the object if in a terminal)::\n\n >>> Z # \"print\" is optional at the command-line\n uv(1176.45, 99699.6822917, 0.708013052944, 6.16324345127)\n\n#. The ``describe`` class method that explains briefly what the values are::\n\n >>> Z.describe()\n SOERP Uncertain Value:\n > Mean................... 1176.45\n > Variance............... 99699.6822917\n > Skewness Coefficient... 0.708013052944\n > Kurtosis Coefficient... 6.16324345127\n\nDistribution Moments\n--------------------\n\nThe eight moments of any input variable (and four of any output variable) can be accessed using the ``moments`` class method, as in::\n\n >>> x1.moments()\n [24.0, 1.0, 0.0, 3.0000000000000053, 0.0, 15.000000000000004, 0.0, 105.0]\n >>> Z.moments()\n [1176.45, 99699.6822917, 0.708013052944, 6.16324345127]\n\nCorrelations\n------------\n\nStatistical correlations are correctly handled, even after calculations have taken place::\n\n >>> x1 - x1\n 0.0\n >>> square = x1**2\n >>> square - x1*x1\n 0.0\n\nDerivatives\n-----------\n\nDerivatives with respect to original variables are calculated via the ad_ package and are accessed using the **intuitive class methods**::\n\n >>> Z.d(x1) # dZ/dx1\n 45.63333333333333\n\n >>> Z.d2(x2) # d^2Z/dx2^2\n 1.6\n\n >>> Z.d2c(x1, x3) # d^2Z/dx1dx3 (order doesn't matter)\n -22.816666666666666\n \nWhen we need multiple derivatives at a time, we can use the ``gradient`` and ``hessian`` class methods::\n\n >>> Z.gradient([x1, x2, x3])\n [45.63333333333333, 59.199999999999996, -547.6]\n\n >>> Z.hessian([x1, x2, x3])\n [[0.0, 2.466666666666667, -22.816666666666666], [2.466666666666667, 1.6, -29.6], [-22.816666666666666, -29.6, 547.6]]\n\nError Components/Variance Contributions\n---------------------------------------\n\nAnother useful feature is available through the ``error_components`` class method that has various ways of representing the first- and second-order variance components::\n\n >>> Z.error_components(pprint=True)\n COMPOSITE VARIABLE ERROR COMPONENTS\n uv(37.0, 16.0, 0.0, 3.0) = 58202.9155556 or 58.378236%\n uv(24.0, 1.0, 0.0, 3.0) = 2196.15170139 or 2.202767%\n uv(0.5, 0.25, 2.0, 9.0) = -35665.8249653 or 35.773258%\n\nAdvanced Example\n----------------\n\nHere's a *slightly* more advanced example, estimating the statistical properties of volumetric gas flow through an orifice meter::\n\n >>> from soerp.umath import * # sin, exp, sqrt, etc.\n >>> H = N(64, 0.5)\n >>> M = N(16, 0.1)\n >>> P = N(361, 2)\n >>> t = N(165, 0.5)\n >>> C = 38.4\n >>> Q = C*umath.sqrt((520*H*P)/(M*(t + 460)))\n >>> Q.describe()\n SOERP Uncertain Value:\n > Mean................... 1330.99973939\n > Variance............... 58.210762839\n > Skewness Coefficient... 0.0109422068056\n > Kurtosis Coefficient... 3.00032693502\n \nThis seems to indicate that even though there are products, divisions, and the usage of ``sqrt``, the result resembles a normal distribution (i.e., Q ~ N(1331, 7.63), where the standard deviation = sqrt(58.2) = 7.63).\n\nMain Features\n=============\n\n1. **Transparent calculations** with derivatives automatically calculated. \n **No or little modification** to existing code required.\n\n2. Basic `NumPy` support without modification. Vectorized calculations built-in \n to the ``ad`` package.\n\n3. Nearly all standard `math`_ module functions supported through the \n ``soerp.umath`` sub-module. If you think a function is in there, it probably \n is.\n\n4. Nearly all derivatives calculated analytically using ``ad`` functionality.\n\n5. **Easy continuous distribution constructors**: \n\n - ``N(mu, sigma)`` : `Normal distribution`_\n\n - ``U(a, b)`` : `Uniform distribution`_\n\n - ``Exp(lamda, [mu])`` : `Exponential distribution`_\n\n - ``Gamma(k, theta)`` : `Gamma distribution`_\n\n - ``Beta(alpha, beta, [a, b])`` : `Beta distribution`_\n\n - ``LogN(mu, sigma)`` : `Log-normal distribution`_\n\n - ``Chi2(k)`` : `Chi-squared distribution`_\n\n - ``F(d1, d2)`` : `F-distribution`_\n\n - ``Tri(a, b, c)`` : `Triangular distribution`_\n\n - ``T(v)`` : `T-distribution`_\n\n - ``Weib(lamda, k)`` : `Weibull distribution`_\n\n The location, scale, and shape parameters follow the notation in the \n respective Wikipedia articles. *Discrete distributions are not recommended \n for use at this time. If you need discrete distributions, try the* mcerp_ \n *python package instead.*\n\nInstallation\n============\n\n**Make sure you install the** `ad`_ **package first!** (If you use options \n3 or 4 below, this should be done automatically.)\n\nYou have several easy, convenient options to install the ``soerp`` package \n(administrative privileges may be required)\n\n1. Download the package files below, unzip to any directory, and run::\n\n $ [sudo] python setup.py install\n \n2. Simply copy the unzipped ``soerp-XYZ`` directory to any other location that \n python can find it and rename it ``soerp``.\n \n3. If ``setuptools`` is installed, run::\n\n $ [sudo] easy_install [--upgrade] soerp\n \n4. If ``pip`` is installed, run::\n\n $ [sudo] pip install [--upgrade] soerp\n \nUninstallation\n==============\n\nTo remove the package, there are really two good ways to do this:\n\n1. Go to the folder ``site-packages`` or ``dist-packages`` and simply delete\n the folder ``soerp`` and ``soerp-XYZ-egg-info``.\n\n2. If ``pip`` is installed, run::\n\n $ [sudo] pip uninstall soerp\n\nSee Also\n========\n\n- uncertainties_ : First-order error propagation\n\n- mcerp_ : Real-time latin-hypercube sampling-based Monte Carlo error \n propagation\n\nContact\n=======\n\nPlease send **feature requests, bug reports, or feedback** to \n`Abraham Lee`_.\n\nAcknowledgements\n================\n\nThe author wishes to thank `Eric O. LEBIGOT`_ who first developed the\n`uncertainties`_ python package (for first-order error propagation), \nfrom which many inspiring ideas (like maintaining object correlations, etc.) \nare re-used and/or have been slightly evolved. *If you don't need second\norder functionality, his package is an excellent alternative since it is\noptimized for first-order uncertainty analysis.*\n\nReferences\n==========\n\n- N.D. Cox, 1979, *Tolerance Analysis by Computer*, Journal of Quality Technology, Vol. 11, No. 2, pp. 80-87\n\n\n\n.. _error propagation: http://en.wikipedia.org/wiki/Propagation_of_uncertainty\n.. _math: http://docs.python.org/library/math.html\n.. _ad: http://pypi.python.org/pypi/ad\n.. _mcerp: http://pypi.python.org/pypi/mcerp\n.. _NumPy: http://www.numpy.org/\n.. _SciPy: http://scipy.org\n.. _Matplotlib: http://matplotlib.org/\n.. _uncertainties: http://pypi.python.org/pypi/uncertainties\n.. _Abraham Lee: mailto: tisimst@gmail.com\n.. _Eric O. LEBIGOT: http://www.linkedin.com/pub/eric-lebigot/22/293/277\n.. _PEP8: http://www.python.org/dev/peps/pep-0008\n.. _Normal distribution: http://en.wikipedia.org/wiki/Normal_distribution\n.. _Uniform distribution: http://en.wikipedia.org/wiki/Uniform_distribution_(continuous)\n.. _Exponential distribution: http://en.wikipedia.org/wiki/Exponential_distribution\n.. _Gamma distribution: http://en.wikipedia.org/wiki/Gamma_distribution\n.. _Beta distribution: http://en.wikipedia.org/wiki/Beta_distribution\n.. _Log-normal distribution: http://en.wikipedia.org/wiki/Log-normal_distribution\n.. _Chi-squared distribution: http://en.wikipedia.org/wiki/Chi-squared_distribution\n.. _F-distribution: http://en.wikipedia.org/wiki/F-distribution\n.. _Triangular distribution: http://en.wikipedia.org/wiki/Triangular_distribution\n.. _T-distribution: http://en.wikipedia.org/wiki/Student's_t-distribution\n.. _Weibull distribution: http://en.wikipedia.org/wiki/Weibull_distribution", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/tisimst/soerp", "keywords": "uncertainty analysis,uncertainties,error propagation,second order,derivative,statistics,method of moments,distribution", "license": "BSD License", "maintainer": null, "maintainer_email": null, "name": "soerp", "package_url": "https://pypi.org/project/soerp/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/soerp/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/tisimst/soerp" }, "release_url": "https://pypi.org/project/soerp/0.9.6/", "requires_dist": null, "requires_python": null, "summary": "Second Order Error Propagation", "version": "0.9.6" }, "last_serial": 4413911, "releases": { "0.8": [ { "comment_text": "", "digests": { "md5": "b7aeb6542583054b14d15160d76573e9", "sha256": "bd0d8481e8fdaf9f2d5287edaee86880e31073721b26ef88e30ffc6de8fba88f" }, "downloads": -1, "filename": "soerp-0.8.tar.gz", "has_sig": false, "md5_digest": "b7aeb6542583054b14d15160d76573e9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 18288, "upload_time": "2013-06-28T21:08:32", "url": "https://files.pythonhosted.org/packages/55/ec/4be6e1a494612c8e9a35659e6035836b025833f411689570aa2035224b44/soerp-0.8.tar.gz" }, { "comment_text": "", "digests": { "md5": "528e027e5318b8dd3cad6b81dbb3f97c", "sha256": "213ea37edd48bd8b4c35326f963f4cbef18530ff9e3e9c970b824268ff907dae" }, "downloads": -1, "filename": "soerp-0.8.zip", "has_sig": false, "md5_digest": "528e027e5318b8dd3cad6b81dbb3f97c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 22329, "upload_time": "2013-06-28T21:08:40", "url": "https://files.pythonhosted.org/packages/0d/59/a7a01aeca069df190790dac54fecfbc568606ce0040995a9138fea881d58/soerp-0.8.zip" } ], "0.8.1": [ { "comment_text": "", "digests": { "md5": "e32940ebd8304e97510fe4f2c78ad808", "sha256": "d14afe5f086d16cb07322d43f001462d73d4d6699812c39c6cdce260a4f257a4" }, "downloads": -1, "filename": "soerp-0.8.1.tar.gz", "has_sig": false, "md5_digest": "e32940ebd8304e97510fe4f2c78ad808", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 18547, "upload_time": "2013-06-28T22:09:56", "url": "https://files.pythonhosted.org/packages/f9/77/074a018475d5e1824f943125acb2a3bf08c0f427254f5cd4a171bf043d8a/soerp-0.8.1.tar.gz" }, { "comment_text": "", "digests": { "md5": "d9e4e7732e759d0ab12dde95823535fe", "sha256": "055c570c8d2b34dd111145d83161e0599bf5747b88fb3ad93210692e10a216fd" }, "downloads": -1, "filename": "soerp-0.8.1.zip", "has_sig": false, "md5_digest": "d9e4e7732e759d0ab12dde95823535fe", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 22840, "upload_time": "2013-06-28T22:10:02", "url": "https://files.pythonhosted.org/packages/6f/47/7240cf89911da884352a3d5afad027024968eff77d2cd6d6d1d8006b5275/soerp-0.8.1.zip" } ], "0.8.2": [ { "comment_text": "", "digests": { "md5": "c73ed9285d0594562692ae117828a23c", "sha256": "45e6ecc7de8df18393a9337dc8a79d8063f88e81fd3642a036429f2e4f52a5c1" }, "downloads": -1, "filename": "soerp-0.8.2.tar.gz", "has_sig": false, "md5_digest": "c73ed9285d0594562692ae117828a23c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 21012, "upload_time": "2013-07-12T21:10:24", "url": "https://files.pythonhosted.org/packages/4d/d8/8f7d0bb7c7702696ddaa7a9760131489ff98f09283803f5df26a29f57c10/soerp-0.8.2.tar.gz" }, { "comment_text": "", "digests": { "md5": "3d4e96a042bdc437352595a49622b65d", "sha256": "dd0e137433fe155d2541ab3131e1c0cc658e12b05a0822ebc2cb9596c31d663f" }, "downloads": -1, "filename": "soerp-0.8.2.zip", "has_sig": false, "md5_digest": "3d4e96a042bdc437352595a49622b65d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 25522, "upload_time": "2013-07-12T21:10:37", "url": "https://files.pythonhosted.org/packages/29/87/54e1a6fe56c76b5ddfdbfcde554c4f84c542d69efe50e05e052d0e1e6990/soerp-0.8.2.zip" } ], "0.9": [ { "comment_text": "", "digests": { "md5": "5a78a19ad7919381c99da9e2d32c2093", "sha256": "2d44255dbba7bd9be7e27fd3f2124f9ce5de6b59081b6ce9bc38b5eabb587df0" }, "downloads": -1, "filename": "soerp-0.9.tar.gz", "has_sig": false, "md5_digest": "5a78a19ad7919381c99da9e2d32c2093", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 22878, "upload_time": "2013-07-13T22:11:31", "url": "https://files.pythonhosted.org/packages/bc/00/7558ad99dd37f9f11cdb775d8e4ab08f29e682d428ca6d41a3e540fd80c1/soerp-0.9.tar.gz" }, { "comment_text": "", "digests": { "md5": "ea4ea2bf8d218a33d5afad7982350727", "sha256": "1588f94f79f0f57e8d45cc204245e3bb97d44ef6c558807891ced98bf2b7d1fe" }, "downloads": -1, "filename": "soerp-0.9.zip", "has_sig": false, "md5_digest": "ea4ea2bf8d218a33d5afad7982350727", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 27598, "upload_time": "2013-07-13T22:11:46", "url": "https://files.pythonhosted.org/packages/d1/0d/dc8065eabe02e314d90c95ded951ef4e46efc04c4cd4422c688bbb2db4ee/soerp-0.9.zip" } ], "0.9.1": [ { "comment_text": "", "digests": { "md5": "8da4a7a8556016298be61e065c1b66b1", "sha256": "db381b2e6fddc411cbb1d5be31907b57dbbc384671183017084c6dce3ba3f9b7" }, "downloads": -1, "filename": "soerp-0.9.1.tar.gz", "has_sig": false, "md5_digest": "8da4a7a8556016298be61e065c1b66b1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 23777, "upload_time": "2013-08-16T22:43:23", "url": "https://files.pythonhosted.org/packages/2b/91/6720bad3ebcc3d3f3b3d20df7ad54809d0f13f0e5dcb626575606e385ab3/soerp-0.9.1.tar.gz" } ], "0.9.3": [ { "comment_text": "", "digests": { "md5": "c9c5528a7bda4170e68f420dfed4f2b9", "sha256": "6ff75696f7569650e5c9959fae1f862752ea116c579183642b282143834e8761" }, "downloads": -1, "filename": "soerp-0.9.3.tar.gz", "has_sig": false, "md5_digest": "c9c5528a7bda4170e68f420dfed4f2b9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 27583, "upload_time": "2013-08-27T19:37:15", "url": "https://files.pythonhosted.org/packages/d1/f0/0200b9826d34917b7e045feee9b6342a5d093bc50b97e7e9a9328018a376/soerp-0.9.3.tar.gz" } ], "0.9.4": [ { "comment_text": "", "digests": { "md5": "a64d0cff509aed7b7eb22a7cf4e43fe2", "sha256": "e112d0a1ca7cb3a0609dd285c6c57e60340db81d535e17f84e7f6e0e87c593b6" }, "downloads": -1, "filename": "soerp-0.9.4.tar.gz", "has_sig": false, "md5_digest": "a64d0cff509aed7b7eb22a7cf4e43fe2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 26215, "upload_time": "2013-11-19T21:00:35", "url": "https://files.pythonhosted.org/packages/8f/77/58b4a7372b4b96f1e6e37256229081cf28fe9a536a46c28d0e6e0c5e1fb3/soerp-0.9.4.tar.gz" } ], "0.9.5": [ { "comment_text": "", "digests": { "md5": "12618cb139ffbeacfb3c2328df9047f0", "sha256": "83d1ec0231b2e1ffbaa3b9aa81c72a7a47df8b4142d3358f663bc489c810ea9a" }, "downloads": -1, "filename": "soerp-0.9.5.tar.gz", "has_sig": false, "md5_digest": "12618cb139ffbeacfb3c2328df9047f0", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 25894, "upload_time": "2013-11-19T22:55:38", "url": "https://files.pythonhosted.org/packages/a5/bd/b50420e7f7dec77cfa3cd65de252ebc788a9dfc11bd7879d518d423d153e/soerp-0.9.5.tar.gz" } ], "0.9.6": [ { "comment_text": "", "digests": { "md5": "5bc49bc5a75923438042ac1c37631258", "sha256": "76e74855544a58e93011132165edcef1c3e83fd19042e2a956f812138b139545" }, "downloads": -1, "filename": "soerp-0.9.6.tar.gz", "has_sig": false, "md5_digest": "5bc49bc5a75923438042ac1c37631258", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 25804, "upload_time": "2013-11-29T06:41:12", "url": "https://files.pythonhosted.org/packages/5d/6d/ad1f40dceea8918cb1ef1839ffab9755b079677ce3319024ec995044cd33/soerp-0.9.6.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "5bc49bc5a75923438042ac1c37631258", "sha256": "76e74855544a58e93011132165edcef1c3e83fd19042e2a956f812138b139545" }, "downloads": -1, "filename": "soerp-0.9.6.tar.gz", "has_sig": false, "md5_digest": "5bc49bc5a75923438042ac1c37631258", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 25804, "upload_time": "2013-11-29T06:41:12", "url": "https://files.pythonhosted.org/packages/5d/6d/ad1f40dceea8918cb1ef1839ffab9755b079677ce3319024ec995044cd33/soerp-0.9.6.tar.gz" } ] }