VibratoMonteCarlo.jl is a Julia package containing some useful Financial functions for sensitivity computation.
VibratoMonteCarlo.jl is built on top of FinancialMonteCarlo.jl and FinancialFFT.jl. Standard montecarlo methods lacks of differentiability, which makes automatic differentiation useless. The main aim of this package is to provide a feasible way to compute sensitivities of any order for various types of payoffs using montecarlo methods.
The implementation for Vibrato Montecarlo is heavily based on the Master Thesis of Nicola Scaramuzzino (that is me) and the subsequent development.
The basic settings
Let's assume we have an underlying stock price varying as a stochastic process called St and let's assume without loss of generality that St>0 a.e.. In that case we can define as Xt the following:
Xt=log(St)
Let's assume we want to price and compute the sensitivities of a european option with maturity T and payoff ϕ.
In case of a European Option with maturity T and strike price K:
Φ(x)=max(ex−K,0)
and:
∂x∂Φ(x)=ex1ex>K(x)
Hence:
∂θV0=E(∂XT∂Φ(XT)∂θ∂XT)
Unfortunately this method does not provide usefull results for binary options or for n-th order sensitivities, indeed in case of binary options we have:
Φ(x)=1(x)
Hence:
∂xΦ(x)=0
Likelihood Ratio Method
Let's assume we have an underlying stock price varying as a stochastic process called St and let's assume without loss of generality that St>0 a.e.. In that case we can define as Xt the following:
Xt=log(St)
Let's assume we want to price and compute the sensitivities of a european option with maturity T and payoff ϕ.
We can express the price of such option as:
V0=E(ϕ(ST))
or, in function of XT:
V0=E(Φ(XT))
Where:
Φ(x)=ϕ(ex)
If we develop the integral:
V0=E(Φ(XT))=∫RΦ(x)f(x)dx
where the following is the density of the log yield:
f(x)=fXT(x)
If we differentiate for a generic parameter θ:
∂θV0=∂θ∫RΦ(x)f(x,θ)dx=∫RΦ(x)∂θf(x,θ)dx
or:
∂θV0=∫RΦ(x)∂θ(log(f(x,θ)))f(x,θ)dx
or:
∂θV0=E(Φ(XT)∂θlog(f(XT,θ)))
In case of n-th order sensitivities:
We observe that for a generic positive differentiable function f we can have:
In case of trivial models the density is known in analytic form, otherwise one need to compute it numerically from the characteristic function. In case of the Black and Scholes Model, and a European Option we have the following:
And the Bell exponential polymial will be a polynomial of degree 2n in terms of XT:
Bn({∂θilogf(XT,θ)}i=1:n)=i=0∑2nai(θ,n)XTi
And finally:
∂θnV0=a0(θ,n)V0+i=1∑2nai(θ,n)E(Φ(XT)XTi)
Spectral Theorem: Given a European Option with payoff Φ, an underlying varying according to Black and Scholes model, then we can express a generic n order sensitivity as follows:
∂θnV0=a0(θ,n)V0+i=1∑2nai(θ,n)E(Φ(XT)XTi)
Hence a generic n order sensitivity can be expressed as a linear combination of the prices of 2n+1 contracts.
To be noticed that the various coefficients ai(θ,n) do not depend on the payoff, hence with 2n+1 prices we are able to compute all of the partial derivatives with respect to any parameter up to order n.
In case b2(θ) doesn't depend θ then the corresponding n order sensitivity can be expressed as a linear combination of the prices of n+1 contracts.
Let's assume θ=r, from the Spectral Theorem: ∂θ6∂6V=E(σ6(−15T3+45WT2T2−15WT4T+WT6)Φ(log(S0)+WTσ+T(−d+r−21σ2))) Hence we need to price 4 contracts to get the sixth order sensitivitity. To be noticed that one of the contract to be priced is the option itself.
Conditional Expectation
Let's fix a positive number τ<T and let's assume now that the underlying process is a Levy process. Since:
V0=E(Φ(XT))=E(E(Φ(XT)∣Xτ))∂θV0=E(Φ(XT))=∂θE(E(Φ(XT)∣Xτ))=E(∂θE(Φ(XT)∣Xτ))
Conditional Saltando Expectation
Let's assume τ is a stopping time st τ<T a.s., and let's assume now that the underlying process is a Levy process. Since:
V0=E(Φ(XT))=E(E(Φ(XT)∣Xτ))∂θV0=E(Φ(XT))=∂θE(E(Φ(XT)∣Xτ))=E(∂θE(Φ(XT)∣Xτ))
Furthemore, if we assume that Xt is a finite activity Levy process, a smart choice of the law of the stopping time can benefit the computation of the inner expectation. Indeed, if we take τ as the stopping time corresponding to the last jump of the process, we have that:
Xt∣Xτ is a Ito process
Why is it useful? Let's assume Xt is a Kou process, then Xt∣Xτ is a Brownian motion with a modified drift, hence we can have an analytic formula for the inner expectation.
Vibrato Montecarlo Method
Let's fix a positive number τ<T and let's assume now that the underlying process is a Levy process. Since:
V0=E(Φ(XT))=E(E(Φ(XT)∣Xτ))=E(E(Φ(Xτ+(XT−Xτ))∣Xτ))∂θV0=E(Φ(XT))=∂θE(E(Φ(XT)∣Xτ))=∂θE(E(Φ(Xτ+(XT−Xτ))∣Xτ))∂θV0=E(∂θE(Φ(Xτ+(XT−Xτ))∣Xτ))
Now we apply the LRM method to the inner expectation, let's call YT−τ=XT−Xτ, then we have:
As the traditional LR method, this is hard to apply in case the transition density is unknown. This can be easily solved in case of Ito processes where we can approximate the increment as a sum of powers of normal random variables. In case of more general process like Levy, one needs to invert numerically the density from the characteristic function.
Vibrato Saltando Montecarlo
Since what we stated above applies also to a generic stopping time τ, we investigate some smart choice of the law of τ in order to exploit some property of the underlying process. Let's assume now that Xt is a Finite Activity Levy process and that τ is the stopping time corresponding to the last jump of the underlying. We know already that Xt∣Xτ is a Ito process. On such process we are able to apply the standard LRM or VBM since we know the corresponding law of the increments (powers of gaussians).