brownian_motion: Brownian Motion

View source: R/gen-brown-motion.R

brownian_motionR Documentation

Brownian Motion

Description

Create a Brownian Motion Tibble

Usage

brownian_motion(
  .num_walks = 25,
  .n = 100,
  .delta_time = 1,
  .initial_value = 0,
  .return_tibble = TRUE
)

Arguments

.num_walks

Total number of simulations.

.n

Total time of the simulation.

.delta_time

Time step size.

.initial_value

Integer representing the initial value.

.return_tibble

The default is TRUE. If set to FALSE then an object of class matrix will be returned.

Details

Brownian Motion, also known as the Wiener process, is a continuous-time random process that describes the random movement of particles suspended in a fluid. It is named after the physicist Robert Brown, who first described the phenomenon in 1827.

The equation for Brownian Motion can be represented as:

W(t) = W(0) + sqrt(t) * Z

Where W(t) is the Brownian motion at time t, W(0) is the initial value of the Brownian motion, sqrt(t) is the square root of time, and Z is a standard normal random variable.

Brownian Motion has numerous applications, including modeling stock prices in financial markets, modeling particle movement in fluids, and modeling random walk processes in general. It is a useful tool in probability theory and statistical analysis.

Value

A tibble/matrix

Author(s)

Steven P. Sanderson II, MPH

See Also

Other Generator Functions: discrete_walk(), geometric_brownian_motion(), random_normal_drift_walk(), random_normal_walk()

Examples

set.seed(123)
brownian_motion()

set.seed(123)
brownian_motion(.num_walks = 5) |>
  visualize_walks()


RandomWalker documentation built on Oct. 23, 2024, 5:07 p.m.