@retiregolden/engine 0.1.0
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/LICENSE +661 -0
- package/README.md +79 -0
- package/dist/allocation/assetClasses.d.ts +94 -0
- package/dist/allocation/assetClasses.js +215 -0
- package/dist/decisions/annuitization.d.ts +72 -0
- package/dist/decisions/annuitization.js +184 -0
- package/dist/decisions/decisionFixtures.d.ts +48 -0
- package/dist/decisions/decisionFixtures.js +253 -0
- package/dist/decisions/evaluateCandidate.d.ts +61 -0
- package/dist/decisions/evaluateCandidate.js +193 -0
- package/dist/decisions/generators.d.ts +110 -0
- package/dist/decisions/generators.js +667 -0
- package/dist/decisions/index.d.ts +17 -0
- package/dist/decisions/index.js +17 -0
- package/dist/decisions/insightsAdapter.d.ts +27 -0
- package/dist/decisions/insightsAdapter.js +51 -0
- package/dist/decisions/objectives.d.ts +96 -0
- package/dist/decisions/objectives.js +319 -0
- package/dist/decisions/pensionElection.d.ts +112 -0
- package/dist/decisions/pensionElection.js +239 -0
- package/dist/decisions/search.d.ts +51 -0
- package/dist/decisions/search.js +110 -0
- package/dist/decisions/spendingSolver.d.ts +70 -0
- package/dist/decisions/spendingSolver.js +180 -0
- package/dist/decisions/spiaQuotes.d.ts +21 -0
- package/dist/decisions/spiaQuotes.js +43 -0
- package/dist/decisions/stochastic.d.ts +11 -0
- package/dist/decisions/stochastic.js +66 -0
- package/dist/decisions/swrComparator.d.ts +54 -0
- package/dist/decisions/swrComparator.js +89 -0
- package/dist/decisions/tournament.d.ts +53 -0
- package/dist/decisions/tournament.js +104 -0
- package/dist/decisions/types.d.ts +125 -0
- package/dist/decisions/types.js +12 -0
- package/dist/index.d.ts +13 -0
- package/dist/index.js +12 -0
- package/dist/insights/detectors/annuitizationHeadroom.d.ts +11 -0
- package/dist/insights/detectors/annuitizationHeadroom.js +77 -0
- package/dist/insights/detectors/assetLocation.d.ts +9 -0
- package/dist/insights/detectors/assetLocation.js +86 -0
- package/dist/insights/detectors/hecmBufferCandidate.d.ts +12 -0
- package/dist/insights/detectors/hecmBufferCandidate.js +76 -0
- package/dist/insights/detectors/incomeFloorFunded.d.ts +8 -0
- package/dist/insights/detectors/incomeFloorFunded.js +52 -0
- package/dist/insights/detectors/irmaaTierEdge.d.ts +2 -0
- package/dist/insights/detectors/irmaaTierEdge.js +102 -0
- package/dist/insights/detectors/pensionElectionPending.d.ts +11 -0
- package/dist/insights/detectors/pensionElectionPending.js +62 -0
- package/dist/insights/detectors/qcdEfficiency.d.ts +2 -0
- package/dist/insights/detectors/qcdEfficiency.js +62 -0
- package/dist/insights/detectors/rothBridgeHeadroom.d.ts +2 -0
- package/dist/insights/detectors/rothBridgeHeadroom.js +77 -0
- package/dist/insights/detectors/spendingGuardrails.d.ts +2 -0
- package/dist/insights/detectors/spendingGuardrails.js +77 -0
- package/dist/insights/detectors/spendingHeadroom.d.ts +12 -0
- package/dist/insights/detectors/spendingHeadroom.js +92 -0
- package/dist/insights/detectors/ssBridgeGap.d.ts +9 -0
- package/dist/insights/detectors/ssBridgeGap.js +92 -0
- package/dist/insights/detectors/stateRelocation.d.ts +12 -0
- package/dist/insights/detectors/stateRelocation.js +99 -0
- package/dist/insights/detectors/widowsPenalty.d.ts +12 -0
- package/dist/insights/detectors/widowsPenalty.js +145 -0
- package/dist/insights/registry.d.ts +4 -0
- package/dist/insights/registry.js +62 -0
- package/dist/insights/runInsights.d.ts +6 -0
- package/dist/insights/runInsights.js +15 -0
- package/dist/insights/types.d.ts +70 -0
- package/dist/insights/types.js +1 -0
- package/dist/ladder/bridge.d.ts +72 -0
- package/dist/ladder/bridge.js +59 -0
- package/dist/ladder/fedInvest.d.ts +55 -0
- package/dist/ladder/fedInvest.js +77 -0
- package/dist/ladder/fundedRatio.d.ts +41 -0
- package/dist/ladder/fundedRatio.js +46 -0
- package/dist/ladder/ladderMath.d.ts +88 -0
- package/dist/ladder/ladderMath.js +140 -0
- package/dist/longevity/ssaPeriod2022.d.ts +10 -0
- package/dist/longevity/ssaPeriod2022.js +51 -0
- package/dist/longevity/types.d.ts +39 -0
- package/dist/longevity/types.js +1 -0
- package/dist/model/migrations.d.ts +20 -0
- package/dist/model/migrations.js +67 -0
- package/dist/model/plan.d.ts +3108 -0
- package/dist/model/plan.js +1514 -0
- package/dist/montecarlo/frontiers.d.ts +22 -0
- package/dist/montecarlo/frontiers.js +61 -0
- package/dist/montecarlo/historicalReturns.d.ts +27 -0
- package/dist/montecarlo/historicalReturns.js +124 -0
- package/dist/montecarlo/historicalSuites.d.ts +45 -0
- package/dist/montecarlo/historicalSuites.js +102 -0
- package/dist/montecarlo/ltcShock.d.ts +42 -0
- package/dist/montecarlo/ltcShock.js +62 -0
- package/dist/montecarlo/marketModels.d.ts +248 -0
- package/dist/montecarlo/marketModels.js +672 -0
- package/dist/montecarlo/mortality.d.ts +31 -0
- package/dist/montecarlo/mortality.js +61 -0
- package/dist/montecarlo/riskBasedGuardrails.d.ts +93 -0
- package/dist/montecarlo/riskBasedGuardrails.js +200 -0
- package/dist/montecarlo/rng.d.ts +18 -0
- package/dist/montecarlo/rng.js +44 -0
- package/dist/montecarlo/run.d.ts +210 -0
- package/dist/montecarlo/run.js +353 -0
- package/dist/montecarlo/sharedPaths.d.ts +43 -0
- package/dist/montecarlo/sharedPaths.js +28 -0
- package/dist/montecarlo/survival.d.ts +49 -0
- package/dist/montecarlo/survival.js +126 -0
- package/dist/params/data/realYieldCurve2026.d.ts +17 -0
- package/dist/params/data/realYieldCurve2026.js +26 -0
- package/dist/params/data/year2026.d.ts +14 -0
- package/dist/params/data/year2026.js +199 -0
- package/dist/params/index.d.ts +63 -0
- package/dist/params/index.js +134 -0
- package/dist/params/provenance.d.ts +29 -0
- package/dist/params/provenance.js +123 -0
- package/dist/params/state/data/year2026.d.ts +18 -0
- package/dist/params/state/data/year2026.js +581 -0
- package/dist/params/state/index.d.ts +13 -0
- package/dist/params/state/index.js +26 -0
- package/dist/params/state/types.d.ts +73 -0
- package/dist/params/state/types.js +10 -0
- package/dist/params/types.d.ts +201 -0
- package/dist/params/types.js +7 -0
- package/dist/projection/annuityForms.d.ts +62 -0
- package/dist/projection/annuityForms.js +87 -0
- package/dist/projection/compare.d.ts +96 -0
- package/dist/projection/compare.js +216 -0
- package/dist/projection/flatTax.d.ts +7 -0
- package/dist/projection/flatTax.js +14 -0
- package/dist/projection/optimizePlan.d.ts +328 -0
- package/dist/projection/optimizePlan.js +1039 -0
- package/dist/projection/relocation.d.ts +149 -0
- package/dist/projection/relocation.js +317 -0
- package/dist/projection/simulate.d.ts +61 -0
- package/dist/projection/simulate.js +2754 -0
- package/dist/projection/types.d.ts +381 -0
- package/dist/projection/types.js +9 -0
- package/dist/rmd/jointLifeTable.d.ts +8 -0
- package/dist/rmd/jointLifeTable.js +663 -0
- package/dist/rmd/rmd.d.ts +29 -0
- package/dist/rmd/rmd.js +34 -0
- package/dist/scenarios/scenarios.d.ts +70 -0
- package/dist/scenarios/scenarios.js +130 -0
- package/dist/socialSecurity/benefitFactor.d.ts +13 -0
- package/dist/socialSecurity/benefitFactor.js +40 -0
- package/dist/socialSecurity/claimFactor.d.ts +33 -0
- package/dist/socialSecurity/claimFactor.js +58 -0
- package/dist/socialSecurity/disability.d.ts +36 -0
- package/dist/socialSecurity/disability.js +42 -0
- package/dist/socialSecurity/familyMaximum.d.ts +38 -0
- package/dist/socialSecurity/familyMaximum.js +48 -0
- package/dist/socialSecurity/maritalBenefits.d.ts +57 -0
- package/dist/socialSecurity/maritalBenefits.js +87 -0
- package/dist/socialSecurity/nra.d.ts +30 -0
- package/dist/socialSecurity/nra.js +83 -0
- package/dist/socialSecurity/piaFromEarnings.d.ts +100 -0
- package/dist/socialSecurity/piaFromEarnings.js +202 -0
- package/dist/socialSecurity/ssaWageData.d.ts +68 -0
- package/dist/socialSecurity/ssaWageData.js +306 -0
- package/dist/socialSecurity/survivorBenefit.d.ts +61 -0
- package/dist/socialSecurity/survivorBenefit.js +61 -0
- package/dist/spending/abw.d.ts +57 -0
- package/dist/spending/abw.js +80 -0
- package/dist/spending/flexibleGoals.d.ts +62 -0
- package/dist/spending/flexibleGoals.js +136 -0
- package/dist/spending/guardrails.d.ts +78 -0
- package/dist/spending/guardrails.js +100 -0
- package/dist/spending/layers.d.ts +81 -0
- package/dist/spending/layers.js +67 -0
- package/dist/spending/shapePresets.d.ts +42 -0
- package/dist/spending/shapePresets.js +77 -0
- package/dist/strategies/accountEligibility.d.ts +81 -0
- package/dist/strategies/accountEligibility.js +98 -0
- package/dist/strategies/inheritedIra.d.ts +45 -0
- package/dist/strategies/inheritedIra.js +43 -0
- package/dist/strategies/iraBasis.d.ts +48 -0
- package/dist/strategies/iraBasis.js +46 -0
- package/dist/strategies/optimizer.d.ts +307 -0
- package/dist/strategies/optimizer.js +551 -0
- package/dist/strategies/rothBasis.d.ts +67 -0
- package/dist/strategies/rothBasis.js +83 -0
- package/dist/strategies/rothConversion.d.ts +55 -0
- package/dist/strategies/rothConversion.js +83 -0
- package/dist/strategies/sepp.d.ts +38 -0
- package/dist/strategies/sepp.js +53 -0
- package/dist/tax/aca.d.ts +40 -0
- package/dist/tax/aca.js +82 -0
- package/dist/tax/federalTax.d.ts +110 -0
- package/dist/tax/federalTax.js +249 -0
- package/dist/tax/medicare.d.ts +20 -0
- package/dist/tax/medicare.js +36 -0
- package/dist/tax/propertySale.d.ts +46 -0
- package/dist/tax/propertySale.js +35 -0
- package/dist/tax/stateTax.d.ts +66 -0
- package/dist/tax/stateTax.js +198 -0
- package/dist/testing/money.d.ts +7 -0
- package/dist/testing/money.js +17 -0
- package/dist/testing/planFixtures.d.ts +29 -0
- package/dist/testing/planFixtures.js +141 -0
- package/package.json +75 -0
|
@@ -0,0 +1,248 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pluggable stochastic market models (roadmap V4, feature catalog §11).
|
|
3
|
+
*
|
|
4
|
+
* Each model turns an injected RNG into one path of per-year market
|
|
5
|
+
* conditions for the deterministic ledger: an additive return shock (single
|
|
6
|
+
* market factor applied to non-cash investable accounts), a realized
|
|
7
|
+
* inflation rate, and — for plans with allocated accounts — per-class
|
|
8
|
+
* correlated shocks sharing the same allocation schema as the deterministic
|
|
9
|
+
* ledger. Shocks are centered so the expected return stays the plan's own
|
|
10
|
+
* assumption; the models supply dispersion, skew, and the return/inflation
|
|
11
|
+
* co-movement.
|
|
12
|
+
*
|
|
13
|
+
* Configs are plain JSON so they can cross the Web Worker boundary.
|
|
14
|
+
*
|
|
15
|
+
* Extended in the stochastic-market-model-library plan (Track 2) to 15+
|
|
16
|
+
* models. All new models are mean-preserving by default (path avg shock ~0),
|
|
17
|
+
* respect RNG draw ordering (new draws after core for classShocks parity),
|
|
18
|
+
* and default lognormal/historical paths are byte-identical.
|
|
19
|
+
*/
|
|
20
|
+
import { type AssetClassId, type Plan } from '../model/plan.js';
|
|
21
|
+
import type { MarketSeries } from '../projection/types.js';
|
|
22
|
+
import type { Rng } from './rng.js';
|
|
23
|
+
export interface MarketModel {
|
|
24
|
+
/** One simulation path of per-year market conditions. */
|
|
25
|
+
generatePath(rng: Rng, yearCount: number): MarketSeries;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Per-class shock generation for plans with allocated accounts
|
|
29
|
+
* (asset-allocation-and-return-model-v2, step 6). Volatilities come from the
|
|
30
|
+
* resolved Assumptions-level class parameters; the correlation matrix defaults
|
|
31
|
+
* to the documented long-horizon historical one. Enabling this consumes extra
|
|
32
|
+
* RNG draws per year, so it is only switched on when the plan actually has an
|
|
33
|
+
* allocated account — single-return plans keep their exact current paths.
|
|
34
|
+
*/
|
|
35
|
+
export interface ClassShockConfig {
|
|
36
|
+
/** Annual volatility per class, percentage points, ASSET_CLASS_IDS keys. */
|
|
37
|
+
volatilityPctByClass: Record<AssetClassId, number>;
|
|
38
|
+
/** Correlation matrix over ASSET_CLASS_IDS order; default: the documented long-horizon matrix. */
|
|
39
|
+
correlations?: number[][];
|
|
40
|
+
}
|
|
41
|
+
export interface LognormalModelConfig {
|
|
42
|
+
type: 'lognormal';
|
|
43
|
+
/** Annual volatility of the portfolio return, percentage points (default 12). */
|
|
44
|
+
returnVolPct?: number;
|
|
45
|
+
/** Mean inflation, percent (default: the plan's assumption — pass it explicitly). */
|
|
46
|
+
inflationMeanPct: number;
|
|
47
|
+
/** Annual volatility of inflation, percentage points (default 1.5). */
|
|
48
|
+
inflationVolPct?: number;
|
|
49
|
+
/** Correlation between the return shock and inflation (default −0.2). */
|
|
50
|
+
correlation?: number;
|
|
51
|
+
/** Emit per-class correlated shocks for allocated accounts; omit for single-factor only. */
|
|
52
|
+
classShocks?: ClassShockConfig;
|
|
53
|
+
}
|
|
54
|
+
export interface HistoricalModelConfig {
|
|
55
|
+
type: 'historical';
|
|
56
|
+
/**
|
|
57
|
+
* iid: each year sampled independently; block: contiguous blocks keep
|
|
58
|
+
* multi-year momentum/mean-reversion; sequence: full historical replay
|
|
59
|
+
* from a random start. Blocks and sequences wrap around.
|
|
60
|
+
*/
|
|
61
|
+
mode: 'iid' | 'block' | 'sequence';
|
|
62
|
+
/** Stocks share of the sampled portfolio (default 60 ⇒ 60/40). */
|
|
63
|
+
equityWeightPct?: number;
|
|
64
|
+
/** Block length in years for mode 'block' (default 5). */
|
|
65
|
+
blockLengthYears?: number;
|
|
66
|
+
/**
|
|
67
|
+
* Emit per-class shocks keyed off the same sampled historical years: stock
|
|
68
|
+
* classes replay the S&P series, bonds the Treasury series (each centered on
|
|
69
|
+
* its own mean), cash stays unshocked. No extra RNG draws, so the sampled
|
|
70
|
+
* year sequence — and every unallocated account — is unchanged.
|
|
71
|
+
*/
|
|
72
|
+
classShocks?: boolean;
|
|
73
|
+
}
|
|
74
|
+
export interface StudentTModelConfig {
|
|
75
|
+
type: 'student-t';
|
|
76
|
+
/** Degrees of freedom for t (lower = fatter tails; default 5). */
|
|
77
|
+
df?: number;
|
|
78
|
+
/** Annual volatility of the portfolio return, percentage points (default 12). */
|
|
79
|
+
returnVolPct?: number;
|
|
80
|
+
inflationMeanPct: number;
|
|
81
|
+
inflationVolPct?: number;
|
|
82
|
+
correlation?: number;
|
|
83
|
+
classShocks?: ClassShockConfig;
|
|
84
|
+
}
|
|
85
|
+
export interface RegimeSwitchModelConfig {
|
|
86
|
+
type: 'regime-switch';
|
|
87
|
+
/** Bull regime mean *deviation* (real, %; default +4 so symmetric with bear). */
|
|
88
|
+
bullMeanPct?: number;
|
|
89
|
+
/** Bear regime mean *deviation* (real, %; default -4). */
|
|
90
|
+
bearMeanPct?: number;
|
|
91
|
+
/** Bull vol (default 10). */
|
|
92
|
+
bullVolPct?: number;
|
|
93
|
+
/** Bear vol (default 20). */
|
|
94
|
+
bearVolPct?: number;
|
|
95
|
+
/** Probability of switching regime each year (default 0.05). */
|
|
96
|
+
switchProb?: number;
|
|
97
|
+
inflationMeanPct: number;
|
|
98
|
+
inflationVolPct?: number;
|
|
99
|
+
classShocks?: ClassShockConfig;
|
|
100
|
+
}
|
|
101
|
+
export interface CapeConditionedModelConfig {
|
|
102
|
+
type: 'cape-conditioned';
|
|
103
|
+
/** Starting (or current) CAPE; high values reduce forward mean (default 25). */
|
|
104
|
+
startingCape?: number;
|
|
105
|
+
/** Sensitivity: %pt reduction in mean per CAPE point above 20 (default 0.15). */
|
|
106
|
+
capeSensitivity?: number;
|
|
107
|
+
returnVolPct?: number;
|
|
108
|
+
inflationMeanPct: number;
|
|
109
|
+
inflationVolPct?: number;
|
|
110
|
+
correlation?: number;
|
|
111
|
+
classShocks?: ClassShockConfig;
|
|
112
|
+
}
|
|
113
|
+
export interface StationaryBootstrapModelConfig {
|
|
114
|
+
type: 'stationary';
|
|
115
|
+
equityWeightPct?: number;
|
|
116
|
+
/** Expected block length (geometric; default 5). */
|
|
117
|
+
meanBlockLength?: number;
|
|
118
|
+
classShocks?: boolean;
|
|
119
|
+
}
|
|
120
|
+
export interface EmpiricalModelConfig {
|
|
121
|
+
type: 'empirical';
|
|
122
|
+
/** Raw historical (no mean centering) vs centered. Non-centered is "honest" historical mean from data. */
|
|
123
|
+
centered?: boolean;
|
|
124
|
+
equityWeightPct?: number;
|
|
125
|
+
classShocks?: boolean;
|
|
126
|
+
}
|
|
127
|
+
export interface GarchModelConfig {
|
|
128
|
+
type: 'garch';
|
|
129
|
+
/** GARCH(1,1) omega (base var, scaled). Default tuned for ~12% ann vol. */
|
|
130
|
+
omega?: number;
|
|
131
|
+
alpha?: number;
|
|
132
|
+
beta?: number;
|
|
133
|
+
returnVolScalePct?: number;
|
|
134
|
+
inflationMeanPct: number;
|
|
135
|
+
inflationVolPct?: number;
|
|
136
|
+
correlation?: number;
|
|
137
|
+
classShocks?: ClassShockConfig;
|
|
138
|
+
}
|
|
139
|
+
export interface InflationRegimeModelConfig {
|
|
140
|
+
type: 'inflation-regime';
|
|
141
|
+
/** Normal vs high-inflation regime. */
|
|
142
|
+
highInflationMean?: number;
|
|
143
|
+
highInflationProb?: number;
|
|
144
|
+
returnVolPct?: number;
|
|
145
|
+
baseInflationMeanPct: number;
|
|
146
|
+
correlation?: number;
|
|
147
|
+
classShocks?: ClassShockConfig;
|
|
148
|
+
}
|
|
149
|
+
export interface ReversedHistoryModelConfig {
|
|
150
|
+
type: 'reversed-history';
|
|
151
|
+
/** Window length for reversed replay blocks. */
|
|
152
|
+
windowLengthYears?: number;
|
|
153
|
+
equityWeightPct?: number;
|
|
154
|
+
classShocks?: boolean;
|
|
155
|
+
}
|
|
156
|
+
export interface UserShockModelConfig {
|
|
157
|
+
type: 'user-shock';
|
|
158
|
+
/** 1-based year index in the path to apply the shock. */
|
|
159
|
+
shockYear?: number;
|
|
160
|
+
/** Additive shock in that year, percent (e.g. -20 for crash year). */
|
|
161
|
+
shockPct?: number;
|
|
162
|
+
/** Base model after the shock year (lognormal params). */
|
|
163
|
+
baseReturnVolPct?: number;
|
|
164
|
+
inflationMeanPct: number;
|
|
165
|
+
classShocks?: ClassShockConfig;
|
|
166
|
+
}
|
|
167
|
+
export interface GaussianModelConfig {
|
|
168
|
+
type: 'gaussian';
|
|
169
|
+
/** Annual volatility of the portfolio return shock, percentage points (default 12). */
|
|
170
|
+
returnVolPct?: number;
|
|
171
|
+
inflationMeanPct: number;
|
|
172
|
+
inflationVolPct?: number;
|
|
173
|
+
correlation?: number;
|
|
174
|
+
classShocks?: ClassShockConfig;
|
|
175
|
+
}
|
|
176
|
+
export interface AR1ModelConfig {
|
|
177
|
+
type: 'ar1';
|
|
178
|
+
/** Autoregression coefficient phi (0 < phi < 1 for mean reversion; default 0.2). */
|
|
179
|
+
phi?: number;
|
|
180
|
+
returnVolPct?: number;
|
|
181
|
+
inflationMeanPct: number;
|
|
182
|
+
inflationVolPct?: number;
|
|
183
|
+
correlation?: number;
|
|
184
|
+
classShocks?: ClassShockConfig;
|
|
185
|
+
}
|
|
186
|
+
export type MarketModelConfig = LognormalModelConfig | HistoricalModelConfig | StudentTModelConfig | RegimeSwitchModelConfig | CapeConditionedModelConfig | StationaryBootstrapModelConfig | EmpiricalModelConfig | GarchModelConfig | InflationRegimeModelConfig | ReversedHistoryModelConfig | UserShockModelConfig | GaussianModelConfig | AR1ModelConfig;
|
|
187
|
+
export declare function buildLognormalModelConfigForPlan(plan: Plan, returnVolPct?: number): LognormalModelConfig;
|
|
188
|
+
export declare function createMarketModel(config: MarketModelConfig): MarketModel;
|
|
189
|
+
/**
|
|
190
|
+
* Lognormal-correlated model: the yearly gross return multiplier is
|
|
191
|
+
* lognormal with mean 1 (so the shock is mean-preserving around each
|
|
192
|
+
* account's expected return); inflation is normal and correlated with the
|
|
193
|
+
* return shock via a Gaussian copula.
|
|
194
|
+
*/
|
|
195
|
+
export declare function createLognormalModel(config: LognormalModelConfig): MarketModel;
|
|
196
|
+
/**
|
|
197
|
+
* Historical bootstrap over the embedded Shiller/Damodaran annual series.
|
|
198
|
+
* The sampled blended-portfolio return is centered on its historical mean,
|
|
199
|
+
* preserving the plan's expected return while replaying historical
|
|
200
|
+
* dispersion and the realized co-movement of returns and inflation.
|
|
201
|
+
*/
|
|
202
|
+
export declare function createHistoricalModel(config: HistoricalModelConfig): MarketModel;
|
|
203
|
+
/**
|
|
204
|
+
* Student-t fat-tailed returns (mean-preserving). Uses t-distributed shocks
|
|
205
|
+
* scaled to target volatility; lower df => fatter tails than Gaussian.
|
|
206
|
+
* Draws: z_t for return, then inflation copula, then class after.
|
|
207
|
+
*/
|
|
208
|
+
export declare function createStudentTModel(config: StudentTModelConfig): MarketModel;
|
|
209
|
+
/**
|
|
210
|
+
* Simple two-regime Markov switching (bull/bear) on mean and vol.
|
|
211
|
+
* State persists with 1-p switch. Regime means (bullMeanPct / bearMeanPct) are *deviations*
|
|
212
|
+
* from zero so the unconditional expected shock is near zero when bull/bear are symmetric.
|
|
213
|
+
* Inflation is always centered on the provided mean (no regime bias).
|
|
214
|
+
*/
|
|
215
|
+
export declare function createRegimeSwitchModel(config: RegimeSwitchModelConfig): MarketModel;
|
|
216
|
+
/**
|
|
217
|
+
* CAPE-conditioned: starting high CAPE lowers the mean return (linear taper).
|
|
218
|
+
* Uses lognormal base but shifts mu down.
|
|
219
|
+
*/
|
|
220
|
+
export declare function createCapeConditionedModel(config: CapeConditionedModelConfig): MarketModel;
|
|
221
|
+
/** Stationary (Politis-Romano) bootstrap: geometric block lengths. */
|
|
222
|
+
export declare function createStationaryBootstrapModel(config: StationaryBootstrapModelConfig): MarketModel;
|
|
223
|
+
/** Empirical historical: optionally non-centered (raw history mean).
|
|
224
|
+
* Note: non-centered mode outputs raw historical portfolio returns as the "shock".
|
|
225
|
+
* Because the projection always does expected + shock, non-centered will add the
|
|
226
|
+
* historical mean on top of the plan's assumption (potential double-count).
|
|
227
|
+
* UI defaults to centered for correctness; non-centered kept for advanced use.
|
|
228
|
+
*/
|
|
229
|
+
export declare function createEmpiricalModel(config: EmpiricalModelConfig): MarketModel;
|
|
230
|
+
/** GARCH(1,1) approx for vol clustering. Simple recursion on sigma_t. */
|
|
231
|
+
export declare function createGarchModel(config: GarchModelConfig): MarketModel;
|
|
232
|
+
/** Fat-tailed / regime inflation correlated to returns. */
|
|
233
|
+
export declare function createInflationRegimeModel(config: InflationRegimeModelConfig): MarketModel;
|
|
234
|
+
/** Reversed history blocks chosen stochastically (formalized from suites). */
|
|
235
|
+
export declare function createReversedHistoryModel(config: ReversedHistoryModelConfig): MarketModel;
|
|
236
|
+
/** User-specified deterministic shock in one year, then lognormal-ish. */
|
|
237
|
+
export declare function createUserShockModel(config: UserShockModelConfig): MarketModel;
|
|
238
|
+
/**
|
|
239
|
+
* Additive multivariate Gaussian (normal) shocks. Distinct from lognormal:
|
|
240
|
+
* returns can be <-100% in theory (rare), symmetric, no built-in compounding skew.
|
|
241
|
+
* Mean-preserving (shocks centered at 0).
|
|
242
|
+
*/
|
|
243
|
+
export declare function createGaussianModel(config: GaussianModelConfig): MarketModel;
|
|
244
|
+
/**
|
|
245
|
+
* AR(1) mean-reverting shocks. Introduces serial correlation (momentum or reversion)
|
|
246
|
+
* controlled by phi. Distinct dynamics from iid models. Shocks remain mean-zero.
|
|
247
|
+
*/
|
|
248
|
+
export declare function createAR1Model(config: AR1ModelConfig): MarketModel;
|