srwalkGenerator: A generator of Sampled Random Walks

Description Usage Arguments Value References Examples

Description

It generates a list of n Sampled Random Walks along with the appropriate time period. The time period goes from 0 up to T (0: time_to_maturity). Because it is the same experiment for all the items of the list, each of these depends on the same time period.

Usage

1
2
srwalkGenerator(time_to_maturity = 100, prob = c(head = 0.5, tail = 0.5),
  scale = 1, seed = 1, n = 1)

Arguments

time_to_maturity

Number of time_to_maturity of the random walk

prob

Probability of occurence of head and tail for each step

scale

It defines the time partition between each unit of time. For instance if the scale is 100, the time step [0,1] will be cut in 100 parts. Furthermore this param defines the increment multiplier as well. If the scale is 100, the multiplier which defines the next value will be (+1 / -1) * 1/sqrt(100)

seed

With same seed, 2 exeriments will give the same output. It therefore provides reproducibles experiments.

n

Number of samples generated by the function

Value

srwalkGenerator() has as output a list of data.frame. each data.frame in the list contains all the time value and the value of the corresponding Scaled Random Walk at that time.

References

[1] Symmetric Random Walk, Stochastic Calculus for Finance, Steven e. Shreve, 2004, pp 83-84

Examples

1
2
# Generate a list of 20 sampled symmetric random walks
srwalkGenerator(n = 20)

AnthonyTedde/RandomProcesses documentation built on Dec. 14, 2021, 10:39 a.m.