sbmotion: A constructor of Sampled Brownian Motion

Description Usage Arguments Value References Examples

View source: R/sbmotion.R

Description

It generates a unique Sampled Brownian Motion along with the appropriate time period. The time period goes from 0 up to T (0: time_to_maturity).

Usage

1
sbmotion(time_to_maturity = 4, seed = 1, scale = 100)

Arguments

time_to_maturity

Maximum time up to the Brownian Motion evolves

seed

With same seed, 2 exeriments will(would, in fact not yet the case when the param scale is different) give the same output. It therefore provides reproducibles experiments.

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.

Value

sbmotion() outputs a data.frame containing the whole range of time period and the value of the corresponding Brownian Motion at that time.

References

[1] Brownian Motion, Stochastic Calculus for Finance, Steven e. Shreve, 2004, pp 93-97

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
# Generate a 150 steps Brownian Motion
sbmotion(steps = 150)

# Generate a Brownian Motion from time 0 up to 4 with each unit time interval
# cut off in 100 parts [0, 0.01, 0.02, ..., 1, 1.01, 1.02, ..., 4]
bm <- sbmotion(time_to_maturity = 4, scale = 100)

# Use the accessor to get values:
# The following give the value for brownian motion at time 2.01
RandomWalk::get_values(bm, 2.01)

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