13
votes
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 ...
11
votes
Accepted
Hyperbolic and Elliptic PDEs in Quant Finance
PDE Classification (Background)
Linear second-order PDEs can be classified as either elliptic, parabolic or hyperbolic. A general PDE in two dimensions for $u=u(x,y)$ would look like
$$Au_{xx}+2Bu_{xy}...
10
votes
Accepted
Anyone has detailed explanation on how to use epstein-zin preferences in asset pricing models
Recursive Utility
The traditional approach to consumption-based asset pricing includes time separable (additive) expected utility functions,
$$U(C_t,C_{t+1})=u(C_t)+\beta \mathbb{E}_t[u(C_{t+1})],$$ ...
8
votes
Fastest way to calculate YTM from bond price
I faced this problem trying to price bund yields from Bloomberg ticks. I found the fastest method was to price three static yields from three static prices and determine a quadratic function for those ...
8
votes
Accepted
In Carr-Madans option pricing method, why do they use FFT?
Indeed, the FFT was a notable improvement in computational option pricing in 1999, but further investigation has shown that it can be easily optimized both in terms of speed and accuracy.
For instance,...
7
votes
Heston Model Integration Oscillations
There has been a huge amount of work on this. Generally a Fourier transform approach is used.
First, be careful to use the form of the characteristic function that does not wind about zero in order ...
7
votes
Is there a good closed-form approximation for Black-Scholes implied volatility?
Let's Be Rational uses exactly two iterations to give full machine accuracy for all inputs. It can be viewed as a three-stage analytical formula if you like.
The code is free to download at www....
7
votes
Accepted
Are asset return means difficult to predict because they have no lower bound?
To answer, the assertion that volatility is easier to predict than expected return requires clarification. The phrase "easier to predict" is particularly ambiguous.
To me this means that the ...
6
votes
Accepted
Brennan-Schwartz algorithm for pricing American options
Ikonen and Toivanen don't say that the LCP is solved exactly, they simply say that the modified back-substitution is a valid algorithm to solve the LCP.
A numerical error may arise around the ...
6
votes
Accepted
Produce the random variable for an asset from a uniformly distributed random varible
The question requires you to provide a method which uses uniform random variables and transforms them to generate realizations of the described asset values.
To give a bit more general answer: this ...
6
votes
Accepted
Simulation of Geometric Brownian Motion in R
The issue is that you do not plot one sample path but for each time point $t$, you simply plot one possible realisation of the random variable $S_t(\omega)$. Thus, you don't get a connected path.
(...
6
votes
Accepted
Improve Finite Difference Scheme
Don't solve the Black-Scholes PDE, solve the heat equation
One of the major results of mathematical finance is showing that the Black-Scholes PDE can be mapped to the heat equation. The heat equation ...
5
votes
Is there a good closed-form approximation for Black-Scholes implied volatility?
There are some other references:
Li and Lee (2009)
[download]
An adaptive successive over-relaxation method for computing the Black–Scholes implied volatility
Stefanica and Radoicic (2017) An ...
5
votes
Accepted
QuantLib returns slightly different bondYield when backtested
I would start by saying that yes, this is an acceptable precision.
However, the reason you are not getting the same result is because, by default, QuantLib has ...
5
votes
Improve Finite Difference Scheme
Some of the standard tricks are mentioned in this paper, Finite Difference Schemes with Exact Recovery of Vanilla Option Prices
https://papers.ssrn.com/sol3/papers.cfm?abstract_id=3530561
which also ...
5
votes
Accepted
Asymptotics of Call Option as $S\to0$
This is more of a math question than a quant question. Under Black Scholes dynamics (assuming $r=0$ for simplicity), as everyone knows we have $$C=SN(d_1)-KN(d_2)$$. In this case, we are interested ...
4
votes
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
votes
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 ...
4
votes
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 ...
4
votes
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 ...
4
votes
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 ...
4
votes
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 ...
4
votes
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{...
3
votes
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 ...
3
votes
Accepted
Extreme cases of normal random numbers and NaN
The problem is not with your code but with the SDE itself. The process
\begin{equation}
\mathrm{d}S_t = \sigma S^\beta \mathrm{d}W_t
\end{equation}
is a non-negative local martingale. For $\beta \...
3
votes
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:
[...
3
votes
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 ...
3
votes
Fastest way to calculate YTM from bond price
Brent's method may converge a little faster than NR for price-yield.
Before electronic computers, a "yield book" was a massive paper book where one could find nearest dirty price, days to ...
3
votes
Produce the random variable for an asset from a uniformly distributed random varible
Say your asset can take the discrete values {1,2,3,4} with probabilities {0.4, 0.1, 0.2, 0.3}.
The question is to derive a sampling procedure that returns either {1,2,3,4} with the right ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
numerical-methods × 144option-pricing × 45
programming × 22
monte-carlo × 20
finite-difference-method × 18
options × 17
black-scholes × 17
american-options × 9
stochastic-processes × 8
implied-volatility × 8
black-scholes-pde × 8
optimization × 6
sde × 5
time-series × 4
brownian-motion × 4
stochastic-volatility × 4
greeks × 4
simulations × 4
heston × 4
fixed-income × 3
interest-rates × 3
stochastic-calculus × 3
bond × 3
mathematics × 3
calibration × 3