Author: admin

How to add feature interactions

Sometimes it is preferable to use simple machine learning algorithms such as logistic regression due to speed and explainability. But usually these simple algorithms do not incorporate interactions of the features (in contrary to , say, neural networks, where sum/difference

Posted in machine learning Tagged with: ,

time series feature transformations – quantiles

For machine learning algorithms to work well, it’s usually useful to remove noise from features.For time-series this can be achieved in several ways, such as moving averages, applying sign transform, or applying low pass filter. Other, more simple way is

Posted in machine learning Tagged with: ,

How to run sklearn’s GridSearchCV with Tensorflow keras models.

To find optimal parameters for Neural network one would usually use RandomizedSearchCV or GridSearchCV from sklearn library. Tensorflow keras models, such as KerasClassifier, when calling fit() function does not permit to have different number of neurons. GridSearchCV and RandomizedSearchCV call

Posted in machine learning Tagged with: ,

simple example simulation of delta hedging with python

Here we will present simple python code of delta hedging example of a call option . it’s a minimal example with zero interest rates , no dividends. On day 1 we sell 10 near ATM call options and start delta

Posted in OTC derivatives valuation, quant finance coding course

python and derivatives pricing tutorial – brownian motion

In pricing models (black-scholes, local vol, libor market model) the source of uncertainty is Brownian motion. how to simulate it in python? python download first, lets simulate dWt , we know it’s a gaussian variable with mean 0 and deviation

Posted in quant finance coding course

python and derivatives pricing tutorial

Tutorial objective: write and understand simple minimal programs in python for pricing financial derivatives topics: Brownian motion objective: draw and calculate properties of brownian motion using python Black scholes pricing objective: calculate call option price Heston model objective: draw forward

Posted in OTC derivatives valuation, quant finance coding course Tagged with: , ,

How to prepare for quantitative finance intervew

If you apply for quant analyst/quant developer job at investment bank/ hedge fund your quantitative finance interview will generally consist of 4 parts: Programming (C++,python,data structures) General probability/calculus questions Stochastic calculus Derivatives pricing questions for asset class (equity derivatives,interest rate

Posted in OTC derivatives valuation Tagged with: , , ,

PCA simple example (principle component analisys)

simple examples of what PCA does with 2D set of points: ellipsoid like set of points: upper graph is original set of points red vectors are PCA components scaled by explained variance buttom graph is transformed set of points so

Posted in math Tagged with: ,

Libor in arrears convexity adjustment simple example

simplified Libor in arrears payoff: pay at time 1 1-year Libor reset at time 1 F(1) $$ \frac{NPV(0)}{P_1(0)}=\mathbb{E}^1 (\frac{F(1)}{P_1(1)}) $$ where $$\mathbb{E}^1$$ is measure with numeraire $$P_1(t)$$ change measure from time 0 to time 1 (time while F(t) is changing)

Posted in OTC derivatives valuation Tagged with:

set up global include and lib dirs in visual studio 2012

1) open any project go to View->Property Manager 2) pick up any project and choose DEBUG/RELEASE wi32/win64 configuration -> Microsoft.Cpp.Win32.user file choose VC++ directories and add desired Include and Lib dirs to appropriate section (in this case boost dirs) Microsoft.Cpp.Win32.user

Posted in quantlib Tagged with: