FxPaul

Math in finance or vice versa

Archive for November 2011

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

Hidden Markov Model for application store ratings

leave a comment »

Hidden Markov model (HMM) is a statistical model in which the system is assumed to be a Markov process with hidden states. Those states can be recovered by outputs, observed sequences. In other words, it is possible to infer some probabilistic properties of the system by outputs.

As an off-topic, application stores usually give ranking to apps by user comments and rankings. The simplest way to derive an app rating is to calculate average or median, i.e. some statistical property based on rating samples. For average rating not being a robust statistics, its value is affected by outliers, for instance, by deviant rankings submitted by users. Thus a robust procedure might be used to improve ranking.

In fact we can apply HMM mechanics to infer real application rating by the most likely explanation of observed user rankings. Let’s see how to do that.

Read the rest of this entry »

Written by fxpaul

November 2, 2011 at 17:10

Posted in thoughts

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