macrocorr


Namemacrocorr JSON
Version 0.1.6 PyPI version JSON
download
home_page
Summarya Python package for analyzing the correlation between macroeconomic indicators and time-series data
upload_time2023-08-22 14:42:17
maintainer
docs_urlNone
author
requires_python>=3.7
licenseCopyright (c) 2023 Seoli Kim 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 economics correlation time-series
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # macroecon

Macrocorr (’macroeconomic correlation’) is a Python package for analyzing the correlation between macroeconomic indicators and time-series data. 

*Pearson's correlation* is used to analyze the correlation. This package uses [SciPy](https://scipy.org/)’s built function to get the Pearson coefficient. For details, please check out **[scipy.stats.pearsonr](https://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.pearsonr.html).** 

This package is designed to provide the easy process of analyzing and comparing the correlations with multiple macroeconomic indicators at a single time. The result is intended to provide an overview of macroeconomic relationships. It should not be used for profitable purposes.

The data of the macroeconomic indicators are extracted from [WorldBank](https://databank.worldbank.org/) and [YahooFinance](https://finance.yahoo.com/lookup?s=DATA) historical database. This package doesn’t guarantee the accuracy of the correlated data.

## Installation

The latest stable release (and required dependencies) can be installed from [pip](https://pypi.org/project/macrocorr/).

```bash
pip install macrocorr
```

## Usage
- For all macroeconomic indicators and all major categories, check out [CATALOG](https://github.com/SeoliKim/macrocorr/blob/main/Usage/CATALOG.md).
- For more detailed uses of the functions, check out [FUNCTIONS](https://github.com/SeoliKim/macrocorr/blob/main/Usage/FUNCTIONS.md).
- For a step-by-step example use-case, check out [example_basic.ipynb](https://github.com/SeoliKim/macrocorr/blob/main/Usage/example/example_basic.ipynb).

#### Quick Start

1. Import package Macrocorr

```python
import macrocorr as mcrr
```

2. Create a correlator with the data you want to analyze

```python
my_correlator= mcrr.Correlator(date=my_data['Date'].values, data_x=my_data['Price'].values)
# data_x should be an one-dimensional array of numerical value
# make sure the values from date and data_x are matched
```

3. Analyze and compare the correlation with the macroeconomic indicators from a category

```python
my_correlator.analyze_Correlation(category='population', country='USA', top_num=3)
# print the top 3 most correlated indicators from the category (='population') 
# with their respective Pearson's coefficient and p-value
# plot the graph with both the input data and data of the most correlated indicator
```

4. Analyze the correlation with one specific indicator

```python
my_correlator.get_Correlation(y_name="Population, total", graph=True)
# print the Pearson's coefficient and p-value of the indicator (='Population, total') 
# plot the graph with both the input data and data of the indicator
```
</br>

## Contributing

Development takes place on [Github](https://github.com/SeoliKim/macrocorr)

Pull requests are welcome. Feel free to add more macroeconomic indicators or analysis methods.

For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.
</br>

## License

[MIT](https://choosealicense.com/licenses/mit/)

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "macrocorr",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": "",
    "keywords": "economics,correlation,time-series",
    "author": "",
    "author_email": "Seoli Kim <seolikim1225@gmail.com>",
    "download_url": "",
    "platform": null,
    "description": "# macroecon\r\n\r\nMacrocorr (\u2019macroeconomic correlation\u2019) is a Python package for analyzing the correlation between macroeconomic indicators and time-series data. \r\n\r\n*Pearson's correlation* is used to analyze the correlation. This package uses [SciPy](https://scipy.org/)\u2019s built function to get the Pearson coefficient. For details, please check out **[scipy.stats.pearsonr](https://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.pearsonr.html).** \r\n\r\nThis package is designed to provide the easy process of analyzing and comparing the correlations with multiple macroeconomic indicators at a single time. The result is intended to provide an overview of macroeconomic relationships. It should not be used for profitable purposes.\r\n\r\nThe data of the macroeconomic indicators are extracted from [WorldBank](https://databank.worldbank.org/) and [YahooFinance](https://finance.yahoo.com/lookup?s=DATA) historical database. This package doesn\u2019t guarantee the accuracy of the correlated data.\r\n\r\n## Installation\r\n\r\nThe latest stable release (and required dependencies) can be installed from [pip](https://pypi.org/project/macrocorr/).\r\n\r\n```bash\r\npip install macrocorr\r\n```\r\n\r\n## Usage\r\n- For all macroeconomic indicators and all major categories, check out [CATALOG](https://github.com/SeoliKim/macrocorr/blob/main/Usage/CATALOG.md).\r\n- For more detailed uses of the functions, check out [FUNCTIONS](https://github.com/SeoliKim/macrocorr/blob/main/Usage/FUNCTIONS.md).\r\n- For a step-by-step example use-case, check out [example_basic.ipynb](https://github.com/SeoliKim/macrocorr/blob/main/Usage/example/example_basic.ipynb).\r\n\r\n#### Quick Start\r\n\r\n1. Import package Macrocorr\r\n\r\n```python\r\nimport macrocorr as mcrr\r\n```\r\n\r\n2. Create a correlator with the data you want to analyze\r\n\r\n```python\r\nmy_correlator= mcrr.Correlator(date=my_data['Date'].values, data_x=my_data['Price'].values)\r\n# data_x should be an one-dimensional array of numerical value\r\n# make sure the values from date and data_x are matched\r\n```\r\n\r\n3. Analyze and compare the correlation with the macroeconomic indicators from a category\r\n\r\n```python\r\nmy_correlator.analyze_Correlation(category='population', country='USA', top_num=3)\r\n# print the top 3 most correlated indicators from the category (='population') \r\n# with their respective Pearson's coefficient and p-value\r\n# plot the graph with both the input data and data of the most correlated indicator\r\n```\r\n\r\n4. Analyze the correlation with one specific indicator\r\n\r\n```python\r\nmy_correlator.get_Correlation(y_name=\"Population, total\", graph=True)\r\n# print the Pearson's coefficient and p-value of the indicator (='Population, total') \r\n# plot the graph with both the input data and data of the indicator\r\n```\r\n</br>\r\n\r\n## Contributing\r\n\r\nDevelopment takes place on [Github](https://github.com/SeoliKim/macrocorr)\r\n\r\nPull requests are welcome. Feel free to add more macroeconomic indicators or analysis methods.\r\n\r\nFor major changes, please open an issue first to discuss what you would like to change.\r\n\r\nPlease make sure to update tests as appropriate.\r\n</br>\r\n\r\n## License\r\n\r\n[MIT](https://choosealicense.com/licenses/mit/)\r\n",
    "bugtrack_url": null,
    "license": "Copyright (c) 2023 Seoli Kim  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 Python package for analyzing the correlation between macroeconomic indicators and time-series data",
    "version": "0.1.6",
    "project_urls": {
        "Homepage": "https://github.com/SeoliKim/macrocorr"
    },
    "split_keywords": [
        "economics",
        "correlation",
        "time-series"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "552b651a7bf6a152db0f118465af3f941c7f7a19cf1550d424f61114f483e793",
                "md5": "efc61841f7c6fc88d31399bd0e47e3d4",
                "sha256": "f5e7ded3978e98159004d67fdf976df041f0465f5184900938cc913a0ebf25ae"
            },
            "downloads": -1,
            "filename": "macrocorr-0.1.6-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "efc61841f7c6fc88d31399bd0e47e3d4",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 10000,
            "upload_time": "2023-08-22T14:42:17",
            "upload_time_iso_8601": "2023-08-22T14:42:17.639768Z",
            "url": "https://files.pythonhosted.org/packages/55/2b/651a7bf6a152db0f118465af3f941c7f7a19cf1550d424f61114f483e793/macrocorr-0.1.6-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-08-22 14:42:17",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "SeoliKim",
    "github_project": "macrocorr",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "macrocorr"
}
        
Elapsed time: 0.10777s