innovationdiffusion
===================
Implementation of the Bass Model for innovation diffusion.
Free software: MIT license
Features
--------
* Derive p, q, m values via Nonlinear Least Squares estimation
* Use p, q, and m values to predict at-time and cumulative sales numbers
* Using real and predicted values, show overlaid plots for comparison
* Model summary
Example
-------
Let's demonstrate a small example on a sales dataset of gaming consoles for the period 2005 - 2017.
.. code-block::python
import innovationdiffusion
import pandas as pd
xbox = pd.read_excel("xbox_sales.xlsx")
# Normalize time period values
time_axis = xbox.index
time_axis -= time_axis.min()
y_axis = xbox["Sales"].values
# Non-cumulative case - size of market is equal to sum of sales numbers for all time periods
total_market = xbox["Sales"].values.sum()
p0 = [0.2, 0.2, total_market]
# Use NLS to derive p, q, and m values from existing data.
# This may be later used for a look-alike analysis for another innovation
popt, pcov = innovationdiffusion.nls(time_axis.values, y_axis, False, p0)
p, q, m = popt
predicted = innovationdiffusion.predict_values(time_axis.values, p, q, m, False)
predicted
# Plot real and predicted values together
innovationdiffusion.plot(time_axis, xbox["Sales"].values, predicted, legends=["Predicted sales", "Real sales"])
# Output model summary
innovationdiffusion.summary(xbox["Sales"].values, predicted, time_axis.values)
Credits
-------
Developed by Esfira Babajanyan.
History
=======
Version 0.0.1 (2023-05-16)
---------------------------
- Initial release of the package.
Raw data
{
"_id": null,
"home_page": "https://github.com/esfira02/bassmodel",
"name": "innovationdiffusion",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.6",
"maintainer_email": "",
"keywords": "bassmodel",
"author": "Esfira Babajanyan",
"author_email": "esfira.babajanyan2002@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/a7/8b/0a12c93e6945a597ea12a17e26064ff291ae5359ab768b4843e3695aea9d/innovationdiffusion-0.0.1.tar.gz",
"platform": null,
"description": "\ninnovationdiffusion\n===================\n\nImplementation of the Bass Model for innovation diffusion.\nFree software: MIT license\n\n\nFeatures\n--------\n\n* Derive p, q, m values via Nonlinear Least Squares estimation\n* Use p, q, and m values to predict at-time and cumulative sales numbers\n* Using real and predicted values, show overlaid plots for comparison\n* Model summary \n\nExample\n-------\nLet's demonstrate a small example on a sales dataset of gaming consoles for the period 2005 - 2017.\n .. code-block::python\n import innovationdiffusion\n import pandas as pd\n\n xbox = pd.read_excel(\"xbox_sales.xlsx\")\n\n # Normalize time period values\n time_axis = xbox.index\n time_axis -= time_axis.min()\n\n y_axis = xbox[\"Sales\"].values\n\n # Non-cumulative case - size of market is equal to sum of sales numbers for all time periods\n total_market = xbox[\"Sales\"].values.sum()\n p0 = [0.2, 0.2, total_market]\n\n # Use NLS to derive p, q, and m values from existing data.\n # This may be later used for a look-alike analysis for another innovation\n popt, pcov = innovationdiffusion.nls(time_axis.values, y_axis, False, p0)\n p, q, m = popt\n\n predicted = innovationdiffusion.predict_values(time_axis.values, p, q, m, False)\n predicted\n\n # Plot real and predicted values together\n innovationdiffusion.plot(time_axis, xbox[\"Sales\"].values, predicted, legends=[\"Predicted sales\", \"Real sales\"])\n\n # Output model summary\n innovationdiffusion.summary(xbox[\"Sales\"].values, predicted, time_axis.values)\n\n\nCredits\n-------\n\nDeveloped by Esfira Babajanyan.\n\nHistory\n=======\n\nVersion 0.0.1 (2023-05-16)\n---------------------------\n\n- Initial release of the package.\n\n",
"bugtrack_url": null,
"license": "MIT license",
"summary": "Implementation of the Bass Model for innovation diffusion",
"version": "0.0.1",
"project_urls": {
"Homepage": "https://github.com/esfira02/bassmodel"
},
"split_keywords": [
"bassmodel"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "e66830609f0a6d285042d048bcd144c97817636f3f15e380d4cf598ec8479dfe",
"md5": "ebcead98bfc873d53fa836a7b2fb44e8",
"sha256": "67c75fc8039d5c257765c96c8e0637d585a73bd9adf80d881c938e67b4fe5a21"
},
"downloads": -1,
"filename": "innovationdiffusion-0.0.1-py2.py3-none-any.whl",
"has_sig": false,
"md5_digest": "ebcead98bfc873d53fa836a7b2fb44e8",
"packagetype": "bdist_wheel",
"python_version": "py2.py3",
"requires_python": ">=3.6",
"size": 2906,
"upload_time": "2023-05-16T20:06:09",
"upload_time_iso_8601": "2023-05-16T20:06:09.557085Z",
"url": "https://files.pythonhosted.org/packages/e6/68/30609f0a6d285042d048bcd144c97817636f3f15e380d4cf598ec8479dfe/innovationdiffusion-0.0.1-py2.py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "a78b0a12c93e6945a597ea12a17e26064ff291ae5359ab768b4843e3695aea9d",
"md5": "9c236329d02050d8c121d467469b01f6",
"sha256": "31b1edcb73ae88c58a04936b5b2ccb4a64cb6c1358f68fb2e3447ea3ff29ca78"
},
"downloads": -1,
"filename": "innovationdiffusion-0.0.1.tar.gz",
"has_sig": false,
"md5_digest": "9c236329d02050d8c121d467469b01f6",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.6",
"size": 7654,
"upload_time": "2023-05-16T20:06:11",
"upload_time_iso_8601": "2023-05-16T20:06:11.955323Z",
"url": "https://files.pythonhosted.org/packages/a7/8b/0a12c93e6945a597ea12a17e26064ff291ae5359ab768b4843e3695aea9d/innovationdiffusion-0.0.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-05-16 20:06:11",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "esfira02",
"github_project": "bassmodel",
"travis_ci": true,
"coveralls": false,
"github_actions": false,
"tox": true,
"lcname": "innovationdiffusion"
}