# Welcome to deFit
Fitting Differential Equations to Time Series Data ( [deFit](https://github.com/yueqinhu/defit) ).
## Overview
### What is deFit?
Use numerical optimization to fit ordinary differential equations (ODEs) to time series data to examine the dynamic relationships between variables or the characteristics of a dynamical system. It can now be used to estimate the parameters of ODEs up to second order.
### Features
* Fit ordinary differential equation models to time series data
* Report model parameter estimations, standard errors, R-squared, and root mean standard error
* Plot raw data points and fitted lines
* Support ordinary differential equation models up to second order
* deFit can run in Python and R environments
### 1.2 First impression in Python
To get a first impression of how deFit works in simulation, consider the following example of a differential equational model. The figure below contains a graphical representation of the model that we want to fit.
```python
import defit
import pandas as pd
df1 = pd.read_csv('defit/data/example1.csv')
model1 = '''
x =~ myX
time =~ myTime
x(2) ~ x + x(1)
'''
result1 = defit.defit(data=df1,model=model1)
```
![example1](https://raw.githubusercontent.com/673aa/673aa/refs/heads/main/img/defit_example1.png)
## 2 Navigation
- [Home](https://github.com/yueqinhu/defit)
- [User guide in R](https://github.com/yueqinhu/defit/blob/main/Documents/UserGuideR.md)
- [User guide in Python](https://github.com/yueqinhu/defit/blob/main/Documents/UserGuidePython.md)
- [issues](https://github.com/yueqinhu/defit/issues)
Raw data
{
"_id": null,
"home_page": "https://github.com/yueqinhu/defit",
"name": "deFit",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.7",
"maintainer_email": null,
"keywords": "ODE, optimization, numerical methods, Intensive longitudinal data, dynamical system, differential equation, time series",
"author": "Yueqin Hu, Qingshan Liu, Minglan Li",
"author_email": "yueqinhu@bnu.edu.cn, liuqingshan@mail.bnu.edu.cn, 202431061029@mail.bnu.edu.cn",
"download_url": "https://files.pythonhosted.org/packages/19/bd/7a5548b978d3efdb075b144588069fdb7ca37866b57fda46619ce2d4128d/defit-0.3.0.tar.gz",
"platform": null,
"description": "# Welcome to deFit\r\n\r\nFitting Differential Equations to Time Series Data ( [deFit](https://github.com/yueqinhu/defit) ).\r\n\r\n## Overview\r\n### What is deFit?\r\nUse numerical optimization to fit ordinary differential equations (ODEs) to time series data to examine the dynamic relationships between variables or the characteristics of a dynamical system. It can now be used to estimate the parameters of ODEs up to second order.\r\n\r\n### Features\r\n* Fit ordinary differential equation models to time series data\r\n* Report model parameter estimations, standard errors, R-squared, and root mean standard error\r\n* Plot raw data points and fitted lines\r\n* Support ordinary differential equation models up to second order\r\n* deFit can run in Python and R environments\r\n\r\n### 1.2 First impression in Python\r\nTo get a first impression of how deFit works in simulation, consider the following example of a differential equational model. The figure below contains a graphical representation of the model that we want to fit.\r\n```python\r\nimport defit\r\nimport pandas as pd\r\ndf1 = pd.read_csv('defit/data/example1.csv')\r\nmodel1 = '''\r\n x =~ myX\r\n time =~ myTime\r\n x(2) ~ x + x(1)\r\n '''\r\nresult1 = defit.defit(data=df1,model=model1)\r\n```\r\n![example1](https://raw.githubusercontent.com/673aa/673aa/refs/heads/main/img/defit_example1.png)\r\n\r\n\r\n## 2 Navigation\r\n- [Home](https://github.com/yueqinhu/defit)\r\n- [User guide in R](https://github.com/yueqinhu/defit/blob/main/Documents/UserGuideR.md)\r\n- [User guide in Python](https://github.com/yueqinhu/defit/blob/main/Documents/UserGuidePython.md)\r\n- [issues](https://github.com/yueqinhu/defit/issues)\r\n",
"bugtrack_url": null,
"license": "GPL-3",
"summary": "Fitting Differential Equations to Time Series Data",
"version": "0.3.0",
"project_urls": {
"Documentation": "https://github.com/yueqinhu/defit",
"Homepage": "https://github.com/yueqinhu/defit",
"Source Code": "https://github.com/yueqinhu/defit"
},
"split_keywords": [
"ode",
" optimization",
" numerical methods",
" intensive longitudinal data",
" dynamical system",
" differential equation",
" time series"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "9615100a4fc78c452e75f9068bd43acdeec6e9a58333e1fa025bf4147eed1b95",
"md5": "1a86d9126bf4cff8503c7403d60423a9",
"sha256": "4e6ab5c55c76bab5665e83dca369e669cbc733c7296af25d90693a669ddce9b7"
},
"downloads": -1,
"filename": "deFit-0.3.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "1a86d9126bf4cff8503c7403d60423a9",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.7",
"size": 361211,
"upload_time": "2024-10-14T08:44:52",
"upload_time_iso_8601": "2024-10-14T08:44:52.278357Z",
"url": "https://files.pythonhosted.org/packages/96/15/100a4fc78c452e75f9068bd43acdeec6e9a58333e1fa025bf4147eed1b95/deFit-0.3.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "19bd7a5548b978d3efdb075b144588069fdb7ca37866b57fda46619ce2d4128d",
"md5": "79a0024a3cf158870c90468c76f268d0",
"sha256": "9a907ca889e7d9cbbf2dd26b26fbad1cd2d41ac73aa40e8d12a3d1d1634dce60"
},
"downloads": -1,
"filename": "defit-0.3.0.tar.gz",
"has_sig": false,
"md5_digest": "79a0024a3cf158870c90468c76f268d0",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.7",
"size": 353020,
"upload_time": "2024-10-14T08:44:54",
"upload_time_iso_8601": "2024-10-14T08:44:54.317336Z",
"url": "https://files.pythonhosted.org/packages/19/bd/7a5548b978d3efdb075b144588069fdb7ca37866b57fda46619ce2d4128d/defit-0.3.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-10-14 08:44:54",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "yueqinhu",
"github_project": "defit",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "defit"
}