ajdmom


Nameajdmom JSON
Version 1.0 PyPI version JSON
download
home_pageNone
SummaryDerivation of moment and covariance formulas for Affine Jump Diffusion processes.
upload_time2024-04-09 02:41:03
maintainerNone
docs_urlNone
authorNone
requires_python>=3.7
licenseNone
keywords heston model affine jump diffusion moment computation stochastic volatility
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # ajdmom

## Description

The `ajdmom` package represents an advancement in the analysis of Affine Jump Diffusion (AJD) models. It enables the automated derivation of closed-form moment and covariance formulas of any order, which is facilitated by a recursive moment-computing equation developed by the authors. The package advances the analytical capabilities of AJD models, surpassing the limitations of closed-form conditional Characteristic Function (CF). This advancement constitutes the core contribution of our work.

Currently, `ajdmom` supports computations of moments, central moments, and covariances for the Heston Stochastic Volatility model and its three AJD extensions. Moreover, the package can compute partial derivatives of these quantities with respect to model parameters.

The moments and covariances obtained through `ajdmom` have far-reaching implications for multiple domains, including financial modelling, simulation and parameter estimation. For simulations, these moments can establish the underlying probability distributions, leading to significant reductions in computational time when contrasted with conventional numerical CF inversion techniques. In parameter estimation, the moments serve to formulate explicit moment estimators while the likelihood functions are not analytically solvable. Consequently, `ajdmom` has the potential to become an essential instrument for researchers and practitioners demanding comprehensive AJD model analysis.

## Simple Usage

To get the formula for the first moment $\mathbb{E}[y_n]$ for the Heston Stochastic Volatility model ( $y_n$ denotes the return over the nth interval of length $h$ ), run the following code snippet:

``` python
from ajdmom import mdl_1fsv # mdl_1fsv -> mdl_1fsvj, mdl_2fsv, mdl_2fsvj
from pprint import pprint

m1 = mdl_1fsv.moment_y(1)   # 1 in moment_y(1) -> 2,3,4...

# moment_y() -> cmoment_y()             : central moment
# dpoly(m1, wrt), wrt = 'k','theta',... : partial derivative

msg = "which is a Poly with attribute keyfor = \n{}"
print("moment_y(1) = "); pprint(m1); print(msg.format(m1.keyfor))
```

which produces:

```         
moment_y(1) = 
{(0, 1, 0, 0, 1, 0, 0, 0): Fraction(-1, 2),
 (0, 1, 0, 1, 0, 0, 0, 0): Fraction(1, 1)}
which is a Poly with attribute keyfor = 
('e^{-kh}', 'h', 'k^{-}', 'mu', 'theta', 'sigma_v', 'rho', 'sqrt(1-rho^2)')
```

Within the produced results, the two principal key-value pairs, namely (0,1,0,0,1,0,0,0): Fraction(-1,2) and (0,1,0,1,0,0,0,0): Fraction(1,1), correspond to the following expressions:

$$
-\frac{1}{2}\times e^{-0kh}h^1k^{-0}\mu^0\theta^1\sigma_v^0\rho^0\left(\sqrt{1-\rho^2}\right)^0,
$$

$$
1\times e^{-0kh}h^1k^{-0}\mu^1\theta^0\sigma_v^0\rho^0\left(\sqrt{1-\rho^2}\right)^0,
$$

respectively. The summation of these terms yields the first moment of the One-Factor SV model: $\mathbb{E}[y_n] = (\mu-\theta/2)h$. This demonstrates that the `ajdmom` package successfully encapsulates the model's dynamics into a computationally manipulable form, specifically leveraging a custom dictionary data structure, referred to as `Poly`, to encode the moment's expression.

## Documentation

The documentation is hosted on <http://www.yyschools.com/ajdmom/>

## Ongoing Development

This code is being developed on an on-going basis at the author's [Github site](https://github.com/xmlongan/ajdmom).

## Support

For support in using this software, submit an [issue](https://github.com/xmlongan/ajdmom/issues/new).

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "ajdmom",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": null,
    "keywords": "Heston model, affine jump diffusion, moment computation, stochastic volatility",
    "author": null,
    "author_email": "Yan-Feng Wu <wuyf@fudan.edu.cn>",
    "download_url": "https://files.pythonhosted.org/packages/f8/ed/73c277f802aba75a6fd1530c13a05bed4b5a4d767bc06d8e59af751ddfc9/ajdmom-1.0.tar.gz",
    "platform": null,
    "description": "# ajdmom\n\n## Description\n\nThe `ajdmom` package represents an advancement in the analysis of Affine Jump Diffusion (AJD) models. It enables the automated derivation of closed-form moment and covariance formulas of any order, which is facilitated by a recursive moment-computing equation developed by the authors. The package advances the analytical capabilities of AJD models, surpassing the limitations of closed-form conditional Characteristic Function (CF). This advancement constitutes the core contribution of our work.\n\nCurrently, `ajdmom` supports computations of moments, central moments, and covariances for the Heston Stochastic Volatility model and its three AJD extensions. Moreover, the package can compute partial derivatives of these quantities with respect to model parameters.\n\nThe moments and covariances obtained through `ajdmom` have far-reaching implications for multiple domains, including financial modelling, simulation and parameter estimation. For simulations, these moments can establish the underlying probability distributions, leading to significant reductions in computational time when contrasted with conventional numerical CF inversion techniques. In parameter estimation, the moments serve to formulate explicit moment estimators while the likelihood functions are not analytically solvable. Consequently, `ajdmom` has the potential to become an essential instrument for researchers and practitioners demanding comprehensive AJD model analysis.\n\n## Simple Usage\n\nTo get the formula for the first moment $\\mathbb{E}[y_n]$ for the Heston Stochastic Volatility model ( $y_n$ denotes the return over the nth interval of length $h$ ), run the following code snippet:\n\n``` python\nfrom ajdmom import mdl_1fsv # mdl_1fsv -> mdl_1fsvj, mdl_2fsv, mdl_2fsvj\nfrom pprint import pprint\n\nm1 = mdl_1fsv.moment_y(1)   # 1 in moment_y(1) -> 2,3,4...\n\n# moment_y() -> cmoment_y()             : central moment\n# dpoly(m1, wrt), wrt = 'k','theta',... : partial derivative\n\nmsg = \"which is a Poly with attribute keyfor = \\n{}\"\nprint(\"moment_y(1) = \"); pprint(m1); print(msg.format(m1.keyfor))\n```\n\nwhich produces:\n\n```         \nmoment_y(1) = \n{(0, 1, 0, 0, 1, 0, 0, 0): Fraction(-1, 2),\n (0, 1, 0, 1, 0, 0, 0, 0): Fraction(1, 1)}\nwhich is a Poly with attribute keyfor = \n('e^{-kh}', 'h', 'k^{-}', 'mu', 'theta', 'sigma_v', 'rho', 'sqrt(1-rho^2)')\n```\n\nWithin the produced results, the two principal key-value pairs, namely (0,1,0,0,1,0,0,0): Fraction(-1,2) and (0,1,0,1,0,0,0,0): Fraction(1,1), correspond to the following expressions:\n\n$$\n-\\frac{1}{2}\\times e^{-0kh}h^1k^{-0}\\mu^0\\theta^1\\sigma_v^0\\rho^0\\left(\\sqrt{1-\\rho^2}\\right)^0,\n$$\n\n$$\n1\\times e^{-0kh}h^1k^{-0}\\mu^1\\theta^0\\sigma_v^0\\rho^0\\left(\\sqrt{1-\\rho^2}\\right)^0,\n$$\n\nrespectively. The summation of these terms yields the first moment of the One-Factor SV model: $\\mathbb{E}[y_n] = (\\mu-\\theta/2)h$. This demonstrates that the `ajdmom` package successfully encapsulates the model's dynamics into a computationally manipulable form, specifically leveraging a custom dictionary data structure, referred to as `Poly`, to encode the moment's expression.\n\n## Documentation\n\nThe documentation is hosted on <http://www.yyschools.com/ajdmom/>\n\n## Ongoing Development\n\nThis code is being developed on an on-going basis at the author's [Github site](https://github.com/xmlongan/ajdmom).\n\n## Support\n\nFor support in using this software, submit an [issue](https://github.com/xmlongan/ajdmom/issues/new).\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "Derivation of moment and covariance formulas for Affine Jump Diffusion processes.",
    "version": "1.0",
    "project_urls": {
        "Bug Tracker": "https://github.com/xmlongan/ajdmom/issues",
        "Homepage": "https://github.com/xmlongan/ajdmom"
    },
    "split_keywords": [
        "heston model",
        " affine jump diffusion",
        " moment computation",
        " stochastic volatility"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "c963343a4584634d50a421bd20095bf56ac0c01599e04f1a3789b917217836cd",
                "md5": "a96f07e1c6118de294ceba4973717651",
                "sha256": "59505234fa1059c34dd124b611dfd1ce7ebe970a8accfc1ede3fa7b2921d2815"
            },
            "downloads": -1,
            "filename": "ajdmom-1.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "a96f07e1c6118de294ceba4973717651",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 49519,
            "upload_time": "2024-04-09T02:40:59",
            "upload_time_iso_8601": "2024-04-09T02:40:59.556175Z",
            "url": "https://files.pythonhosted.org/packages/c9/63/343a4584634d50a421bd20095bf56ac0c01599e04f1a3789b917217836cd/ajdmom-1.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "f8ed73c277f802aba75a6fd1530c13a05bed4b5a4d767bc06d8e59af751ddfc9",
                "md5": "fe3f51f5663a655627a0b1c51d59a745",
                "sha256": "43f6b1a52c67163bc27c3765febb54942bc582c370b0eb929e462809b33c0431"
            },
            "downloads": -1,
            "filename": "ajdmom-1.0.tar.gz",
            "has_sig": false,
            "md5_digest": "fe3f51f5663a655627a0b1c51d59a745",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 2021541,
            "upload_time": "2024-04-09T02:41:03",
            "upload_time_iso_8601": "2024-04-09T02:41:03.199965Z",
            "url": "https://files.pythonhosted.org/packages/f8/ed/73c277f802aba75a6fd1530c13a05bed4b5a4d767bc06d8e59af751ddfc9/ajdmom-1.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-04-09 02:41:03",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "xmlongan",
    "github_project": "ajdmom",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "ajdmom"
}
        
Elapsed time: 0.43348s