Sunday, December 30, 2012

European Multi step Binomial Pricing Model of Call Option Example

Wrote some code that would calculate price of a European Call Option using Binomial Pricing model:

http://codepad.org/PfxkUzaz

Friday, August 24, 2012

Strictly Stationary Stochastic Process

Covariance stationary came up in my last post. That made me think maybe it is time to talk a little more about stochastic processes. In this post, I am going to briefly talk about Stationary processes.

Strict Stationarity
We know that i.i.d. random variables have same probability distributions. We can write such a random variable as:
Xi ~ Fx where Fx denotes probability distribution function and Xi denotes ith normal random variable.

Similarly, in a strictly stationary process,

  • All random variables have same marginal distribution.
  • Joint distribution of random variables  is time invariant. 
  • The above two points imply, they all have the same mean and variance.

Thursday, August 23, 2012

Gaussian white noise R code


The above graph denotes a gaussian white noise that was generated using 100 random numbers in R.

rnorm : Used to generate a random normal distribution.
ACF : Autocorrelation function display the cross-correlation of a signal with itself. In the above graph you can see none of the lags of the signal are dependent on the signal itself. That supports the theory that this is a gaussian white noise.
Also, notice in the time series graph above, the signal looks mean reverting and the volatility appears to be constant. That proves that the signal is a covariance stationary process.

Below is the code that generate the graph above:

Tuesday, July 3, 2012


Covariance & Correlation

Covariance has a upper and lower limit.
-SD(X) SD(Y) <=  Cov(X,Y) <= SD(X) SD(Y)

If a normal random variable is scaled, covariance gets affected. It counters the intuition that dependent relationships are unaltered due to scaling of normal random variables.

Therefore, covariance, as a dependence measure fails in such cases. Thus we need a dependence measure which is unaffected by the scaling (is dimensionless) and that is why correlation exists.