@sheetxl/formulas-extended 0.7.28-beta.4 → 0.8.0-beta.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/browser/esm/{BKnXVC21NesUzU9t.mjs → B8U2Eza2ZD4YA-kx.mjs} +1 -1
- package/browser/esm/{DxiRpwBhgWoK5Erd.mjs → BFtgupqxZCxn0dyD.mjs} +5 -5
- package/browser/esm/{DsJzZKURvUm7apNu.mjs → Bg1eKDrYnq3wm8Vk.mjs} +2 -2
- package/browser/esm/Bg54DWqi-iRcswhc.mjs +119 -0
- package/browser/esm/BiXqZc5QZjxe9VkT.mjs +32 -0
- package/browser/esm/BskZz_6FiOeOABjK.mjs +20 -0
- package/browser/esm/C2QrdSuGHG9jhlMh.mjs +23 -0
- package/browser/esm/{CN-pAKHIFQkkdFFB.mjs → C9G09aQXW2LLuPt3.mjs} +1 -1
- package/browser/esm/CFee1d5IBiv4fv1i.mjs +37 -0
- package/browser/esm/{BybuwnuafVL8RdTx.mjs → CHIJMJGn8-ecsv3s.mjs} +3 -3
- package/browser/esm/CJjzoao3hDloxUGc.mjs +19 -0
- package/browser/esm/CcDbY4A8EXqKtmVV.mjs +47 -0
- package/browser/esm/{fhXUc-E6MSehd9Ep.mjs → Cl3Yo2J4W4DMr8oz.mjs} +27 -29
- package/browser/esm/D02eJGMi5PwKHsoL.mjs +58 -0
- package/browser/esm/{XATNfSb9mKkYP5Fr.mjs → DEQlCPiGb8bsBizr.mjs} +6 -6
- package/{node/esm/CsrMSYiKGo3-I_Qk.mjs → browser/esm/DSBsgMaUW3RQ6ceC.mjs} +1 -1
- package/{node/esm/ffkoQUSdLhFyILRL.mjs → browser/esm/Db0ejvxhdCFJuDKI.mjs} +1 -1
- package/{node/esm/DoS1jziW_TXjkH37.mjs → browser/esm/Dcl4zSjM1tlh53wy.mjs} +5 -5
- package/browser/esm/Djzfm7ZsIsQvtPGt.mjs +32 -0
- package/browser/esm/{y9VKeU12ARR9HmtI.mjs → WS_eaJSI0r2L5MVv.mjs} +2 -2
- package/browser/esm/g9IHvvfn4bYTwHgl.mjs +33 -0
- package/browser/esm/index.mjs +3857 -1638
- package/browser/esm/{DnFUggiR6cNYknMt.mjs → yS93vAhNdRw2bt-z.mjs} +1 -1
- package/node/esm/{BKnXVC21NesUzU9t.mjs → B8U2Eza2ZD4YA-kx.mjs} +1 -1
- package/node/esm/{DxiRpwBhgWoK5Erd.mjs → BFtgupqxZCxn0dyD.mjs} +5 -5
- package/node/esm/BHHFJIl22DBeM9aP.mjs +19 -0
- package/node/esm/{DsJzZKURvUm7apNu.mjs → Bg1eKDrYnq3wm8Vk.mjs} +2 -2
- package/node/esm/Bg54DWqi-iRcswhc.mjs +119 -0
- package/node/esm/BiXqZc5QZjxe9VkT.mjs +32 -0
- package/node/esm/BskZz_6FiOeOABjK.mjs +20 -0
- package/node/esm/C2QrdSuGHG9jhlMh.mjs +23 -0
- package/node/esm/{CN-pAKHIFQkkdFFB.mjs → C9G09aQXW2LLuPt3.mjs} +1 -1
- package/node/esm/CFee1d5IBiv4fv1i.mjs +37 -0
- package/node/esm/{v9tvQuvQYcFQ0zOs.mjs → C_IrfNxfWXKc8kjo.mjs} +3 -3
- package/node/esm/{C21UeAwlG4Qkfu1Z.mjs → Cc4Bkwtihl8DmEub.mjs} +1 -1
- package/node/esm/CcDbY4A8EXqKtmVV.mjs +47 -0
- package/node/esm/{fhXUc-E6MSehd9Ep.mjs → Cl3Yo2J4W4DMr8oz.mjs} +27 -29
- package/node/esm/D02eJGMi5PwKHsoL.mjs +58 -0
- package/node/esm/{XATNfSb9mKkYP5Fr.mjs → DEQlCPiGb8bsBizr.mjs} +6 -6
- package/{browser/esm/CsrMSYiKGo3-I_Qk.mjs → node/esm/DSBsgMaUW3RQ6ceC.mjs} +1 -1
- package/{browser/esm/ffkoQUSdLhFyILRL.mjs → node/esm/Db0ejvxhdCFJuDKI.mjs} +1 -1
- package/{browser/esm/DoS1jziW_TXjkH37.mjs → node/esm/Dcl4zSjM1tlh53wy.mjs} +5 -5
- package/node/esm/Djzfm7ZsIsQvtPGt.mjs +32 -0
- package/node/esm/{y9VKeU12ARR9HmtI.mjs → WS_eaJSI0r2L5MVv.mjs} +2 -2
- package/node/esm/g9IHvvfn4bYTwHgl.mjs +33 -0
- package/node/esm/index.mjs +4208 -1970
- package/package.json +5 -6
- package/types/src/.generated/decl/financial/Annuity.decl.d.ts +5 -0
- package/types/src/.generated/decl/financial/{Financial.decl.d.ts → Cashflow.decl.d.ts} +1 -1
- package/types/src/.generated/decl/financial/Convert.decl.d.ts +4 -0
- package/types/src/.generated/decl/financial/Coupon.decl.d.ts +4 -0
- package/types/src/.generated/decl/financial/{Financial2.decl.d.ts → Depreciation.decl.d.ts} +1 -1
- package/types/src/.generated/decl/financial/Growth.decl.d.ts +4 -0
- package/types/src/.generated/decl/financial/{ODD.decl.d.ts → Odd.decl.d.ts} +1 -1
- package/types/src/.generated/decl/financial/{Financial3.decl.d.ts → STOCKHISTORY.decl.d.ts} +1 -1
- package/types/src/.generated/decl/financial/Security.decl.d.ts +4 -0
- package/types/src/.generated/decl/financial/{Financial4.decl.d.ts → SecurityMaturity.decl.d.ts} +1 -1
- package/types/src/.generated/decl/{statistical/TTEST.decl.d.ts → financial/TBill.decl.d.ts} +1 -1
- package/types/src/.generated/decl/lookupReference/GroupBy.decl.d.ts +4 -0
- package/types/src/.generated/decl/lookupReference/PivotBy.decl.d.ts +4 -0
- package/types/src/.generated/decl/statistical/{ETS.decl.d.ts → Ets.decl.d.ts} +1 -1
- package/types/src/.generated/decl/statistical/TTest.decl.d.ts +4 -0
- package/types/src/.generated/desc/financial/Annuity.desc.d.ts +5 -0
- package/types/src/.generated/desc/financial/{Financial.desc.d.ts → Cashflow.desc.d.ts} +1 -1
- package/types/src/.generated/desc/financial/Convert.desc.d.ts +4 -0
- package/types/src/.generated/desc/financial/Coupon.desc.d.ts +4 -0
- package/types/src/.generated/desc/financial/{Financial2.desc.d.ts → Depreciation.desc.d.ts} +1 -1
- package/types/src/.generated/desc/financial/Growth.desc.d.ts +4 -0
- package/types/src/.generated/desc/financial/{ODD.desc.d.ts → Odd.desc.d.ts} +1 -1
- package/types/src/.generated/desc/financial/{Financial3.desc.d.ts → STOCKHISTORY.desc.d.ts} +1 -1
- package/types/src/.generated/desc/financial/Security.desc.d.ts +4 -0
- package/types/src/.generated/desc/financial/{Financial4.desc.d.ts → SecurityMaturity.desc.d.ts} +1 -1
- package/types/src/.generated/desc/{statistical/TTEST.desc.d.ts → financial/TBill.desc.d.ts} +1 -1
- package/types/src/.generated/desc/lookupReference/GroupBy.desc.d.ts +4 -0
- package/types/src/.generated/desc/lookupReference/PivotBy.desc.d.ts +4 -0
- package/types/src/.generated/desc/statistical/{ETS.desc.d.ts → Ets.desc.d.ts} +1 -1
- package/types/src/.generated/desc/statistical/TTest.desc.d.ts +4 -0
- package/types/src/_utils/AnyArgs.d.ts +17 -3
- package/types/src/_utils/Consts.d.ts +2 -2
- package/types/src/_utils/FinanaceSolver.d.ts +39 -2
- package/types/src/_utils/FinanceAmor.d.ts +23 -0
- package/types/src/_utils/FinanceCashflow.d.ts +42 -0
- package/types/src/_utils/FinanceCoupon.d.ts +92 -82
- package/types/src/_utils/FinanceDate.d.ts +24 -0
- package/types/src/_utils/FinanceDayCount.d.ts +46 -0
- package/types/src/_utils/FinanceOdd.d.ts +93 -0
- package/types/src/_utils/FinanceSecurity.d.ts +84 -0
- package/types/src/_utils/FinanceUtils.d.ts +37 -1
- package/types/src/_utils/LeastSquares.d.ts +20 -22
- package/types/src/_utils/Pivot.d.ts +205 -0
- package/types/src/_utils/RegexCompile.d.ts +33 -0
- package/types/src/cube/Cube.d.ts +7 -7
- package/types/src/financial/ACCRINT.d.ts +33 -6
- package/types/src/financial/AMORDEGRC.d.ts +22 -40
- package/types/src/financial/Annuity.d.ts +118 -0
- package/types/src/financial/Cashflow.d.ts +84 -0
- package/types/src/financial/Convert.d.ts +26 -0
- package/types/src/financial/Coupon.d.ts +72 -0
- package/types/src/financial/Date.d.ts +34 -5
- package/types/src/financial/Depreciation.d.ts +58 -0
- package/types/src/financial/Growth.d.ts +22 -0
- package/types/src/financial/Odd.d.ts +82 -0
- package/types/src/financial/STOCKHISTORY.d.ts +17 -0
- package/types/src/financial/Security.d.ts +68 -0
- package/types/src/financial/SecurityMaturity.d.ts +107 -0
- package/types/src/financial/TBill.d.ts +40 -0
- package/types/src/financial/VDB.d.ts +15 -13
- package/types/src/lookupReference/GroupBy.d.ts +14 -0
- package/types/src/lookupReference/PivotBy.d.ts +17 -0
- package/types/src/statistical/{ETS.d.ts → Ets.d.ts} +14 -14
- package/types/src/statistical/Regression.d.ts +13 -18
- package/types/src/statistical/{TTEST.d.ts → TTest.d.ts} +5 -5
- package/types/src/text/RegEx.d.ts +34 -11
- package/browser/cjs/B4JJfKSI4ppwU855.cjs +0 -1
- package/browser/cjs/BWDfauDHqB6U_2ka.cjs +0 -1
- package/browser/cjs/BwLx9ix5Sq7suAYP.cjs +0 -1
- package/browser/cjs/C2uDl8VIJqh58YF_.cjs +0 -1
- package/browser/cjs/CW-b31_-r-_raT8Y.cjs +0 -1
- package/browser/cjs/Clu7XiAsCB48GDXN.cjs +0 -1
- package/browser/cjs/CnZfa45XxA-9Jhmp.cjs +0 -1
- package/browser/cjs/DsFZgtSQpC75d1M0.cjs +0 -1
- package/browser/cjs/JfM6P_qoQQTWakZf.cjs +0 -1
- package/browser/cjs/bM25C5avKgBAJVfk.cjs +0 -1
- package/browser/cjs/fqTQ_p3ehzUvc1tF.cjs +0 -1
- package/browser/cjs/h3dw1jAp2J5Pu4p3.cjs +0 -1
- package/browser/cjs/index.cjs +0 -1
- package/browser/cjs/jev6VGWTdgEgm4Yk.cjs +0 -1
- package/browser/cjs/lEQC21-Sk4lwHy2r.cjs +0 -1
- package/browser/esm/C2TyRseZg5dWtMq1.mjs +0 -304
- package/browser/esm/CShl-IMQIPnBMVpb.mjs +0 -20
- package/node/esm/C2TyRseZg5dWtMq1.mjs +0 -304
- package/node/esm/CShl-IMQIPnBMVpb.mjs +0 -20
- package/types/src/financial/Financial.d.ts +0 -283
- package/types/src/financial/Financial2.d.ts +0 -99
- package/types/src/financial/Financial3.d.ts +0 -95
- package/types/src/financial/Financial4.d.ts +0 -82
- package/types/src/financial/ODD.d.ts +0 -106
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Bond / depreciation functions with no coupon-iteration dependency.
|
|
3
|
-
*
|
|
4
|
-
* Every function here reduces to: dates → day-count → one closed-form formula.
|
|
5
|
-
* None of these call the coupon-walking helpers in /utils/Finance.ts.
|
|
6
|
-
*/
|
|
7
|
-
/**
|
|
8
|
-
* @summary Returns the accrued interest for a security that pays interest at maturity.
|
|
9
|
-
* @param issue is the security's issue date, expressed as a serial date number.
|
|
10
|
-
* @param settlement is the security's maturity date, expressed as a serial date number.
|
|
11
|
-
* @param rate is the security's annual coupon rate.
|
|
12
|
-
* @param par is the security's par value.
|
|
13
|
-
* @param basis is the type of day count basis to use.
|
|
14
|
-
*/
|
|
15
|
-
export declare function ACCRINTM(issue: number, // date
|
|
16
|
-
settlement: number, // date
|
|
17
|
-
rate: number, par: number, basis?: number): number;
|
|
18
|
-
/**
|
|
19
|
-
* @summary Returns the interest rate for a fully invested security.
|
|
20
|
-
* @param settlement is the security's settlement date, expressed as a serial date number.
|
|
21
|
-
* @param maturity is the security's maturity date, expressed as a serial date number.
|
|
22
|
-
* @param investment is the amount invested in the security.
|
|
23
|
-
* @param redemption is the amount to be received at maturity.
|
|
24
|
-
* @param basis is the type of day count basis to use.
|
|
25
|
-
*/
|
|
26
|
-
export declare function INTRATE(settlement: number, // date
|
|
27
|
-
maturity: number, // date
|
|
28
|
-
investment: number, redemption: number, basis?: number): number;
|
|
29
|
-
/**
|
|
30
|
-
* @summary Returns the amount received at maturity for a fully invested security.
|
|
31
|
-
* @param settlement is the security's settlement date, expressed as a serial date number.
|
|
32
|
-
* @param maturity is the security's maturity date, expressed as a serial date number.
|
|
33
|
-
* @param investment is the amount invested in the security.
|
|
34
|
-
* @param discount is the security's discount rate.
|
|
35
|
-
* @param basis is the type of day count basis to use.
|
|
36
|
-
*/
|
|
37
|
-
export declare function RECEIVED(settlement: number, // date
|
|
38
|
-
maturity: number, // date
|
|
39
|
-
investment: number, discount: number, basis?: number): number;
|
|
40
|
-
/**
|
|
41
|
-
* @summary Returns the annual yield for a discounted security.
|
|
42
|
-
* @summary Returns the annual yield for a discounted security. For example, a treasury bill.
|
|
43
|
-
* @param settlement is the security's settlement date, expressed as a serial date number.
|
|
44
|
-
* @param maturity is the security's maturity date, expressed as a serial date number.
|
|
45
|
-
* @param pr is the security's price per $100 face value.
|
|
46
|
-
* @param redemption is the security's redemption value per $100 face value.
|
|
47
|
-
* @param basis is the type of day count basis to use.
|
|
48
|
-
*/
|
|
49
|
-
export declare function YIELDDISC(settlement: number, // date
|
|
50
|
-
maturity: number, // date
|
|
51
|
-
pr: number, redemption: number, basis?: number): number;
|
|
52
|
-
/**
|
|
53
|
-
* @summary Returns the price per $100 face value of a security that pays interest at maturity.
|
|
54
|
-
* @summary Returns the price per $100 face value of a security that pays interest at maturity.
|
|
55
|
-
* @param settlement is the security's settlement date, expressed as a serial date number.
|
|
56
|
-
* @param maturity is the security's maturity date, expressed as a serial date number.
|
|
57
|
-
* @param issue is the security's issue date, expressed as a serial date number.
|
|
58
|
-
* @param rate is the interest rate.
|
|
59
|
-
* @param yld is the security's annual yield.
|
|
60
|
-
* @param basis is the type of day count basis to use.
|
|
61
|
-
*/
|
|
62
|
-
export declare function PRICEMAT(settlement: number, // date
|
|
63
|
-
maturity: number, // date
|
|
64
|
-
issue: number, rate: number, yld: number, basis?: number): number;
|
|
65
|
-
/**
|
|
66
|
-
* @summary Returns the annual yield of a security that pays interest at maturity.
|
|
67
|
-
* @param settlement is the security's settlement date, expressed as a serial date number.
|
|
68
|
-
* @param maturity is the security's maturity date, expressed as a serial date number.
|
|
69
|
-
* @param issue is the security's issue date, expressed as a serial date number.
|
|
70
|
-
* @param rate is the interest rate.
|
|
71
|
-
* @param pr is the security's price per $100 face value.
|
|
72
|
-
* @param basis is the type of day count basis to use.
|
|
73
|
-
*/
|
|
74
|
-
export declare function YIELDMAT(settlement: number, // date
|
|
75
|
-
maturity: number, // date
|
|
76
|
-
issue: number, // date
|
|
77
|
-
rate: number, pr: number, basis?: number): number;
|
|
78
|
-
/**
|
|
79
|
-
* @summary Returns the prorated linear depreciation of an asset for each accounting period.
|
|
80
|
-
* @param cost is the cost of the asset.
|
|
81
|
-
* @param datePurchased is the date the asset is purchased.
|
|
82
|
-
* @param firstPeriod is the date of the end of the first period.
|
|
83
|
-
* @param salvage is the salvage value at the end of life of the asset.
|
|
84
|
-
* @param period is the period.
|
|
85
|
-
* @param rate is the rate of depreciation.
|
|
86
|
-
* @param basis year basis : 0 for year of 360 days, 1 for actual, 3 for year of 365 days.
|
|
87
|
-
*
|
|
88
|
-
* @remarks
|
|
89
|
-
* Computes depreciation using a prorated first period (from purchase
|
|
90
|
-
* date to first-period end), then full annual depreciation until the asset is
|
|
91
|
-
* fully depreciated.
|
|
92
|
-
*
|
|
93
|
-
* Note: basis 2 (Actual/360) is not supported by Excel for this function —
|
|
94
|
-
* only bases 0, 1, 3, 4 are valid.
|
|
95
|
-
*/
|
|
96
|
-
export declare function AMORLINC(cost: number, datePurchased: number, // date
|
|
97
|
-
firstPeriod: number, // date
|
|
98
|
-
salvage: number, period: number, rate: number, basis?: number): number;
|
|
99
|
-
//# sourceMappingURL=Financial2.d.ts.map
|
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Coupon date and day-count functions.
|
|
3
|
-
*
|
|
4
|
-
* Shared validation rule for all six:
|
|
5
|
-
* • frequency must be 1 (annual), 2 (semi-annual), or 4 (quarterly)
|
|
6
|
-
* • basis must be 0–4
|
|
7
|
-
* • settlement must be strictly before maturity
|
|
8
|
-
*
|
|
9
|
-
* COUPNCD and COUPPCD return date number numbers, not day counts — the engine
|
|
10
|
-
* will format them as dates when the cell has a date format applied.
|
|
11
|
-
*/
|
|
12
|
-
/**
|
|
13
|
-
* @summary Returns the number of days from the beginning of the coupon period to the settlement date.
|
|
14
|
-
* @param settlement is the security's settlement date, expressed as a serial date number.
|
|
15
|
-
* @param maturity is the security's maturity date, expressed as a serial date number.
|
|
16
|
-
* @param frequency is the number of coupon payments per year.
|
|
17
|
-
* @param basis is the type of day count basis to use.
|
|
18
|
-
*/
|
|
19
|
-
export declare function COUPDAYBS(settlement: number, // date
|
|
20
|
-
maturity: number, // date
|
|
21
|
-
frequency: number, basis?: number): number;
|
|
22
|
-
/**
|
|
23
|
-
* @summary Returns the number of days in the coupon period containing the settlement date.
|
|
24
|
-
* @param settlement Settlement date number number.
|
|
25
|
-
* @param maturity Maturity date number number.
|
|
26
|
-
* @param frequency Coupons per year: 1, 2, or 4.
|
|
27
|
-
* @param basis Day-count basis (0–4). Default 0.
|
|
28
|
-
*/
|
|
29
|
-
export declare function COUPDAYS(settlement: number, // date
|
|
30
|
-
maturity: number, // date
|
|
31
|
-
frequency: number, basis?: number): number;
|
|
32
|
-
/**
|
|
33
|
-
* @summary Returns the number of days from the settlement date to the next coupon date.
|
|
34
|
-
* @param settlement is the security's settlement date, expressed as a serial date number.
|
|
35
|
-
* @param maturity is the security's maturity date, expressed as a serial date number.
|
|
36
|
-
* @param frequency is the number of coupon payments per year.
|
|
37
|
-
* @param basis is the type of day count basis to use.
|
|
38
|
-
*
|
|
39
|
-
* @remarks
|
|
40
|
-
* Implementation note: unlike COUPDAYBS which calls calculateCoupdaybs directly,
|
|
41
|
-
* COUPDAYSNC computes NCD − settlement under the chosen basis rather than
|
|
42
|
-
* subtracting COUPDAYBS from COUPDAYS. The two approaches agree for all
|
|
43
|
-
* 30/360 bases but diverge for actual-day bases when the coupon period spans
|
|
44
|
-
* a month boundary — the direct NCD approach matches Excel.
|
|
45
|
-
*/
|
|
46
|
-
export declare function COUPDAYSNC(settlement: number, // date
|
|
47
|
-
maturity: number, // date
|
|
48
|
-
frequency: number, basis?: number): number;
|
|
49
|
-
/**
|
|
50
|
-
* @summary Returns the next coupon date after the settlement date.
|
|
51
|
-
* @summary Returns the number of days from the beginning of the coupon period to the settlement date.
|
|
52
|
-
* @param settlement is the security's settlement date, expressed as a serial date number.
|
|
53
|
-
* @param maturity is the security's maturity date, expressed as a serial date number.
|
|
54
|
-
* @param frequency is the number of coupon payments per year.
|
|
55
|
-
* @param basis is the type of day count basis to use.
|
|
56
|
-
*
|
|
57
|
-
* @remarks
|
|
58
|
-
* Returns an Excel date number number. The cell should be formatted as a date
|
|
59
|
-
* to display meaningfully.
|
|
60
|
-
*/
|
|
61
|
-
export declare function COUPNCD(settlement: number, // date
|
|
62
|
-
maturity: number, // date
|
|
63
|
-
frequency: number, basis?: number): number;
|
|
64
|
-
/**
|
|
65
|
-
* @summary Returns the previous coupon date before the settlement date.
|
|
66
|
-
* @param settlement is the security's settlement date, expressed as a serial date number.
|
|
67
|
-
* @param maturity is the security's maturity date, expressed as a serial date number.
|
|
68
|
-
* @param frequency is the number of coupon payments per year.
|
|
69
|
-
* @param basis is the type of day count basis to use.
|
|
70
|
-
*
|
|
71
|
-
* @remarks
|
|
72
|
-
* Returns an Excel date number number. The cell should be formatted as a date
|
|
73
|
-
* to display meaningfully.
|
|
74
|
-
*
|
|
75
|
-
* Excel special case: if the calculated PCD is before the Excel epoch (number < 0),
|
|
76
|
-
* Excel returns 0 rather than a negative number. We follow this behavior.
|
|
77
|
-
*/
|
|
78
|
-
export declare function COUPPCD(settlement: number, // date
|
|
79
|
-
maturity: number, // date
|
|
80
|
-
frequency: number, basis?: number): number;
|
|
81
|
-
/**
|
|
82
|
-
* @summary Returns the number of coupons payable between the settlement date and maturity date.
|
|
83
|
-
* @param settlement is the security's settlement date, expressed as a serial date number.
|
|
84
|
-
* @param maturity is the security's maturity date, expressed as a serial date number.
|
|
85
|
-
* @param frequency is the number of coupon payments per year.
|
|
86
|
-
* @param basis is the type of day count basis to use.
|
|
87
|
-
*
|
|
88
|
-
* @remarks
|
|
89
|
-
* Excel special case: if COUPPCD would be negative (bond settling before the
|
|
90
|
-
* Excel epoch), Excel returns #NUM!. We guard this identically.
|
|
91
|
-
*/
|
|
92
|
-
export declare function COUPNUM(settlement: number, // date
|
|
93
|
-
maturity: number, // date
|
|
94
|
-
frequency: number, basis?: number): number;
|
|
95
|
-
//# sourceMappingURL=Financial3.d.ts.map
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @summary Returns the price per $100 face value of a security that pays periodic interest.
|
|
3
|
-
* @param settlement is the security's settlement date, expressed as a serial date number.
|
|
4
|
-
* @param maturity is the security's maturity date, expressed as a serial date number.
|
|
5
|
-
* @param rate is the interest rate.
|
|
6
|
-
* @param yld is the security's annual yield.
|
|
7
|
-
* @param redemption is the amount to be received at maturity.
|
|
8
|
-
* @param frequency is the number of coupon payments per year.
|
|
9
|
-
* @param basis is the type of day count basis to use.
|
|
10
|
-
*
|
|
11
|
-
* @remarks
|
|
12
|
-
* Uses the standard coupon bond pricing formula from the Excel spec.
|
|
13
|
-
* For N=1 (single remaining coupon period) a simplified spec formula is used.
|
|
14
|
-
*/
|
|
15
|
-
export declare function PRICE(settlement: number, // date
|
|
16
|
-
maturity: number, // date
|
|
17
|
-
rate: number, yld: number, redemption: number, frequency: number, basis?: number): number;
|
|
18
|
-
/**
|
|
19
|
-
* @summary Returns the annual duration of a security with periodic interest payments.
|
|
20
|
-
* @param settlement is the security's settlement date, expressed as a serial date number.
|
|
21
|
-
* @param maturity is the security's maturity date, expressed as a serial date number.
|
|
22
|
-
* @param coupon is the security's annual coupon rate.
|
|
23
|
-
* @param yld is the security's annual yield.
|
|
24
|
-
* @param frequency is the number of coupon payments per year.
|
|
25
|
-
* @param basis is the type of day count basis to use.
|
|
26
|
-
*
|
|
27
|
-
* @remarks
|
|
28
|
-
* Duration is the weighted-average time (in years) to receive the bond's cash
|
|
29
|
-
* flows, where each weight is the present value of that cash flow as a
|
|
30
|
-
* fraction of the bond's total price.
|
|
31
|
-
*
|
|
32
|
-
* Excel special case: dates in or before the 1900 epoch (number ≤ 0 for
|
|
33
|
-
* settlement, or ≤ 366 for maturity) return #NUM!.
|
|
34
|
-
*/
|
|
35
|
-
export declare function DURATION(settlement: number, // date
|
|
36
|
-
maturity: number, // date
|
|
37
|
-
coupon: number, yld: number, frequency: number, basis?: number): number;
|
|
38
|
-
/**
|
|
39
|
-
* @summary Returns the Macauley modified duration for a security with an assumed par value of $100.
|
|
40
|
-
* @param settlement is the security's settlement date, expressed as a serial date number.
|
|
41
|
-
* @param maturity is the security's maturity date, expressed as a serial date number.
|
|
42
|
-
* @param coupon is the security's annual coupon rate.
|
|
43
|
-
* @param yld is the security's annual yield.
|
|
44
|
-
* @param frequency is the number of coupon payments per year.
|
|
45
|
-
* @param basis is the type of day count basis to use.
|
|
46
|
-
*
|
|
47
|
-
* @remarks
|
|
48
|
-
* Modified duration = Macaulay duration / (1 + yld / frequency).
|
|
49
|
-
* It measures the percentage price change of a bond for a 1% change in yield.
|
|
50
|
-
*
|
|
51
|
-
* Shares identical parameter validation with DURATION.
|
|
52
|
-
*/
|
|
53
|
-
export declare function MDURATION(settlement: number, // date
|
|
54
|
-
maturity: number, // date
|
|
55
|
-
coupon: number, yld: number, frequency: number, basis?: number): number;
|
|
56
|
-
/**
|
|
57
|
-
* @summary Returns the yield on a security that pays periodic interest.
|
|
58
|
-
* @param settlement is the security's settlement date, expressed as a serial date number.
|
|
59
|
-
* @param maturity is the security's maturity date, expressed as a serial date number.
|
|
60
|
-
* @param rate is the security's annual coupon rate.
|
|
61
|
-
* @param pr is the security's price per $100 face value.
|
|
62
|
-
* @param redemption is the security's redemption value per $100 face value.
|
|
63
|
-
* @param frequency is the number of coupon payments per year.
|
|
64
|
-
* @param basis is the type of day count basis to use.
|
|
65
|
-
*
|
|
66
|
-
* @remarks
|
|
67
|
-
* YIELD is the inverse of PRICE — it finds the yield `y` such that
|
|
68
|
-
* PRICE(settlement, maturity, rate, y, redemption, frequency, basis) = pr.
|
|
69
|
-
*
|
|
70
|
-
* Two cases:
|
|
71
|
-
*
|
|
72
|
-
* N > 1 Newton/secant iteration on calculatePrice (via solveByNewton).
|
|
73
|
-
* Initial guess: the coupon rate, or 0.01 if rate = 0.
|
|
74
|
-
*
|
|
75
|
-
* N = 1 Closed-form rearrangement of the single-period PRICE formula
|
|
76
|
-
* from the Excel spec. No iteration needed.
|
|
77
|
-
*
|
|
78
|
-
*/
|
|
79
|
-
export declare function YIELD(settlement: number, // date
|
|
80
|
-
maturity: number, // date
|
|
81
|
-
rate: number, pr: number, redemption: number, frequency: number, basis?: number): number;
|
|
82
|
-
//# sourceMappingURL=Financial4.d.ts.map
|
|
@@ -1,106 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Odd first and last coupon bond price/yield functions.
|
|
3
|
-
*
|
|
4
|
-
* "Odd" means the first or last coupon period is irregular — shorter or longer
|
|
5
|
-
* than a standard coupon period. This happens when a bond is issued between
|
|
6
|
-
* coupon dates (odd first) or the final coupon date doesn't align with
|
|
7
|
-
* maturity (odd last).
|
|
8
|
-
*
|
|
9
|
-
* Why ODDLPRICE lives here and not in financialHelpers:
|
|
10
|
-
* The odd-last formula uses a different internal structure (_getCoupDate,
|
|
11
|
-
* _getFrac) that is not shared by any other function. Keeping it here avoids
|
|
12
|
-
* polluting the shared helper module with single-use private math.
|
|
13
|
-
*
|
|
14
|
-
* Date ordering requirements:
|
|
15
|
-
* ODDFPRICE/ODDFYIELD: issue < settlement < firstCoupon < maturity
|
|
16
|
-
* ODDLPRICE/ODDLYIELD: lastInterest < settlement < maturity
|
|
17
|
-
*/
|
|
18
|
-
/**
|
|
19
|
-
* @summary Returns the price per $100 face value of a security with an odd first period.
|
|
20
|
-
* @param settlement is the security's settlement date, expressed as a serial date number.
|
|
21
|
-
* @param maturity is the security's maturity date, expressed as a serial date number.
|
|
22
|
-
* @param issue is the security's issue date, expressed as a serial date number.
|
|
23
|
-
* @param firstCoupon is the security's first coupon date, expressed as a serial date number.
|
|
24
|
-
* @param yld is the security's annual yield.
|
|
25
|
-
* @param redemption is the security's redemption value per $100 face value.
|
|
26
|
-
* @param frequency is the number of coupon payments per year.
|
|
27
|
-
* @param basis is the type of day count basis to use.
|
|
28
|
-
*
|
|
29
|
-
* @remarks
|
|
30
|
-
* The first coupon period is "odd" (shorter or longer than normal) when the
|
|
31
|
-
* bond is issued between standard coupon dates.
|
|
32
|
-
*/
|
|
33
|
-
export declare function ODDFPRICE(settlement: number, // date
|
|
34
|
-
maturity: number, // date
|
|
35
|
-
issue: number, // date
|
|
36
|
-
firstCoupon: number, // date
|
|
37
|
-
rate: number, yld: number, redemption: number, frequency: number, basis?: number): number;
|
|
38
|
-
/**
|
|
39
|
-
* @summary Returns the yield of a security with an odd first period.
|
|
40
|
-
* @param settlement is the security's settlement date, expressed as a serial date number.
|
|
41
|
-
* @param maturity is the security's maturity date, expressed as a serial date number.
|
|
42
|
-
* @param issue is the security's issue date, expressed as a serial date number.
|
|
43
|
-
* @param firstCoupon is the security's first coupon date, expressed as a serial date number.
|
|
44
|
-
* @param rate is the security's interest rate.
|
|
45
|
-
* @param pr is the security's price.
|
|
46
|
-
* @param redemption is the security's redemption value per $100 face value.
|
|
47
|
-
* @param frequency is the number of coupon payments per year.
|
|
48
|
-
* @param basis is the type of day count basis to use.
|
|
49
|
-
*
|
|
50
|
-
* @remarks
|
|
51
|
-
* Numerically inverts ODDFPRICE via Newton-Raphson. The initial guess uses
|
|
52
|
-
* the same heuristic as Excel: a linear approximation of yield from the
|
|
53
|
-
* price/day-count relationship.
|
|
54
|
-
*/
|
|
55
|
-
export declare function ODDFYIELD(settlement: number, // date
|
|
56
|
-
maturity: number, // date
|
|
57
|
-
issue: number, // date
|
|
58
|
-
firstCoupon: number, // date
|
|
59
|
-
rate: number, pr: number, redemption: number, frequency: number, basis?: number): number;
|
|
60
|
-
/**
|
|
61
|
-
* @summary Returns the price per $100 face value of a security with an odd last period.
|
|
62
|
-
* @param settlement is the security's settlement date, expressed as a serial date number.
|
|
63
|
-
* @param maturity is the security's maturity date, expressed as a serial date number.
|
|
64
|
-
* @param lastInterest is the security's last coupon date, expressed as a serial date number.
|
|
65
|
-
* @param rate is the interest rate.
|
|
66
|
-
* @param yld is the security's annual yield.
|
|
67
|
-
* @param redemption is the amount to be received at maturity.
|
|
68
|
-
* @param frequency is the number of coupon payments per year.
|
|
69
|
-
* @param basis is the type of day count basis to use.
|
|
70
|
-
*
|
|
71
|
-
* @remarks
|
|
72
|
-
* The last coupon period is "odd" when the final coupon date and maturity do
|
|
73
|
-
* not coincide — i.e. the bond matures between regular coupon dates.
|
|
74
|
-
*
|
|
75
|
-
* Unlike the odd-first functions, the odd-last formula is derived from a
|
|
76
|
-
* different spec formula that expresses price as a function of three
|
|
77
|
-
* fractional period lengths (fAi, fDCi, fDSCi — see _calculateOddLPrice).
|
|
78
|
-
*/
|
|
79
|
-
export declare function ODDLPRICE(settlement: number, // date
|
|
80
|
-
maturity: number, // date
|
|
81
|
-
lastInterest: number, // date
|
|
82
|
-
rate: number, yld: number, redemption: number, frequency: number, basis?: number): number;
|
|
83
|
-
/**
|
|
84
|
-
* @summary Returns the yield of a security with an odd last period.
|
|
85
|
-
* @param settlement is the security's settlement date, expressed as a serial date number.
|
|
86
|
-
* @param maturity is the security's maturity date, expressed as a serial date number.
|
|
87
|
-
* @param lastInterest is the security's last coupon date, expressed as a serial date number.
|
|
88
|
-
* @param rate is the interest rate.
|
|
89
|
-
* @param pr is the security's price.
|
|
90
|
-
* @param redemption is the amount to be received at maturity.
|
|
91
|
-
* @param frequency is the number of coupon payments per year.
|
|
92
|
-
* @param basis is the type of day count basis to use.
|
|
93
|
-
*
|
|
94
|
-
* @remarks
|
|
95
|
-
* For the odd-last case Excel uses a closed-form yield formula (not Newton)
|
|
96
|
-
* because the price formula is linear in yield. We follow the same approach.
|
|
97
|
-
*
|
|
98
|
-
* Formula from the Excel spec:
|
|
99
|
-
* yield = (freq*(redemption−pr) + 100*rate*(fDCi−fAi))
|
|
100
|
-
* / (fDSCi*pr + 100*rate*fAi*fDSCi/freq)
|
|
101
|
-
*/
|
|
102
|
-
export declare function ODDLYIELD(settlement: number, // date
|
|
103
|
-
maturity: number, // date
|
|
104
|
-
lastInterest: number, // date
|
|
105
|
-
rate: number, pr: number, redemption: number, frequency: number, basis?: number): number;
|
|
106
|
-
//# sourceMappingURL=ODD.d.ts.map
|