truncated-triangle-distribution-mean


Nametruncated-triangle-distribution-mean JSON
Version 0.1.1 PyPI version JSON
download
home_pageNone
SummaryA small package that calculates the mean of a truncated triangular distribution analytically.
upload_time2024-08-30 11:35:44
maintainerNone
docs_urlNone
authorNone
requires_python>=3.10
licenseCopyright (c) 2024 John Scolaro Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
keywords distribution triangular truncated
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Introduction

Do you have a truncated triangle distribution and want to find the average value? This package calculates it for you.

## Usage

After installing truncated_triangle_distribution_mean with something like:

```
pip install truncated_triangle_distribution_mean
```
You can get the mean of the distribution like so:

```
from truncated_triangle_distribution_mean import TruncatedTriangleDistribution

lower = 1
middle = 2
upper = 3
lower_truncation = 1.1
upper_truncation = 2.8
truncated_triangle_distribution = TruncatedTriangleDistribution(
    lower, middle, upper, lower_truncation, upper_truncation
)
print(f"The mean is: {truncated_triangle_distribution.mean}.")
```

## Credit

I'd like to credit the author of this website [here](https://mantimantilla.github.io/Truncated-Triangular-Simulation-R/) for laying out the maths that this package is based on. I'd also like to let them know that they have integrated between the incorrect bounds for their third equation in the "mean" section, and I had to figure that out myself.

## Contributions

If you have any problems, raise an issue on Github or send me an email. If you want to contribute, just submit a pull request. To set the repo up for development, clone it down and run:

```
pip install -e.[dev]
```

and install the pre-commit with `pre-commit install`.
            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "truncated-triangle-distribution-mean",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.10",
    "maintainer_email": null,
    "keywords": "distribution, triangular, truncated",
    "author": null,
    "author_email": "John Scolaro <johnscolaro95@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/fa/a4/0e62e1297db8386caabe4447dac6bdcd64b5455a743556d2f4547b355b17/truncated_triangle_distribution_mean-0.1.1.tar.gz",
    "platform": null,
    "description": "# Introduction\n\nDo you have a truncated triangle distribution and want to find the average value? This package calculates it for you.\n\n## Usage\n\nAfter installing truncated_triangle_distribution_mean with something like:\n\n```\npip install truncated_triangle_distribution_mean\n```\nYou can get the mean of the distribution like so:\n\n```\nfrom truncated_triangle_distribution_mean import TruncatedTriangleDistribution\n\nlower = 1\nmiddle = 2\nupper = 3\nlower_truncation = 1.1\nupper_truncation = 2.8\ntruncated_triangle_distribution = TruncatedTriangleDistribution(\n    lower, middle, upper, lower_truncation, upper_truncation\n)\nprint(f\"The mean is: {truncated_triangle_distribution.mean}.\")\n```\n\n## Credit\n\nI'd like to credit the author of this website [here](https://mantimantilla.github.io/Truncated-Triangular-Simulation-R/) for laying out the maths that this package is based on. I'd also like to let them know that they have integrated between the incorrect bounds for their third equation in the \"mean\" section, and I had to figure that out myself.\n\n## Contributions\n\nIf you have any problems, raise an issue on Github or send me an email. If you want to contribute, just submit a pull request. To set the repo up for development, clone it down and run:\n\n```\npip install -e.[dev]\n```\n\nand install the pre-commit with `pre-commit install`.",
    "bugtrack_url": null,
    "license": "Copyright (c) 2024 John Scolaro  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:  The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.  THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.",
    "summary": "A small package that calculates the mean of a truncated triangular distribution analytically.",
    "version": "0.1.1",
    "project_urls": null,
    "split_keywords": [
        "distribution",
        " triangular",
        " truncated"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "51e5ad4f52c986ed8e24ced975bbf909dd00becf671c508c9c102b811a51839b",
                "md5": "ef76182a43c17194f7554dd7a5b2af9f",
                "sha256": "017c2e131262207884fb2d800c44745e07a6602374e9d9618a09197ab108f17f"
            },
            "downloads": -1,
            "filename": "truncated_triangle_distribution_mean-0.1.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "ef76182a43c17194f7554dd7a5b2af9f",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.10",
            "size": 5741,
            "upload_time": "2024-08-30T11:35:42",
            "upload_time_iso_8601": "2024-08-30T11:35:42.751571Z",
            "url": "https://files.pythonhosted.org/packages/51/e5/ad4f52c986ed8e24ced975bbf909dd00becf671c508c9c102b811a51839b/truncated_triangle_distribution_mean-0.1.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "faa40e62e1297db8386caabe4447dac6bdcd64b5455a743556d2f4547b355b17",
                "md5": "71d9e890e3e43104fab7a80d1fa4f656",
                "sha256": "8f6e4f58b631b806c03b4be5df833fbc7b49ae93510d9f6ca6edc80b8aedb9b3"
            },
            "downloads": -1,
            "filename": "truncated_triangle_distribution_mean-0.1.1.tar.gz",
            "has_sig": false,
            "md5_digest": "71d9e890e3e43104fab7a80d1fa4f656",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.10",
            "size": 6898,
            "upload_time": "2024-08-30T11:35:44",
            "upload_time_iso_8601": "2024-08-30T11:35:44.382908Z",
            "url": "https://files.pythonhosted.org/packages/fa/a4/0e62e1297db8386caabe4447dac6bdcd64b5455a743556d2f4547b355b17/truncated_triangle_distribution_mean-0.1.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-08-30 11:35:44",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "truncated-triangle-distribution-mean"
}
        
Elapsed time: 0.35279s