Commit 6433ce5
Add Merton jump-diffusion and fix variance/percentile estimators
Parity with Axis2/C commit 6e577eb + review fixes fb40242, 0b281fd.
Merton (1976) jump-diffusion model:
- New request fields: model ("gbm"|"merton"), jumpIntensity,
jumpMean, jumpVol — all with defaults matching C implementation.
- Drift correction: (μ − σ²/2 − λk)·dt preserves E[S(T)].
- Bernoulli jump process with lambda·dt validation (> 0.1 rejected).
- Response includes "model" field echoing which model was used.
Numerical stability (from Gemini quant review):
- Replaced one-pass variance (sumSq/N − mean²) with two-pass
algorithm. The one-pass formula suffers catastrophic cancellation
when stdDev << mean.
- Fixed VaR percentile indexing: ceil(p·N) − 1 instead of
floor(p·N). The floor estimator selects one observation too far
from the tail, systematically understating VaR.
All existing tests pass.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent e600831 commit 6433ce5
3 files changed
Lines changed: 122 additions & 15 deletions
File tree
- modules/samples/userguide/src/userguide/springbootdemo-tomcat11/src/main/java/userguide/springboot/webservices
Lines changed: 62 additions & 14 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
365 | 365 | | |
366 | 366 | | |
367 | 367 | | |
368 | | - | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
369 | 379 | | |
370 | 380 | | |
371 | | - | |
372 | | - | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
373 | 384 | | |
374 | 385 | | |
375 | 386 | | |
376 | | - | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
377 | 405 | | |
378 | 406 | | |
379 | 407 | | |
| |||
386 | 414 | | |
387 | 415 | | |
388 | 416 | | |
389 | | - | |
390 | 417 | | |
391 | 418 | | |
392 | 419 | | |
| |||
399 | 426 | | |
400 | 427 | | |
401 | 428 | | |
402 | | - | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
403 | 441 | | |
404 | 442 | | |
405 | 443 | | |
| |||
411 | 449 | | |
412 | 450 | | |
413 | 451 | | |
414 | | - | |
415 | 452 | | |
416 | 453 | | |
417 | 454 | | |
418 | 455 | | |
419 | 456 | | |
420 | 457 | | |
421 | 458 | | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
422 | 463 | | |
423 | | - | |
424 | | - | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
425 | 470 | | |
426 | 471 | | |
427 | 472 | | |
428 | | - | |
429 | | - | |
| 473 | + | |
430 | 474 | | |
431 | 475 | | |
432 | | - | |
433 | | - | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
434 | 481 | | |
435 | 482 | | |
436 | 483 | | |
| |||
467 | 514 | | |
468 | 515 | | |
469 | 516 | | |
470 | | - | |
| 517 | + | |
471 | 518 | | |
472 | 519 | | |
473 | 520 | | |
474 | 521 | | |
475 | 522 | | |
476 | 523 | | |
477 | 524 | | |
| 525 | + | |
478 | 526 | | |
479 | 527 | | |
480 | 528 | | |
| |||
Lines changed: 54 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
24 | | - | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
25 | 27 | | |
26 | 28 | | |
27 | 29 | | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
28 | 41 | | |
29 | 42 | | |
30 | 43 | | |
| |||
196 | 209 | | |
197 | 210 | | |
198 | 211 | | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
199 | 244 | | |
200 | 245 | | |
201 | 246 | | |
| |||
218 | 263 | | |
219 | 264 | | |
220 | 265 | | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
221 | 270 | | |
222 | 271 | | |
223 | 272 | | |
| |||
230 | 279 | | |
231 | 280 | | |
232 | 281 | | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
233 | 286 | | |
Lines changed: 6 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
81 | 81 | | |
82 | 82 | | |
83 | 83 | | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
84 | 87 | | |
85 | 88 | | |
86 | 89 | | |
| |||
161 | 164 | | |
162 | 165 | | |
163 | 166 | | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
164 | 170 | | |
0 commit comments