library(tibble) # tibble()
library(dplyr) # mutate()
library(ggplot2) # ggplot()
Transition Density Function
Setting the stage
A discrete random variable (DRV)
We call that a trinomial walk.
Generating an instance of a trinomial walk
<- 0.3 # probability to go up or down
alpha # Hence, prob to stay the same is 0.4
#let's do a 252 steps trinomial walk (aka a year of daily movement).
<- 252
num_steps <- runif(num_steps)
prob
<- tibble(step = 1:num_steps, prob = prob) |>
df mutate(direction = if_else(prob < alpha, -1, if_else(prob > (1 - alpha), 1, 0)),
cum_walk = cumsum(direction))
ggplot(df, aes(x = step, y = cum_walk)) +
geom_line() +
ggtitle(label = 'Instance of a trinomial walk', subtitle = 'with 252 steps and symetric move') +
ylab(label = 'Cumulative distance')
This is just one instance of a trinomial walk. In reality, we are interested in getting to know the probabilistic properties of the
Deriving the Forward equation
This (Equation 1) means: What is the probability that the random variable y’ lies between a and b at time t’ given it was at y at time t? In this case (y, t) are given, they are constant, they are known; while (y’, t’) are the variables.
We re-write this (Equation 1) for conciseness as
Hence, another way to write (Equation 1) is
Each terms in the sum of (Equation 2) could be evaluated using a Taylor Series Expansion. Note that
We have ignored all the terms less than
Adding the 3 equations above with their coefficients, we end up with
Note how
This last (Equation 3) can be recognized as the Forward Kolmogorov Equation or Heat-diffusion equation or also Fokker-Plank equation.
Note that:
- We used
instead of just for brievety - This is a PDE for p with 2 independent variables
and and are like parameters. They are fixed, they are starting point- This should model a random-walk that is finite in a finite time.
Solving the FKE (by similarity reduction)
To solve this PDE, we solve it by (as per the CQF) similarity reduction. We use a solution of the form
Letting
Finding the partial derivatives based on the above solution’s form.
Since
Also,
Putting everything back together into Equation 3, we get:
Considering the exponents of
To find the value of
Using the substitution
Considering
Re-writing Equation 5 using our new values for
We make the constant = 0.
Integrating both side for
We choose
Using substitution
Recall the Probability Density Function for a random normal variable.
With this in mind, we could set
Hence
An Alternative Situation
We could imagine that instead of the trinomial walk, we a have a Symmetric Random Walk. We defined some properties of such symmetric random walk in an earlier post
This mean that our random walker can move in steps
Similarly to what we have done above,
Putting it all back together and again using
When we take the limit for