Description Usage Arguments Value References Examples
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.
1 2 | srwalkGenerator(time_to_maturity = 100, prob = c(head = 0.5, tail = 0.5),
scale = 1, seed = 1, n = 1)
|
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 |
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.
[1] Symmetric Random Walk, Stochastic Calculus for Finance, Steven e. Shreve, 2004, pp 83-84
1 2 | # Generate a list of 20 sampled symmetric random walks
srwalkGenerator(n = 20)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.