In a previous post we discussed how to achieve parallel programming in R using the doParallel package. This post provides an application of parallelism for training a model using the caret package. We use repeated cross validation to train a support vector machine (note the iris data is small and doesn't require such exhaustive training; it was merely used for…

# Model Development

# Sensitivities for Make-whole Callable Bonds

A callable bond is a bond that provides the issuer with the right to exchange the bond for its call value in cash. There are a few ways one can value a callable bond by extending the expression of a vanilla bond: Yield-to-x: Calculate the yield-to-maturity, yield(s)-to-call, and/or yield-to-worst and take the lowest of this set. Revalue the bond with…

# Residual Estimation Risk

My 3-month hiatus has ended thanks to the Canadian long weekend. In these past few months I haven't had much time time to commit to posting new content, primarily because I started a new job. This has put my research interests on hold for the time being. So while I will likely not post as frequently as I have in…

# Some Simple Measures of Forecast Accuracy

So you've built a model, the predictive plots look nice, but you want to synthesize this information down to a number. This is where measures of forecast accuracy come in. In this post we will recall some simple measures of forecast accuracy, and then I'll explain why I don't like them, unless you intend to use them to compare more…

# Stock Charting Platform in Shiny

Shiny has been available for some time now, but I've only recently had the opportunity to play around with it. For us R users who are constantly purporting the benefits of the language, Shiny is another point to add to the list. Below I've created a simple stock charting application that pulls data from Yahoo's server, then presents the historical…

# Beta Regression Modelling

It is known that the distribution of LGD, EAD, FUC, or CCF (see for the definitions of CCF and FUC) when capped between 0 and 1 exhibits a non-normal shape with bimodal peaks (near 0 and 1). Hence, it is common to use a logistic link function to achieve a unimodal distribution close to normal, prior to running a regression.…

# Implicit Targets of EAD

When modelling to predict a target variable, the relationship between some set of explanatory variables and this target may be unknown or complex. In the context of linear models, transformation by a link function may not be sufficient to capture the linear dependence. In this case it is suitable to model an implicit variable of the target rather than the…

# A Fast Fourier Transform Method for Mellin-type Option Pricing

Following from the previous post on Mellin-type option pricing, analytical pricing formulas and Greeks are obtained for European and American basket put options using Mellin transforms. In the manuscript below, we assume assets are driven by geometric Brownian motion which exhibit correlation and pay a continuous dividend rate. A novel approach to numerical Mellin inversion is achieved via the fast…

# What is a Margin of Conservatism?

This question comes up a lot in my field of work, and unfortunately, there is no rigorous answer. Everybody seems to have a different (albeit loosely similar) definition of a margin of conservatism. However, we all need a definition, as it drives much of the model development and validation work at financial institutions. Furthermore, AIRB risk parameter estimation models require a margin of conservatism,…

# Generalized Additive Models

Recall the form of a generalized linear model: where predictors/variables have been selected to describe the phenomenon of the link function . Here we assume that the response variable is explained by a linear combination of independent variables. However, there is no theoretical justification why the dependent variable should have a linear relationship with the independent variables . This oversimplification may cause…