FxPaul

Math in finance or vice versa

Archive for the ‘trading math’ Category

Markov Chain for historical volatility

leave a comment »

In previous post we used Markov Chain to discover a behavior of historical volatility and find out the 3/2 rule for ups and downs of random variable.

Now let’s construct more complicated model with the following volatility changes as states in chain:

  1. Less than -25%: denote it as -100.
  2. From -25% to -15% : -20.
  3. From -15% to -5% : -10.
  4. From -5% to 5% : 0.
  5. From 5% to 15% : 10.
  6. From 15% to 25% : 20.
  7. More than 25% : 100.

Read the rest of this entry »

Advertisements

Written by fxpaul

November 22, 2011 at 22:32

Posted in trading math

Tagged with , ,

Markov chain for Geometric Brownian Motion parameters

leave a comment »

A Markov chain is a discrete-time random process with Markov property. Its components are states and probability transitions between them. Markov property states that the probability of next states depends only on the current state.

So Markov chain is a set of states and all transition probabilities between states.

Simple chain for drift

Let’s assume that estimation of drift parameter might lead to the following 2 states:

  1. Positive, i.e. drift is greater or equal zero
  2. Negative, i.e. drift is less than zero

So, one could construct Markov chain for these states as it shown below.

Simple Markov Chain

Read the rest of this entry »

Written by fxpaul

November 22, 2011 at 22:30

Posted in trading math

Tagged with

Maximum Likelihood Estimation of Stochastic Process Parameters

with 4 comments

Maximum Likelihood estimation (MLE) is a method of parameter estimations of statistical model. The base idea is to establish joint density probability for observations and to maximize its value by model’s parameters. To say it differently, we are looking for the most probable explanation of observed data.

Problem setup

Assume that we’re given a one-dimensional stochastic process:
dS_t = \mu dt + \sigma dW_t
where \mu and \sigma are some functions of arguments \theta.

We observe this process by measuring $\latex S_i(t_i)$ where i=1..N. For sake of simplicity assume that observations are equidistant in time, i.e. \Delta t = t_{i-1} - t_i = const.

So, let’s estimate parameters.

Read the rest of this entry »

Written by fxpaul

November 2, 2011 at 08:00

Posted in trading math

Tagged with , ,

SABR model calibration – attempt 2

leave a comment »

The SABR model is a stochastic volatility model, which attempts to capture the volatility smile in derivatives markets. The name stands for “Stochastic Alpha, Beta, Rho”, referring to the parameters of the model. It was developed by Patrick Hagan, Deep Kumar, Andrew Lesniewski, and Diana Woodward.

The SABR model describes a single forward F, such as a LIBOR forward rate, a forward swap rate, or a forward stock price. The volatility of the forward F is described by a parameter σ. SABR is a dynamic model in which both F and σ are represented by stochastic state variables whose time evolution is given by the following system of stochastic differential equations:
dF_t = \sigma_t F_t^{\beta} dW_t
d\sigma_t = \alpha\sigma_t dZ_t
Constant parameters should satisfy the condition 0 \leq \beta \leq 1, \alpha \geq 0
Here, W_t and Z_t are two correlated Wiener processes with correlation coefficient -1\leq\rho\leq 1. For simplicity sake, we assume that \beta = 1, therefore, we put dZ_t dW_t = \rho dt:
dF_t = \sigma_t F_t dW_t
d\sigma_t = \alpha\sigma_t dZ_t

Read the rest of this entry »

Written by fxpaul

November 1, 2011 at 13:50

Posted in trading math

Correlation trading on FX

leave a comment »

Correlation trading is based on few simple ideas:

  1. Correlations are changing with time
  2. Correlations of pairs of 3 currencies are bounded by strict equation
  3. Correlation is bound in the interval [-1, 1]

Therefore, one may try to “buy correlation” at -1 and to “sell it” at +1.

Read the rest of this entry »

Written by fxpaul

November 1, 2011 at 13:04

Exponential Ornstein-Uhlenbeck process and USD/CHF

leave a comment »

In the previous post USD/CHF is considered to follow a mean-reverting process. Let’s look at the dynamics of the process during the days of year 2010.

Calibration procedure

Calibration is simple: get logs of prices and calibrate against classic Ornstein-Uhlenbeck process as it is described here.
Read the rest of this entry »

Written by fxpaul

July 25, 2011 at 14:19

Posted in trading math

Tagged with

SABR model calibration

leave a comment »

Don’t use this!

The SABR model is a stochastic volatility model, which attempts to capture the volatility smile in derivatives markets. The name stands for “Stochastic Alpha, Beta, Rho”, referring to the parameters of the model. It was developed by Patrick Hagan, Deep Kumar, Andrew Lesniewski, and Diana Woodward.

The SABR model describes a single forward F, such as a LIBOR forward rate, a forward swap rate, or a forward stock price. The volatility of the forward F is described by a parameter σ. SABR is a dynamic model in which both F and σ are represented by stochastic state variables whose time evolution is given by the following system of stochastic differential equations:
dF_t = \sigma_t F_t^{\beta} dW_t
d\sigma_t = \alpha\sigma_t dZ_t
Constant parameters should satisfy the condition 0 \leq \beta \leq 1, \alpha \geq 0
Here, W_t and Z_t are two correlated Wiener processes with correlation coefficient -1\leq\rho\leq 1. For simplicity sake, we assume that \rho = 1, therefore, we put Z_t = W_t:
dF_t = \sigma_t F_t^{\beta} dW_t
d\sigma_t = \alpha\sigma_t dW_t

Read the rest of this entry »

Written by fxpaul

June 17, 2011 at 09:27

Posted in trading math