{"id":13499906,"url":"https://github.com/luphord/gaussian-analytics","last_synced_at":"2025-07-10T02:31:41.570Z","repository":{"id":57245223,"uuid":"262558017","full_name":"luphord/gaussian-analytics","owner":"luphord","description":"JavaScript library for analytical pricings of financial derivatives under (log)normal distribution assumptions","archived":false,"fork":false,"pushed_at":"2023-02-02T20:34:47.000Z","size":266,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-29T13:00:18.250Z","etag":null,"topics":["black-scholes","derivatives","pricing"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/luphord.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-05-09T11:40:51.000Z","updated_at":"2023-01-19T11:15:33.000Z","dependencies_parsed_at":"2023-02-18T00:16:23.895Z","dependency_job_id":null,"html_url":"https://github.com/luphord/gaussian-analytics","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/luphord/gaussian-analytics","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luphord%2Fgaussian-analytics","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luphord%2Fgaussian-analytics/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luphord%2Fgaussian-analytics/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luphord%2Fgaussian-analytics/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/luphord","download_url":"https://codeload.github.com/luphord/gaussian-analytics/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luphord%2Fgaussian-analytics/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263850170,"owners_count":23519790,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["black-scholes","derivatives","pricing"],"created_at":"2024-07-31T22:00:46.736Z","updated_at":"2025-07-10T02:31:41.287Z","avatar_url":"https://github.com/luphord.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"# gaussian-analytics\n\n[![npm version](http://img.shields.io/npm/v/gaussian-analytics.svg)](https://npmjs.org/package/gaussian-analytics \"View gaussian-analytics on npm\")\n[![Test and Lint](https://github.com/luphord/gaussian-analytics/actions/workflows/test-lint.yml/badge.svg)](https://github.com/luphord/gaussian-analytics/actions/workflows/test-lint.yml)\n\nJavaScript library for analytical pricings of financial derivatives under (log)normal distribution assumptions.\n\n## Usage\n\n### Usage in Node.js\n\nPlease make sure to have a recent version of [Node.js with npm](https://nodejs.org/en/download/) installed, at least [v13.2.0](https://medium.com/@nodejs/announcing-core-node-js-support-for-ecmascript-modules-c5d6dc29b663).\n\n`gaussian-analytics.js` is available from npm via\n```bash\n\u003e npm install gaussian-analytics\n```\n\nCreate a file `mymodule.mjs` (notice the extension `.mjs` which tells Node.js that this is an [ES6 module](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Modules)) containing\n\n```javascript\nimport * as gauss from 'gaussian-analytics';\n\nconsole.log(gauss.pdf(0));\n```\n\nand run it by\n\n```bash\n\u003e node mymodule.mjs\n0.3989422804014327\n```\n\nFor more details on Node.js and ES6 modules please see https://nodejs.org/api/esm.html#esm_enabling.\n\n### Experiment in browser console\n\nAs `gaussian-analytics.js` is published as an [ES6 module](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Modules) you have to apply the following trick to play with it in your browser's dev console. First open the dev console (in Firefox press `F12`) and execute\n\n```javascript\n// dynamically import ES6 module and store it as global variable gauss\nimport('//unpkg.com/gaussian-analytics').then(m =\u003e window.gauss=m);\n```\n\nAfterwards, the global variable `gauss` will contain the module and you can call exported functions on it, e.g.\n\n```javascript\ngauss.eqBlackScholes(100, 100, 1.0, 0.2, 0.0, 0.02);\n/* -\u003e\n{\n  call: {\n    price: 8.916035060662303,\n    delta: 0.5792596877744174,\n    gamma: 0.019552134698772795\n  },\n  put: {\n    price: 6.935902391337827,\n    delta: -0.4207403122255826,\n    gamma: 0.019552134698772795\n  },\n  digitalCall: {\n    price: 0.49009933716779436,\n    delta: 0.019552134698772795,\n    gamma: -0.00019164976492052065\n  },\n  digitalPut: {\n    price: 0.4900993361389609,\n    delta: -0.019552134698772795,\n    gamma: 0.00019164976492052065\n  },\n  N_d1: 0.5792596877744174,\n  N_d2: 0.5000000005248086,\n  d1: 0.20000000000000004,\n  d2: 2.7755575615628914e-17,\n  sigma: 0.2\n}\n */\n```\n\nThis should work at least for Firefox and Chrome.\n\n### Development\n\nPlease make sure to have a recent version of [Node.js with npm](https://nodejs.org/en/download/) installed, at least [v13.2.0](https://medium.com/@nodejs/announcing-core-node-js-support-for-ecmascript-modules-c5d6dc29b663).\n\nRun `npm install` in the top-level folder of this repository to create a development environment.\nThen, `npm run lint \u0026\u0026 npm run test` will run the linter and tests.\n\n## API Documentation\n\n#### Classes\n\n\u003cdl\u003e\n\u003cdt\u003e\u003ca href=\"#Bond\"\u003eBond\u003c/a\u003e\u003c/dt\u003e\n\u003cdd\u003e\u003cp\u003eCoupon-paying bond with schedule rolled from end.\nFirst coupon period is (possibly) shorter than later periods.\u003c/p\u003e\n\u003c/dd\u003e\n\u003c/dl\u003e\n\n#### Constants\n\n\u003cdl\u003e\n\u003cdt\u003e\u003ca href=\"#irFrequency\"\u003eirFrequency\u003c/a\u003e\u003c/dt\u003e\n\u003cdd\u003e\u003cp\u003eFrequencies expressed as number of payments per year.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003ca href=\"#irMinimumPeriod\"\u003eirMinimumPeriod\u003c/a\u003e\u003c/dt\u003e\n\u003cdd\u003e\u003cp\u003eMinimum period \u003ca href=\"#irRollFromEnd\"\u003eirRollFromEnd\u003c/a\u003e will create.\u003c/p\u003e\n\u003c/dd\u003e\n\u003c/dl\u003e\n\n#### Functions\n\n\u003cdl\u003e\n\u003cdt\u003e\u003ca href=\"#pdf\"\u003epdf(x)\u003c/a\u003e ⇒ \u003ccode\u003enumber\u003c/code\u003e\u003c/dt\u003e\n\u003cdd\u003e\u003cp\u003eProbability density function (pdf) for a standard normal distribution.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003ca href=\"#cdf\"\u003ecdf(x)\u003c/a\u003e ⇒ \u003ccode\u003enumber\u003c/code\u003e\u003c/dt\u003e\n\u003cdd\u003e\u003cp\u003eCumulative distribution function (cdf) for a standard normal distribution.\nApproximation by Zelen, Marvin and Severo, Norman C. (1964),\n\u003ca href=\"http://people.math.sfu.ca/~cbm/aands/page_932.htm\"\u003eformula 26.2.17\u003c/a\u003e.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003ca href=\"#margrabesFormula\"\u003emargrabesFormula(S1, S2, T, sigma1, sigma2, rho, q1, q2, [scale])\u003c/a\u003e ⇒ \u003ccode\u003e\u003ca href=\"#PricingResult\"\u003ePricingResult\u003c/a\u003e\u003c/code\u003e\u003c/dt\u003e\n\u003cdd\u003e\u003cp\u003eMargrabe\u0026#39;s formula for pricing the exchange option between two risky assets.\u003c/p\u003e\n\u003cp\u003eSee William  Margrabe, \u003ca href=\"http://www.stat.nus.edu.sg/~stalimtw/MFE5010/PDF/margrabe1978.pdf\"\u003eThe Value of an Option to Exchange One Asset for Another\u003c/a\u003e,\nJournal of Finance, Vol. 33, No. 1, (March 1978), pp. 177-186.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003ca href=\"#margrabesFormulaShort\"\u003emargrabesFormulaShort(S1, S2, T, sigma, q1, q2, [scale])\u003c/a\u003e ⇒ \u003ccode\u003e\u003ca href=\"#PricingResult\"\u003ePricingResult\u003c/a\u003e\u003c/code\u003e\u003c/dt\u003e\n\u003cdd\u003e\u003cp\u003eMargrabe\u0026#39;s formula for pricing the exchange option between two risky assets.\nEquivalent to \u003ccode\u003emargrabesFormula\u003c/code\u003e but accepting only the volatility corresponding\nto the ratio \u003ccode\u003eS1/S2\u003c/code\u003e instead of their individual volatilities.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003ca href=\"#eqBlackScholes\"\u003eeqBlackScholes(S, K, T, sigma, q, r, [scale])\u003c/a\u003e ⇒ \u003ccode\u003e\u003ca href=\"#EqPricingResult\"\u003eEqPricingResult\u003c/a\u003e\u003c/code\u003e\u003c/dt\u003e\n\u003cdd\u003e\u003cp\u003eBlack-Scholes formula for a European vanilla option on a stock (asset class equity).\u003c/p\u003e\n\u003cp\u003eSee Fischer Black and Myron Scholes, \u003ca href=\"https://www.cs.princeton.edu/courses/archive/fall09/cos323/papers/black_scholes73.pdf\"\u003eThe Pricing of Options and Corporate Liabilities\u003c/a\u003e,\nThe Journal of Political Economy, Vol. 81, No. 3 (May - June 1973), pp. 637-654.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003ca href=\"#fxBlackScholes\"\u003efxBlackScholes(S, K, T, sigma, rFor, rDom, [scale])\u003c/a\u003e ⇒ \u003ccode\u003e\u003ca href=\"#PricingResult\"\u003ePricingResult\u003c/a\u003e\u003c/code\u003e\u003c/dt\u003e\n\u003cdd\u003e\u003cp\u003eBlack-Scholes formula for a European vanilla currency option (asset class foreign exchange).\nThis is also known as the Garman–Kohlhagen model.\u003c/p\u003e\n\u003cp\u003eSee Mark B. Garman and Steven W. Kohlhagen \u003ca href=\"https://www.sciencedirect.com/science/article/pii/S0261560683800011\"\u003eForeign currency option values\u003c/a\u003e,\nJournal of International Money and Finance, Vol. 2, Issue 3 (1983), pp. 231-237.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003ca href=\"#irBlack76\"\u003eirBlack76(F, K, T, sigma, r, [scale])\u003c/a\u003e ⇒ \u003ccode\u003e\u003ca href=\"#PricingResult\"\u003ePricingResult\u003c/a\u003e\u003c/code\u003e\u003c/dt\u003e\n\u003cdd\u003e\u003cp\u003eBlack-Scholes formula for European option on forward / future (asset class interest rates),\nknown as the Black 76 model.\u003c/p\u003e\n\u003cp\u003eSee Fischer Black \u003ca href=\"https://www.sciencedirect.com/science/article/abs/pii/0304405X76900246\"\u003eThe pricing of commodity contracts\u003c/a\u003e,\nJournal of Financial Economics, 3 (1976), 167-179.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003ca href=\"#irBlack76BondOption\"\u003eirBlack76BondOption(bond, K, T, sigma, spotCurve)\u003c/a\u003e ⇒ \u003ccode\u003e\u003ca href=\"#PricingResult\"\u003ePricingResult\u003c/a\u003e\u003c/code\u003e\u003c/dt\u003e\n\u003cdd\u003e\u003cp\u003eBlack 76 model for an option on a coupon-paying bond (asset class interest rates).\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003ca href=\"#irBlack76CapletFloorlet\"\u003eirBlack76CapletFloorlet(floatingRate, K, sigma, spotCurve)\u003c/a\u003e ⇒ \u003ccode\u003e\u003ca href=\"#PricingResult\"\u003ePricingResult\u003c/a\u003e\u003c/code\u003e\u003c/dt\u003e\n\u003cdd\u003e\u003cp\u003eBlack 76 model for a caplet / floorlet (asset class interest rates).\nNotional is retrieved from floatingRate.notional.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003ca href=\"#irForwardLinearRate\"\u003eirForwardLinearRate(floatingRate, discountCurve)\u003c/a\u003e\u003c/dt\u003e\n\u003cdd\u003e\u003cp\u003eCalculates the linear forward rate given a floating cashflow and a discount curve.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003ca href=\"#irForwardPrice\"\u003eirForwardPrice(cashflows, discountCurve, t)\u003c/a\u003e ⇒ \u003ccode\u003enumber\u003c/code\u003e\u003c/dt\u003e\n\u003cdd\u003e\u003cp\u003eCalculates the forward price at time t for a series of cashflows.\nCashflows before t are ignored (i.e. do not add any value).\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003ca href=\"#irRollFromEnd\"\u003eirRollFromEnd(start, end, frequency)\u003c/a\u003e ⇒ \u003ccode\u003eArray.\u0026lt;number\u0026gt;\u003c/code\u003e\u003c/dt\u003e\n\u003cdd\u003e\u003cp\u003eCreates a payment schedule with payment frequency \u003ca href=\"frequency\"\u003efrequency\u003c/a\u003e\nthat has last payment at \u003ca href=\"end\"\u003eend\u003c/a\u003e and no payments before \u003ca href=\"start\"\u003estart\u003c/a\u003e.\nFirst payment period is (possibly) shorter than later periods.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003ca href=\"#irFlatDiscountCurve\"\u003eirFlatDiscountCurve(flatRate)\u003c/a\u003e ⇒ \u003ccode\u003e\u003ca href=\"#DiscountCurve\"\u003eDiscountCurve\u003c/a\u003e\u003c/code\u003e\u003c/dt\u003e\n\u003cdd\u003e\u003cp\u003eCreates a \u003ca href=\"#DiscountCurve\"\u003eDiscountCurve\u003c/a\u003e discounting with the constant \u003ca href=\"flatRate\"\u003eflatRate\u003c/a\u003e.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003ca href=\"#irLinearInterpolationSpotCurve\"\u003eirLinearInterpolationSpotCurve(spotRates)\u003c/a\u003e ⇒ \u003ccode\u003e\u003ca href=\"#SpotCurve\"\u003eSpotCurve\u003c/a\u003e\u003c/code\u003e\u003c/dt\u003e\n\u003cdd\u003e\u003cp\u003eCreates a \u003ca href=\"#SpotCurve\"\u003eSpotCurve\u003c/a\u003e by linearly interpolating the given points in time.\nExtrapolation in both directions is constant.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003ca href=\"#irSpotCurve2DiscountCurve\"\u003eirSpotCurve2DiscountCurve(spotCurve)\u003c/a\u003e ⇒ \u003ccode\u003e\u003ca href=\"#DiscountCurve\"\u003eDiscountCurve\u003c/a\u003e\u003c/code\u003e\u003c/dt\u003e\n\u003cdd\u003e\u003cp\u003eTurns a \u003ca href=\"#SpotCurve\"\u003eSpotCurve\u003c/a\u003e into a \u003ca href=\"#DiscountCurve\"\u003eDiscountCurve\u003c/a\u003e.\nInverse of \u003ca href=\"#irDiscountCurve2SpotCurve\"\u003eirDiscountCurve2SpotCurve\u003c/a\u003e.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003ca href=\"#irDiscountCurve2SpotCurve\"\u003eirDiscountCurve2SpotCurve(discountCurve)\u003c/a\u003e ⇒ \u003ccode\u003e\u003ca href=\"#SpotCurve\"\u003eSpotCurve\u003c/a\u003e\u003c/code\u003e\u003c/dt\u003e\n\u003cdd\u003e\u003cp\u003eTurns a \u003ca href=\"#DiscountCurve\"\u003eDiscountCurve\u003c/a\u003e into a \u003ca href=\"#SpotCurve\"\u003eSpotCurve\u003c/a\u003e.\nInverse of \u003ca href=\"#irSpotCurve2DiscountCurve\"\u003eirSpotCurve2DiscountCurve\u003c/a\u003e.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003ca href=\"#irInternalRateOfReturn\"\u003eirInternalRateOfReturn(cashflows, [r0], [r1], [abstol], [maxiter])\u003c/a\u003e ⇒ \u003ccode\u003enumber\u003c/code\u003e\u003c/dt\u003e\n\u003cdd\u003e\u003cp\u003eCalculates the internal rate of return (IRR) of the given series of cashflows,\ni.e. the flat discount rate (continuously compounded) for which the total NPV of\nthe given cashflows is 0. The secant method is used. If no IRR can be found\nafter \u003ca href=\"maxiter\"\u003emaxiter\u003c/a\u003e iteration, an exception is thrown.\u003c/p\u003e\n\u003c/dd\u003e\n\u003c/dl\u003e\n\n#### Typedefs\n\n\u003cdl\u003e\n\u003cdt\u003e\u003ca href=\"#PricingResult\"\u003ePricingResult\u003c/a\u003e : \u003ccode\u003eObject\u003c/code\u003e\u003c/dt\u003e\n\u003cdd\u003e\u003c/dd\u003e\n\u003cdt\u003e\u003ca href=\"#EqPricingResult\"\u003eEqPricingResult\u003c/a\u003e : \u003ccode\u003e\u003ca href=\"#PricingResult\"\u003ePricingResult\u003c/a\u003e\u003c/code\u003e\u003c/dt\u003e\n\u003cdd\u003e\u003c/dd\u003e\n\u003cdt\u003e\u003ca href=\"#OptionPricingResult\"\u003eOptionPricingResult\u003c/a\u003e : \u003ccode\u003eObject\u003c/code\u003e\u003c/dt\u003e\n\u003cdd\u003e\u003c/dd\u003e\n\u003cdt\u003e\u003ca href=\"#DiscountCurve\"\u003eDiscountCurve\u003c/a\u003e ⇒ \u003ccode\u003enumber\u003c/code\u003e\u003c/dt\u003e\n\u003cdd\u003e\u003c/dd\u003e\n\u003cdt\u003e\u003ca href=\"#SpotCurve\"\u003eSpotCurve\u003c/a\u003e ⇒ \u003ccode\u003enumber\u003c/code\u003e\u003c/dt\u003e\n\u003cdd\u003e\u003c/dd\u003e\n\u003cdt\u003e\u003ca href=\"#SpotRate\"\u003eSpotRate\u003c/a\u003e : \u003ccode\u003eObject\u003c/code\u003e\u003c/dt\u003e\n\u003cdd\u003e\u003c/dd\u003e\n\u003cdt\u003e\u003ca href=\"#FixedCashflow\"\u003eFixedCashflow\u003c/a\u003e : \u003ccode\u003eObject\u003c/code\u003e\u003c/dt\u003e\n\u003cdd\u003e\u003c/dd\u003e\n\u003cdt\u003e\u003ca href=\"#FloatingCashflow\"\u003eFloatingCashflow\u003c/a\u003e : \u003ccode\u003eObject\u003c/code\u003e\u003c/dt\u003e\n\u003cdd\u003e\u003c/dd\u003e\n\u003cdt\u003e\u003ca href=\"#Cashflow\"\u003eCashflow\u003c/a\u003e : \u003ccode\u003e\u003ca href=\"#FixedCashflow\"\u003eFixedCashflow\u003c/a\u003e\u003c/code\u003e | \u003ccode\u003e\u003ca href=\"#FloatingCashflow\"\u003eFloatingCashflow\u003c/a\u003e\u003c/code\u003e\u003c/dt\u003e\n\u003cdd\u003e\u003c/dd\u003e\n\u003c/dl\u003e\n\n\u003ca name=\"Bond\"\u003e\u003c/a\u003e\n\n#### Bond\nCoupon-paying bond with schedule rolled from end.\nFirst coupon period is (possibly) shorter than later periods.\n\n**Kind**: global class  \n\n* [Bond](#Bond)\n    * [new Bond(notional, coupon, start, end, frequency)](#new_Bond_new)\n    * [.cashflows](#Bond+cashflows) ⇒ [\u003ccode\u003eArray.\u0026lt;FixedCashflow\u0026gt;\u003c/code\u003e](#FixedCashflow)\n    * [.forwardDirtyPrice(discountCurve, t)](#Bond+forwardDirtyPrice) ⇒ \u003ccode\u003enumber\u003c/code\u003e\n    * [.dirtyPrice(discountCurve)](#Bond+dirtyPrice) ⇒ \u003ccode\u003enumber\u003c/code\u003e\n    * [.yieldToMaturity([npv])](#Bond+yieldToMaturity) ⇒ \u003ccode\u003enumber\u003c/code\u003e\n    * [.duration([npv])](#Bond+duration) ⇒ \u003ccode\u003enumber\u003c/code\u003e\n\n\u003ca name=\"new_Bond_new\"\u003e\u003c/a\u003e\n\n##### new Bond(notional, coupon, start, end, frequency)\nCreates an instance of a coupon-paying bond.\n\n\n| Param | Type | Description |\n| --- | --- | --- |\n| notional | \u003ccode\u003enumber\u003c/code\u003e | notional payment, i.e. last cashflow and reference amount for [notional](notional) |\n| coupon | \u003ccode\u003enumber\u003c/code\u003e | annual coupon relative to [notional](notional) (i.e. 0.04 for 4%, not a currency amount) |\n| start | \u003ccode\u003enumber\u003c/code\u003e | start time of bond (schedule will be rolled from [end](end)) |\n| end | \u003ccode\u003enumber\u003c/code\u003e | end time of bond (time of notional payment) |\n| frequency | \u003ccode\u003enumber\u003c/code\u003e | number of payments per year |\n\n\u003ca name=\"Bond+cashflows\"\u003e\u003c/a\u003e\n\n##### bond.cashflows ⇒ [\u003ccode\u003eArray.\u0026lt;FixedCashflow\u0026gt;\u003c/code\u003e](#FixedCashflow)\nCashflows of this bond as an array.\nLast coupon and notional payment are returned separately.\nFor zero bonds (i.e. coupon === 0), only the notional payment is returned as cashflow.\n\n**Kind**: instance property of [\u003ccode\u003eBond\u003c/code\u003e](#Bond)  \n\u003ca name=\"Bond+forwardDirtyPrice\"\u003e\u003c/a\u003e\n\n##### bond.forwardDirtyPrice(discountCurve, t) ⇒ \u003ccode\u003enumber\u003c/code\u003e\nCalculates the forward price (dirty, i.e. including accrued interest) at time [t](t) for this bond.\n\n**Kind**: instance method of [\u003ccode\u003eBond\u003c/code\u003e](#Bond)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| discountCurve | [\u003ccode\u003eDiscountCurve\u003c/code\u003e](#DiscountCurve) | discount curve (used for discounting and forwards) |\n| t | \u003ccode\u003enumber\u003c/code\u003e | time for which the forward dirty price is to be calculated |\n\n\u003ca name=\"Bond+dirtyPrice\"\u003e\u003c/a\u003e\n\n##### bond.dirtyPrice(discountCurve) ⇒ \u003ccode\u003enumber\u003c/code\u003e\nCalculates the current price (dirty, i.e. including accrued interest) for this bond.\n\n**Kind**: instance method of [\u003ccode\u003eBond\u003c/code\u003e](#Bond)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| discountCurve | [\u003ccode\u003eDiscountCurve\u003c/code\u003e](#DiscountCurve) | discount curve (used for discounting and forwards) |\n\n\u003ca name=\"Bond+yieldToMaturity\"\u003e\u003c/a\u003e\n\n##### bond.yieldToMaturity([npv]) ⇒ \u003ccode\u003enumber\u003c/code\u003e\nCalculates the bond yield given [npv](npv), i.e the flat discount rate\n(continuously compounded) for which the dirty price of the bond equals [npv](npv).\n\n**Kind**: instance method of [\u003ccode\u003eBond\u003c/code\u003e](#Bond)  \n**Returns**: \u003ccode\u003enumber\u003c/code\u003e - bond yield given npv  \n\n| Param | Type | Default | Description |\n| --- | --- | --- | --- |\n| [npv] | \u003ccode\u003enumber\u003c/code\u003e | \u003ccode\u003ethis.notional\u003c/code\u003e | present value of the bond for yield calculation, defaults to 100% (i.e. notional) |\n\n\u003ca name=\"Bond+duration\"\u003e\u003c/a\u003e\n\n##### bond.duration([npv]) ⇒ \u003ccode\u003enumber\u003c/code\u003e\nCalculates the bond duration given npv. There is no difference between Macaulay duration\nand Modified duration here as we use continuous yields for discounting.\n\n**Kind**: instance method of [\u003ccode\u003eBond\u003c/code\u003e](#Bond)  \n**Returns**: \u003ccode\u003enumber\u003c/code\u003e - bond duration given npv  \n\n| Param | Type | Default | Description |\n| --- | --- | --- | --- |\n| [npv] | \u003ccode\u003enumber\u003c/code\u003e | \u003ccode\u003ethis.notional\u003c/code\u003e | present value of the bond for yield calculation, defaults to 100% (i.e. notional) |\n\n\u003ca name=\"irFrequency\"\u003e\u003c/a\u003e\n\n#### irFrequency\nFrequencies expressed as number of payments per year.\n\n**Kind**: global constant  \n\u003ca name=\"irMinimumPeriod\"\u003e\u003c/a\u003e\n\n#### irMinimumPeriod\nMinimum period [irRollFromEnd](#irRollFromEnd) will create.\n\n**Kind**: global constant  \n\u003ca name=\"pdf\"\u003e\u003c/a\u003e\n\n#### pdf(x) ⇒ \u003ccode\u003enumber\u003c/code\u003e\nProbability density function (pdf) for a standard normal distribution.\n\n**Kind**: global function  \n**Returns**: \u003ccode\u003enumber\u003c/code\u003e - density of standard normal distribution  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| x | \u003ccode\u003enumber\u003c/code\u003e | value for which the density is to be calculated |\n\n\u003ca name=\"cdf\"\u003e\u003c/a\u003e\n\n#### cdf(x) ⇒ \u003ccode\u003enumber\u003c/code\u003e\nCumulative distribution function (cdf) for a standard normal distribution.\nApproximation by Zelen, Marvin and Severo, Norman C. (1964),\n[formula 26.2.17](http://people.math.sfu.ca/~cbm/aands/page_932.htm).\n\n**Kind**: global function  \n**Returns**: \u003ccode\u003enumber\u003c/code\u003e - cumulative distribution of standard normal distribution  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| x | \u003ccode\u003enumber\u003c/code\u003e | value for which the cumulative distribution is to be calculated |\n\n\u003ca name=\"margrabesFormula\"\u003e\u003c/a\u003e\n\n#### margrabesFormula(S1, S2, T, sigma1, sigma2, rho, q1, q2, [scale]) ⇒ [\u003ccode\u003ePricingResult\u003c/code\u003e](#PricingResult)\nMargrabe's formula for pricing the exchange option between two risky assets.\n\nSee William  Margrabe, [The Value of an Option to Exchange One Asset for Another](http://www.stat.nus.edu.sg/~stalimtw/MFE5010/PDF/margrabe1978.pdf),\nJournal of Finance, Vol. 33, No. 1, (March 1978), pp. 177-186.\n\n**Kind**: global function  \n\n| Param | Type | Default | Description |\n| --- | --- | --- | --- |\n| S1 | \u003ccode\u003enumber\u003c/code\u003e |  | spot value of the first asset |\n| S2 | \u003ccode\u003enumber\u003c/code\u003e |  | spot value of the second asset |\n| T | \u003ccode\u003enumber\u003c/code\u003e |  | time to maturity (typically expressed in years) |\n| sigma1 | \u003ccode\u003enumber\u003c/code\u003e |  | volatility of the first asset |\n| sigma2 | \u003ccode\u003enumber\u003c/code\u003e |  | volatility of the second asset |\n| rho | \u003ccode\u003enumber\u003c/code\u003e |  | correlation of the Brownian motions driving the asset prices |\n| q1 | \u003ccode\u003enumber\u003c/code\u003e |  | dividend yield of the first asset |\n| q2 | \u003ccode\u003enumber\u003c/code\u003e |  | dividend yield of the second asset |\n| [scale] | \u003ccode\u003enumber\u003c/code\u003e | \u003ccode\u003e1.0\u003c/code\u003e | scaling of all money amount and sensitivity results; think \"number of options\", but with fractional parts allowed |\n\n\u003ca name=\"margrabesFormulaShort\"\u003e\u003c/a\u003e\n\n#### margrabesFormulaShort(S1, S2, T, sigma, q1, q2, [scale]) ⇒ [\u003ccode\u003ePricingResult\u003c/code\u003e](#PricingResult)\nMargrabe's formula for pricing the exchange option between two risky assets.\nEquivalent to `margrabesFormula` but accepting only the volatility corresponding\nto the ratio `S1/S2` instead of their individual volatilities.\n\n**Kind**: global function  \n**See**: margrabesFormula  \n\n| Param | Type | Default | Description |\n| --- | --- | --- | --- |\n| S1 | \u003ccode\u003enumber\u003c/code\u003e |  | spot value of the first asset |\n| S2 | \u003ccode\u003enumber\u003c/code\u003e |  | spot value of the second asset |\n| T | \u003ccode\u003enumber\u003c/code\u003e |  | time to maturity (typically expressed in years) |\n| sigma | \u003ccode\u003enumber\u003c/code\u003e |  | volatility of the ratio of both assets |\n| q1 | \u003ccode\u003enumber\u003c/code\u003e |  | dividend yield of the first asset |\n| q2 | \u003ccode\u003enumber\u003c/code\u003e |  | dividend yield of the second asset |\n| [scale] | \u003ccode\u003enumber\u003c/code\u003e | \u003ccode\u003e1.0\u003c/code\u003e | scaling of all money amount and sensitivity results; think \"number of options\", but with fractional parts allowed |\n\n\u003ca name=\"eqBlackScholes\"\u003e\u003c/a\u003e\n\n#### eqBlackScholes(S, K, T, sigma, q, r, [scale]) ⇒ [\u003ccode\u003eEqPricingResult\u003c/code\u003e](#EqPricingResult)\nBlack-Scholes formula for a European vanilla option on a stock (asset class equity).\n\nSee Fischer Black and Myron Scholes, [The Pricing of Options and Corporate Liabilities](https://www.cs.princeton.edu/courses/archive/fall09/cos323/papers/black_scholes73.pdf),\nThe Journal of Political Economy, Vol. 81, No. 3 (May - June 1973), pp. 637-654.\n\n**Kind**: global function  \n\n| Param | Type | Default | Description |\n| --- | --- | --- | --- |\n| S | \u003ccode\u003enumber\u003c/code\u003e |  | spot value of the stock |\n| K | \u003ccode\u003enumber\u003c/code\u003e |  | strike price of the option |\n| T | \u003ccode\u003enumber\u003c/code\u003e |  | time to maturity (typically expressed in years) |\n| sigma | \u003ccode\u003enumber\u003c/code\u003e |  | volatility of the underlying stock |\n| q | \u003ccode\u003enumber\u003c/code\u003e |  | dividend rate of the underlying stock |\n| r | \u003ccode\u003enumber\u003c/code\u003e |  | risk-less rate of return |\n| [scale] | \u003ccode\u003enumber\u003c/code\u003e | \u003ccode\u003e1.0\u003c/code\u003e | scaling of all money amount and sensitivity results; think \"number of options\", but with fractional parts allowed |\n\n\u003ca name=\"fxBlackScholes\"\u003e\u003c/a\u003e\n\n#### fxBlackScholes(S, K, T, sigma, rFor, rDom, [scale]) ⇒ [\u003ccode\u003ePricingResult\u003c/code\u003e](#PricingResult)\nBlack-Scholes formula for a European vanilla currency option (asset class foreign exchange).\nThis is also known as the Garman–Kohlhagen model.\n\nSee Mark B. Garman and Steven W. Kohlhagen [Foreign currency option values](https://www.sciencedirect.com/science/article/pii/S0261560683800011),\nJournal of International Money and Finance, Vol. 2, Issue 3 (1983), pp. 231-237.\n\n**Kind**: global function  \n**Returns**: [\u003ccode\u003ePricingResult\u003c/code\u003e](#PricingResult) - prices in domestic currency  \n\n| Param | Type | Default | Description |\n| --- | --- | --- | --- |\n| S | \u003ccode\u003enumber\u003c/code\u003e |  | spot value of the currency exchange rate; this has to be expressed in unit of domestic currency / unit of foreign currency |\n| K | \u003ccode\u003enumber\u003c/code\u003e |  | strike price of the option |\n| T | \u003ccode\u003enumber\u003c/code\u003e |  | time to maturity (typically expressed in years) |\n| sigma | \u003ccode\u003enumber\u003c/code\u003e |  | volatility of the currency exchange rate |\n| rFor | \u003ccode\u003enumber\u003c/code\u003e |  | risk-less rate of return in the foreign currency |\n| rDom | \u003ccode\u003enumber\u003c/code\u003e |  | risk-less rate of return in the domestic currency |\n| [scale] | \u003ccode\u003enumber\u003c/code\u003e | \u003ccode\u003e1.0\u003c/code\u003e | scaling of all money amount and sensitivity results; think \"number of options\", but with fractional parts allowed |\n\n\u003ca name=\"irBlack76\"\u003e\u003c/a\u003e\n\n#### irBlack76(F, K, T, sigma, r, [scale]) ⇒ [\u003ccode\u003ePricingResult\u003c/code\u003e](#PricingResult)\nBlack-Scholes formula for European option on forward / future (asset class interest rates),\nknown as the Black 76 model.\n\nSee Fischer Black [The pricing of commodity contracts](https://www.sciencedirect.com/science/article/abs/pii/0304405X76900246),\nJournal of Financial Economics, 3 (1976), 167-179.\n\n**Kind**: global function  \n**Returns**: [\u003ccode\u003ePricingResult\u003c/code\u003e](#PricingResult) - prices of forward / future option  \n\n| Param | Type | Default | Description |\n| --- | --- | --- | --- |\n| F | \u003ccode\u003enumber\u003c/code\u003e |  | forward price of the underlying |\n| K | \u003ccode\u003enumber\u003c/code\u003e |  | strike price of the option |\n| T | \u003ccode\u003enumber\u003c/code\u003e |  | time to maturity (typically expressed in years) |\n| sigma | \u003ccode\u003enumber\u003c/code\u003e |  | volatility of the underlying forward price |\n| r | \u003ccode\u003enumber\u003c/code\u003e |  | risk-less rate of return |\n| [scale] | \u003ccode\u003enumber\u003c/code\u003e | \u003ccode\u003e1.0\u003c/code\u003e | scaling of all money amount and sensitivity results; think \"number of options\", but with fractional parts allowed |\n\n\u003ca name=\"irBlack76BondOption\"\u003e\u003c/a\u003e\n\n#### irBlack76BondOption(bond, K, T, sigma, spotCurve) ⇒ [\u003ccode\u003ePricingResult\u003c/code\u003e](#PricingResult)\nBlack 76 model for an option on a coupon-paying bond (asset class interest rates).\n\n**Kind**: global function  \n**Returns**: [\u003ccode\u003ePricingResult\u003c/code\u003e](#PricingResult) - prices of bond options  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| bond | [\u003ccode\u003eBond\u003c/code\u003e](#Bond) | underlying bond of the option |\n| K | \u003ccode\u003enumber\u003c/code\u003e | (dirty) strike price of the option |\n| T | \u003ccode\u003enumber\u003c/code\u003e | time to maturity (typically expressed in years) |\n| sigma | \u003ccode\u003enumber\u003c/code\u003e | volatility of the bond forward price |\n| spotCurve | [\u003ccode\u003eSpotCurve\u003c/code\u003e](#SpotCurve) | risk-less spot curve (used for forwards and discounting) |\n\n\u003ca name=\"irBlack76CapletFloorlet\"\u003e\u003c/a\u003e\n\n#### irBlack76CapletFloorlet(floatingRate, K, sigma, spotCurve) ⇒ [\u003ccode\u003ePricingResult\u003c/code\u003e](#PricingResult)\nBlack 76 model for a caplet / floorlet (asset class interest rates).\nNotional is retrieved from floatingRate.notional.\n\n**Kind**: global function  \n**Returns**: [\u003ccode\u003ePricingResult\u003c/code\u003e](#PricingResult) - prices of caplet / floorlet  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| floatingRate | [\u003ccode\u003eFloatingCashflow\u003c/code\u003e](#FloatingCashflow) | underlying floating rate of the option |\n| K | \u003ccode\u003enumber\u003c/code\u003e | strike price of the option |\n| sigma | \u003ccode\u003enumber\u003c/code\u003e | volatility of the floating rate |\n| spotCurve | [\u003ccode\u003eSpotCurve\u003c/code\u003e](#SpotCurve) | risk-less spot curve (used for forwards and discounting) |\n\n\u003ca name=\"irForwardLinearRate\"\u003e\u003c/a\u003e\n\n#### irForwardLinearRate(floatingRate, discountCurve)\nCalculates the linear forward rate given a floating cashflow and a discount curve.\n\n**Kind**: global function  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| floatingRate | [\u003ccode\u003eFloatingCashflow\u003c/code\u003e](#FloatingCashflow) | floating rate (notional is ignored) |\n| discountCurve | [\u003ccode\u003eDiscountCurve\u003c/code\u003e](#DiscountCurve) | discount curve used for forwards |\n\n\u003ca name=\"irForwardPrice\"\u003e\u003c/a\u003e\n\n#### irForwardPrice(cashflows, discountCurve, t) ⇒ \u003ccode\u003enumber\u003c/code\u003e\nCalculates the forward price at time t for a series of cashflows.\nCashflows before t are ignored (i.e. do not add any value).\n\n**Kind**: global function  \n**Returns**: \u003ccode\u003enumber\u003c/code\u003e - forward price of given cashflows  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| cashflows | [\u003ccode\u003eArray.\u0026lt;Cashflow\u0026gt;\u003c/code\u003e](#Cashflow) | future cashflows to be paid |\n| discountCurve | [\u003ccode\u003eDiscountCurve\u003c/code\u003e](#DiscountCurve) | discount curve (used for discounting and forwards) |\n| t | \u003ccode\u003enumber\u003c/code\u003e | time point of the forward (typically expressed in years) |\n\n\u003ca name=\"irRollFromEnd\"\u003e\u003c/a\u003e\n\n#### irRollFromEnd(start, end, frequency) ⇒ \u003ccode\u003eArray.\u0026lt;number\u0026gt;\u003c/code\u003e\nCreates a payment schedule with payment frequency [frequency](frequency)\nthat has last payment at [end](end) and no payments before [start](start).\nFirst payment period is (possibly) shorter than later periods.\n\n**Kind**: global function  \n**Returns**: \u003ccode\u003eArray.\u0026lt;number\u0026gt;\u003c/code\u003e - payment times  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| start | \u003ccode\u003enumber\u003c/code\u003e | start time of schedule (usually expressed in years) |\n| end | \u003ccode\u003enumber\u003c/code\u003e | end time of schedule (usually expressed in years) |\n| frequency | \u003ccode\u003enumber\u003c/code\u003e | number of payments per time unit (usually per year) |\n\n\u003ca name=\"irFlatDiscountCurve\"\u003e\u003c/a\u003e\n\n#### irFlatDiscountCurve(flatRate) ⇒ [\u003ccode\u003eDiscountCurve\u003c/code\u003e](#DiscountCurve)\nCreates a [DiscountCurve](#DiscountCurve) discounting with the constant [flatRate](flatRate).\n\n**Kind**: global function  \n\n| Param | Type |\n| --- | --- |\n| flatRate | \u003ccode\u003enumber\u003c/code\u003e | \n\n\u003ca name=\"irLinearInterpolationSpotCurve\"\u003e\u003c/a\u003e\n\n#### irLinearInterpolationSpotCurve(spotRates) ⇒ [\u003ccode\u003eSpotCurve\u003c/code\u003e](#SpotCurve)\nCreates a [SpotCurve](#SpotCurve) by linearly interpolating the given points in time.\nExtrapolation in both directions is constant.\n\n**Kind**: global function  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| spotRates | [\u003ccode\u003eArray.\u0026lt;SpotRate\u0026gt;\u003c/code\u003e](#SpotRate) | individual spot rates used for interpolation; will be sorted automatically |\n\n\u003ca name=\"irSpotCurve2DiscountCurve\"\u003e\u003c/a\u003e\n\n#### irSpotCurve2DiscountCurve(spotCurve) ⇒ [\u003ccode\u003eDiscountCurve\u003c/code\u003e](#DiscountCurve)\nTurns a [SpotCurve](#SpotCurve) into a [DiscountCurve](#DiscountCurve).\nInverse of [irDiscountCurve2SpotCurve](#irDiscountCurve2SpotCurve).\n\n**Kind**: global function  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| spotCurve | [\u003ccode\u003eSpotCurve\u003c/code\u003e](#SpotCurve) | spot rate curve to be converted |\n\n\u003ca name=\"irDiscountCurve2SpotCurve\"\u003e\u003c/a\u003e\n\n#### irDiscountCurve2SpotCurve(discountCurve) ⇒ [\u003ccode\u003eSpotCurve\u003c/code\u003e](#SpotCurve)\nTurns a [DiscountCurve](#DiscountCurve) into a [SpotCurve](#SpotCurve).\nInverse of [irSpotCurve2DiscountCurve](#irSpotCurve2DiscountCurve).\n\n**Kind**: global function  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| discountCurve | [\u003ccode\u003eDiscountCurve\u003c/code\u003e](#DiscountCurve) | discount curve to be converted |\n\n\u003ca name=\"irInternalRateOfReturn\"\u003e\u003c/a\u003e\n\n#### irInternalRateOfReturn(cashflows, [r0], [r1], [abstol], [maxiter]) ⇒ \u003ccode\u003enumber\u003c/code\u003e\nCalculates the internal rate of return (IRR) of the given series of cashflows,\ni.e. the flat discount rate (continuously compounded) for which the total NPV of\nthe given cashflows is 0. The secant method is used. If no IRR can be found\nafter [maxiter](maxiter) iteration, an exception is thrown.\n\n**Kind**: global function  \n**Returns**: \u003ccode\u003enumber\u003c/code\u003e - continuously compounded IRR  \n\n| Param | Type | Default | Description |\n| --- | --- | --- | --- |\n| cashflows | [\u003ccode\u003eArray.\u0026lt;FixedCashflow\u0026gt;\u003c/code\u003e](#FixedCashflow) |  | cashflows for which the IRR is to be calculated |\n| [r0] | \u003ccode\u003enumber\u003c/code\u003e | \u003ccode\u003e0\u003c/code\u003e | first guess for IRR |\n| [r1] | \u003ccode\u003enumber\u003c/code\u003e | \u003ccode\u003e0.05\u003c/code\u003e | second guess for IRR, may not be equal to [r0](r0) |\n| [abstol] | \u003ccode\u003enumber\u003c/code\u003e | \u003ccode\u003e1e-8\u003c/code\u003e | absolute tolerance to accept the current rate as solution |\n| [maxiter] | \u003ccode\u003enumber\u003c/code\u003e | \u003ccode\u003e100\u003c/code\u003e | maximum number of secant method iteration after which root finding aborts |\n\n\u003ca name=\"PricingResult\"\u003e\u003c/a\u003e\n\n#### PricingResult : \u003ccode\u003eObject\u003c/code\u003e\n**Kind**: global typedef  \n**Properties**\n\n| Name | Type | Description |\n| --- | --- | --- |\n| call | [\u003ccode\u003eOptionPricingResult\u003c/code\u003e](#OptionPricingResult) | results for the call option |\n| put | [\u003ccode\u003eOptionPricingResult\u003c/code\u003e](#OptionPricingResult) | results for the put optionCall |\n| digitalCall | [\u003ccode\u003eOptionPricingResult\u003c/code\u003e](#OptionPricingResult) | results for digital call option |\n| digitalPut | [\u003ccode\u003eOptionPricingResult\u003c/code\u003e](#OptionPricingResult) | results for digital put option |\n| N_d1 | \u003ccode\u003enumber\u003c/code\u003e | cumulative probability of `d1` |\n| N_d2 | \u003ccode\u003enumber\u003c/code\u003e | cumulative probability of `d2` |\n| d1 | \u003ccode\u003enumber\u003c/code\u003e |  |\n| d2 | \u003ccode\u003enumber\u003c/code\u003e |  |\n| sigma | \u003ccode\u003enumber\u003c/code\u003e | pricing volatility |\n\n\u003ca name=\"EqPricingResult\"\u003e\u003c/a\u003e\n\n#### EqPricingResult : [\u003ccode\u003ePricingResult\u003c/code\u003e](#PricingResult)\n**Kind**: global typedef  \n**Properties**\n\n| Name | Type | Description |\n| --- | --- | --- |\n| digitalCall | [\u003ccode\u003eOptionPricingResult\u003c/code\u003e](#OptionPricingResult) | results for digital (a.k.a. binary) call option |\n| digitalPut | [\u003ccode\u003eOptionPricingResult\u003c/code\u003e](#OptionPricingResult) | results for digital (a.k.a. binary) put option |\n\n\u003ca name=\"OptionPricingResult\"\u003e\u003c/a\u003e\n\n#### OptionPricingResult : \u003ccode\u003eObject\u003c/code\u003e\n**Kind**: global typedef  \n**Properties**\n\n| Name | Type | Description |\n| --- | --- | --- |\n| price | \u003ccode\u003enumber\u003c/code\u003e | price of the option |\n| delta | \u003ccode\u003enumber\u003c/code\u003e | delta, i.e. derivative by (first) underlying of the option |\n| gamma | \u003ccode\u003enumber\u003c/code\u003e | gamma, i.e. second derivative by (first) underlying of the option |\n| logSimpleMoneyness | \u003ccode\u003enumber\u003c/code\u003e | logarithm of simple moneyness, i.e. ln(forward / strike) |\n| standardizedMoneyness | \u003ccode\u003enumber\u003c/code\u003e | standardized logSimpleMoneyness, i.e. ln(forward / strike) / (sigma * sqrt(T)) |\n\n\u003ca name=\"DiscountCurve\"\u003e\u003c/a\u003e\n\n#### DiscountCurve ⇒ \u003ccode\u003enumber\u003c/code\u003e\n**Kind**: global typedef  \n**Returns**: \u003ccode\u003enumber\u003c/code\u003e - discount factor at time t  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| t | \u003ccode\u003enumber\u003c/code\u003e | time (typically expressed in years) |\n\n\u003ca name=\"SpotCurve\"\u003e\u003c/a\u003e\n\n#### SpotCurve ⇒ \u003ccode\u003enumber\u003c/code\u003e\n**Kind**: global typedef  \n**Returns**: \u003ccode\u003enumber\u003c/code\u003e - spot interest rate to time t  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| t | \u003ccode\u003enumber\u003c/code\u003e | time (typically expressed in years) |\n\n\u003ca name=\"SpotRate\"\u003e\u003c/a\u003e\n\n#### SpotRate : \u003ccode\u003eObject\u003c/code\u003e\n**Kind**: global typedef  \n**Properties**\n\n| Name | Type | Description |\n| --- | --- | --- |\n| t | \u003ccode\u003enumber\u003c/code\u003e | time (typically expressed in years) |\n| rate | \u003ccode\u003enumber\u003c/code\u003e | spot rate to time [t](t) |\n\n\u003ca name=\"FixedCashflow\"\u003e\u003c/a\u003e\n\n#### FixedCashflow : \u003ccode\u003eObject\u003c/code\u003e\n**Kind**: global typedef  \n**Properties**\n\n| Name | Type | Description |\n| --- | --- | --- |\n| t | \u003ccode\u003enumber\u003c/code\u003e | time (typically expressed in years) |\n| value | \u003ccode\u003enumber\u003c/code\u003e | cash amount paid at t |\n\n\u003ca name=\"FloatingCashflow\"\u003e\u003c/a\u003e\n\n#### FloatingCashflow : \u003ccode\u003eObject\u003c/code\u003e\n**Kind**: global typedef  \n**Properties**\n\n| Name | Type | Description |\n| --- | --- | --- |\n| t | \u003ccode\u003enumber\u003c/code\u003e | fixing time |\n| T | \u003ccode\u003enumber\u003c/code\u003e | payment time, yearfraction is T - t |\n| notional | \u003ccode\u003enumber\u003c/code\u003e | notional amount that the rate fixed at will refer to |\n\n\u003ca name=\"Cashflow\"\u003e\u003c/a\u003e\n\n#### Cashflow : [\u003ccode\u003eFixedCashflow\u003c/code\u003e](#FixedCashflow) \\| [\u003ccode\u003eFloatingCashflow\u003c/code\u003e](#FloatingCashflow)\n**Kind**: global typedef  \n## History\n\n### 0.7.0 (not yet)\n* introduce [`FloatingCashflows`](#FloatingCashflow), supported by [`irForwardPrice`](#irForwardPrice)\n* implement [`duration`](#Bond+duration) method for [`Bonds`](#Bond)\n* add `scale` parameter to option pricing functions\n* add `logSimpleMoneyness` and `standardizedMoneyness` to [OptionPricingResult](#OptionPricingResult)\n- migrate from Travis-CI to [GitHub Actions]((https://github.com/luphord/gaussian-analytics/actions/workflows/test-lint.yml))\n* upgrade development dependencies\n\n### 0.6.1 (2020-06-24)\n* assert parameter types and numerical ranges of [`Bond`](#Bond) [`irRollFromEnd`](#irRollFromEnd), [Bond.yieldToMaturity](#Bond+yieldToMaturity), [`cdf`](#cdf), [`pdf`](#pdf), [`irFlatDiscountCurve`](#irFlatDiscountCurve), [`irLinearInterpolationSpotCurve`](#irLinearInterpolationSpotCurve), [`irInternalRateOfReturn`](#irInternalRateOfReturn) and curve conversion methods\n* ensure non-empty arrays in [`irLinearInterpolationSpotCurve`](#irLinearInterpolationSpotCurve) and [`irInternalRateOfReturn`](#irInternalRateOfReturn)\n* do not modify spotRates passed to [`irLinearInterpolationSpotCurve`](#irLinearInterpolationSpotCurve)\n* for zero bonds (i.e. coupon === 0), only the notional payment is returned as cashflow by [Bond.cashflows](#Bond+cashflows)\n\n### 0.6.0 (2020-06-07)\n* implement [`irBlack76`](#irBlack76) (Black-Scholes formula for futures / forwards, particularly in interest rates)\n* implement [`irBlack76BondOption`](#irBlack76BondOption) for specifically evaluating options on coupon-paying bonds\n* implement [`irForwardPrice`](#irForwardPrice) for calculation of forward prices for fixed cashflows\n* implement [`irRollFromEnd`](#irRollFromEnd) for creating regular payment schedules\n* implement [`irInternalRateOfReturn`](#irInternalRateOfReturn) to solve for IRR using the secant method\n* implement class [`Bond`](#Bond) with methods for obtaining cashflows, (forward) dirty price and yield to maturity\n* implement helper and conversion functions for dealing with spot and discount curves\n\n### 0.5.0 (2020-05-30)\n* BREAKING CHANGE: move `callPrice` to `call.price` and `putPrice` to `put.price` on `PricingResult` objects; this will simplify the addition of greeks to results\n* implement [delta and gamma](#OptionPricingResult) (first- and second-order sensitivity of option price to spot change)\n* implement digital calls and puts for [equity options](#EqPricingResult)\n\n### 0.4.1 (2020-05-17)\n* assertions for parameter types and numerical ranges\n* test for fx pricing symmetry under currency switching\n\n### 0.4.0 (2020-05-17)\n* BREAKING CHANGE: rename `price` to `callPrice` in the result of Margrabe's formulas\n* implement [`eqBlackScholes`](#eqBlackScholes) (Black-Scholes formula for stock options) \n* implement [`fxBlackScholes`](#fxBlackScholes) (Black-Scholes formula for currency options)\n\n### 0.3.0 (2020-05-10)\n* implement [`margrabesFormula`](#margrabesFormula) and [`margrabesFormulaShort`](#margrabesFormulaShort)\n* first test cases for the correctness of Margrabe's formula implementation\n\n### 0.2.0 (2020-05-09)\n* `cdf` (cumulative distribution function) for a standard normal distribution\n* test case for relationship between `cdf` and `pdf`\n\n### 0.1.3 (2020-05-09)\n* extract normalizing constant for improved performance\n* test pdf example values\n* set up `eslint` linting (also on [Travis CI](https://travis-ci.com/github/luphord/gaussian-analytics))\n\n### 0.1.2 (2020-05-09)\n* integrate API doc in README\n* API doc in README can automatically be updated by running `npm run update-docs`\n* set up `.npmignore`\n\n### 0.1.1 (2020-05-09)\n* add first tests\n* set up CI infrastructure with [Travis CI](https://travis-ci.com/github/luphord/gaussian-analytics) for testing\n\n### 0.1.0 (2020-05-09)\n* `pdf` (probability density function) for a standard normal distribution\n* First release on [npm](https://www.npmjs.com/package/gaussian-analytics)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fluphord%2Fgaussian-analytics","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fluphord%2Fgaussian-analytics","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fluphord%2Fgaussian-analytics/lists"}