finMath.net

Spreadsheets

The spreadsheets are given in Excel (xls) and OpenOffice (ods) format and require the Java Object Handler for Spreadsheets, "Obba". Please check requirements below.

Download

You may retrieve the spreadsheets from the finmath spreadsheets repository or via download as ZIP archives (see below).

Interest Rate Curves (Multi-Curve / OIS Discounting)

Calibration of curves (see package net.finmath.marketdata.model.curves).

The sheet calibrates a set of different curves (including discounting curves (e.g., OIS) and forward curves) from swaps. Swaps may feature different discounting curves (e.g., OIS discounting). Forward curves can be calibrated to standard swaps and tenor basis swaps. Discount curves may be calibrated to standard swaps or cross-currency basis swaps.

Although the specific algorithm used is a calibration and not a classical bootstrap, this is sometimes called "curve bootstrapping".

For details see the curve calibration page.

Forward Bond and Total Return Swap Valuation (bases on funding curves)

Valuation of Forward Bonds and Total Return Swaps.

The sheet calibrates a set of different curves (including discounting curves (e.g., OIS) and forward curves) from swaps. It also calibrates funding curves. It contains functionality for the valuation of forward bonds and total return swaps.

Valuation part contributed by Mark Lichtner. Based on the Curve Calibration Sheet.

For details see the forward bond valuation page.

Monte-Carlo Simulation: Brownian Motion and Brownian Bridge

Generate an plot of some sample paths of a Brownian motion and a Brownian bridge.

Black Scholes Model: Valuation

Calculation of the density of the underlying (under the risk neutral measure) by differentiation of option prices (numerically via finite differences).
Monte Carlo simulation of a Black-Scholes model. Contains several sheets related to valuation of options under the Black-Scholes model, e.g., Also includes the valuation of a custom product where the payoff (valuation code) is embedded in the spreadsheet. Note that this feature requires that Java runs from a JDK, not JRE (due to the requirement of on-the-fly compilation).
Monte Carlo simulation of a Black-Scholes model and valuation of a given (customizable) payoff. The custom product is given in an external .java-file which has to be compiled to a .class-file manually.

Black Scholes Model: Hedging

Monte Carlo simulation of a Black-Scholes delta hedged portfolio. Contains the Java source code of the hedge strategy (embedded in the spreadsheet). Note that this feature requires that Java runs from a JDK, not JRE (due to the requirement of on-the-fly compilation).

Heston Model: Valuation

Monte Carlo simulation of a Heston model and the valuation of a European option. The sheet also plots the integrated variance of the Heston model as a function of the realized asset model, which give an intuitive understanding of the smile generated by the model. The sheet may be used as a starting point to study the Heston model properties.

Merton Model: Valuation

Monte Carlo simulation of a Merton model and the valuation of a European option. The sheet may be used as a starting point to study the Merton model properties.

Mean-Variance Hedging

A hedge simulation using a risk minimizing hedge ratio calculated via regression / American Monte-Carlo. The model used to generate the underlying paths is a Heston model, while the model used to calculate the Hedge ratios is a Black-Scholes model. The sheets thus allows to explore hedge errors introduced by model risk.
You may adapt the sheet to use different combinations of simulation and valuation model.

Interest Rate Swaps

Day Count Fractions (see package net.finmath.time.daycount).

The sheet tests several day count conventions against its native spreadsheet implementation using the YEARFRAC function.

Swap Leg Schedule (see package net.finmath.time).

The generates a swap leg schedule, i.e., a sequence of periods with period start date, period end date, fixing date, payment date and period day count fractions, from given meta date, like spot, frequency, date roll convention, holiday calendars, day count convetions.

Interest Rate Derivatives

Valuation of swaption using the generalized Black-Scholes formula (Black model).
Valuation of cms option and a cms floor using the generalized Black-Scholes formula with a convexity adjustment.
Valuation of caps from a caplet volatility surface (lognormal or normal volatility).
LIBOR Market Model

The sheet allows to create a LIBOR market model calibrated to a given forward curve and given swaptions. The parametrized volatility and correlation can be inspected. Generated interest rate scenarios can ben extracted.

For details see the LIBOR market model page.

Requirements

For the Excel files (.xls):

For the OpenOffice/LibreOffice files (.odt)

Note: Some sheets require a JDK instead of a JRE.

Code

The source code behind these sheets can be found in the finmath lib repository.

Disclaimer

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.