# Tag Info

## Hot answers tagged numerical-methods

Accepted

### Least Squares Monte Carlo

To compute the price of an American option or a callable instrument in general, at each potential exercise date, one is required to compare its continuation value (discounted risk-neutral expectation ...
• 14.7k
Accepted

• 17.2k

### Heston Model Integration Oscillations

I'd use FFT or similar rather than direct integration. Here is an old paper with Heston example: Option pricing using fractional FFT
• 4,337

### How should I develop my coding ability in order to set myself up for a quant role?

To test your programming skills, try QuantLib. Can you do interest-rate modelling with QuantLib? Can you debug the 10-level C++ template? Do you know how to use day count? Do you know how to use ...
• 2,265

### Architecture of a global pricing library with immutable payoffs

That's the best question that nearly no one asks. I'm with you on Quantlib and Strata, haven't really seen a very good design around but I've seen quite a few bad ones. It is definitely doable and has ...

### What are the industry standards and rules of thumb when it comes to numerical methods?

1> Analytical - Black Scholes formula for Vanilla European options, Digitals. These valuations are just an "interpolation" of traded options. We interpolate the implied volatility from the traded ...
• 996

### Fastest way to calculate YTM from bond price

In my old pricing library I used NR to calculate YTM. That was the fastest that I could find. But, "Alex C" is correct, you can pre-cache. Remember, BT quotes in 64's, so you can easily build up a ...
• 2,623

### C++ code Thomas algorithm for solving a pentadiagonal Ax=b

You are looking to solve a linear system with a band diagonal system matrix $A$ of dimensions $N \times N$ and having the property $m_1 = 2, \, m_2 = 2$, respectively the number of sub-diagonals under ...
• 346
Accepted

### Maximum norm stability for implicit Black-Scholes equation

Note that \begin{align*} U_j^{(n)} &= \frac{U_j^{(n+1)} - a_jU_{j-1}^{(n)} - c_jU_{j+1}^{(n)}}{b_j}\\ &\le \frac{\max_j|U_j^{(n+1)}| - a_j\max_j|U_j^{(n)}| - c_j\max_j|U_j^{(n)}|}{b_j}. \end{...
• 21.1k
Accepted

### 4-point Trapezium rule for numerical integration

This has nothing to do with the trapezium rule. The derivative pays $cos(S_1)$ if $1<=S_1<=2$. Solve $e^{(r-0.5\sigma^2)T+\sigma\sqrt{T}z)}=1$ and $e^{(r-0.5\sigma^2)T+\sigma\sqrt{T}z)}=2$ to ...
• 609
Accepted

### Extreme cases of normal random numbers and NaN

The problem is not with your code but with the SDE itself. The process $$\mathrm{d}S_t = \sigma S^\beta \mathrm{d}W_t$$ is a non-negative local martingale. For \$\beta \...
• 6,044
Accepted

### Solve Black scholes PDE without using any transformation

Yes it can be done. However, bear in mind that a naive explicit FD scheme is not unconditionally stable (see CFL stability condition). As far as your initial/boundary conditions issue is concerned: [...
• 14.7k
Accepted

### Implied volatility in Monte Carlo models

To start with make sure that each Monte Carlo price is computed with the same random numbers sequence, so as to avoid unnecessary numerical noise that would result from using different sequences for ...
• 5,672