diff --git a/docs/404.html b/docs/404.html index 5cd6bf8..d0d4929 100644 --- a/docs/404.html +++ b/docs/404.html @@ -69,7 +69,7 @@ diff --git a/docs/LICENSE-text.html b/docs/LICENSE-text.html index ea6bc42..7b00f52 100644 --- a/docs/LICENSE-text.html +++ b/docs/LICENSE-text.html @@ -45,7 +45,7 @@ diff --git a/docs/LICENSE.html b/docs/LICENSE.html index 0a2fbaf..3f6be94 100644 --- a/docs/LICENSE.html +++ b/docs/LICENSE.html @@ -49,7 +49,7 @@ diff --git a/docs/articles/getting-started.html b/docs/articles/getting-started.html index eff6c20..7051868 100644 --- a/docs/articles/getting-started.html +++ b/docs/articles/getting-started.html @@ -132,7 +132,7 @@

Installation
 # install.packages("devtools")
-devtools::install_github("spsanderson/RandomWalker")
+devtools::install_github("spsanderson/RandomWalker")

Example Usage @@ -246,7 +246,7 @@

References -

Site built with pkgdown 2.1.0.

+

Site built with pkgdown 2.1.1.

diff --git a/docs/articles/index.html b/docs/articles/index.html index cbe9838..eefff47 100644 --- a/docs/articles/index.html +++ b/docs/articles/index.html @@ -47,7 +47,7 @@

All vignettes

diff --git a/docs/authors.html b/docs/authors.html index bae132a..5f76dd7 100644 --- a/docs/authors.html +++ b/docs/authors.html @@ -71,7 +71,7 @@

Citation

diff --git a/docs/index.html b/docs/index.html index 81756cb..81900e8 100644 --- a/docs/index.html +++ b/docs/index.html @@ -72,7 +72,7 @@

InstallationGitHub with:

 # install.packages("devtools")
-devtools::install_github("spsanderson/RandomWalker")
+devtools::install_github("spsanderson/RandomWalker")

Example @@ -154,7 +154,7 @@

Dev status

diff --git a/docs/news/index.html b/docs/news/index.html index d036046..29095c7 100644 --- a/docs/news/index.html +++ b/docs/news/index.html @@ -41,10 +41,13 @@

Breaking Changes

New Features

-
  1. Fix #92 - Add Function std_cum_sum_augment() to calculate the cumulative sum of a random walk 2 Fix #93 - Add Function std_cum_prod_augment() to calculate the cumulative product of a random walk
  2. -
  3. Fix #94 - Add Function std_cum_min_augment() to calculate the cumulative minimum of a random walk
  4. -
  5. Fix #95 - Add Function std_cum_max_augment() to calculate the cumulative maximum of a random walk
  6. -
  7. Fix #96 - Add Function std_cum_mean_augment() to calculate the cumulative mean of a random walk
  8. +
    1. Fix #92 - Add Function std_cum_sum_augment() to calculate the cumulative sum of a random walk.
    2. +
    3. Fix #93 - Add Function std_cum_prod_augment() to calculate the cumulative product of a random walk.
    4. +
    5. Fix #94 - Add Function std_cum_min_augment() to calculate the cumulative minimum of a random walk.
    6. +
    7. Fix #95 - Add Function std_cum_max_augment() to calculate the cumulative maximum of a random walk.
    8. +
    9. Fix #96 - Add Function std_cum_mean_augment() to calculate the cumulative mean of a random walk.
    10. +
    11. Fix #113 - Add Function get_attributes() to get attributes without the row.names +

Minor Improvements and Fixes

@@ -85,7 +88,7 @@

Minor Improvements and Fixes

diff --git a/docs/pkgdown.js b/docs/pkgdown.js index 9757bf9..1a99c65 100644 --- a/docs/pkgdown.js +++ b/docs/pkgdown.js @@ -152,3 +152,11 @@ async function searchFuse(query, callback) { }); }); })(window.jQuery || window.$) + +document.addEventListener('keydown', function(event) { + // Check if the pressed key is '/' + if (event.key === '/') { + event.preventDefault(); // Prevent any default action associated with the '/' key + document.getElementById('search-input').focus(); // Set focus to the search input + } +}); diff --git a/docs/pkgdown.yml b/docs/pkgdown.yml index a177e63..0132e22 100644 --- a/docs/pkgdown.yml +++ b/docs/pkgdown.yml @@ -1,9 +1,9 @@ pandoc: '3.2' -pkgdown: 2.1.0 +pkgdown: 2.1.1 pkgdown_sha: ~ articles: getting-started: getting-started.html -last_built: 2024-09-25T01:12Z +last_built: 2024-09-28T14:23Z urls: reference: https://www.spsanderson.com/RandomWalker/reference article: https://www.spsanderson.com/RandomWalker/articles diff --git a/docs/reference/brownian_motion-1.png b/docs/reference/brownian_motion-1.png index 3efba91..3f3be58 100644 Binary files a/docs/reference/brownian_motion-1.png and b/docs/reference/brownian_motion-1.png differ diff --git a/docs/reference/brownian_motion.html b/docs/reference/brownian_motion.html index 1341784..ee25ab6 100644 --- a/docs/reference/brownian_motion.html +++ b/docs/reference/brownian_motion.html @@ -148,7 +148,7 @@

Examples -

Site built with pkgdown 2.1.0.

+

Site built with pkgdown 2.1.1.

diff --git a/docs/reference/cgmean.html b/docs/reference/cgmean.html index a135010..9558d86 100644 --- a/docs/reference/cgmean.html +++ b/docs/reference/cgmean.html @@ -102,7 +102,7 @@

Examples -

Site built with pkgdown 2.1.0.

+

Site built with pkgdown 2.1.1.

diff --git a/docs/reference/chmean.html b/docs/reference/chmean.html index 402ddf2..977501f 100644 --- a/docs/reference/chmean.html +++ b/docs/reference/chmean.html @@ -104,7 +104,7 @@

Examples -

Site built with pkgdown 2.1.0.

+

Site built with pkgdown 2.1.1.

diff --git a/docs/reference/ckurtosis.html b/docs/reference/ckurtosis.html index fb98a13..36d31cc 100644 --- a/docs/reference/ckurtosis.html +++ b/docs/reference/ckurtosis.html @@ -101,7 +101,7 @@

Examples -

Site built with pkgdown 2.1.0.

+

Site built with pkgdown 2.1.1.

diff --git a/docs/reference/cmean.html b/docs/reference/cmean.html index 33aa505..87462fa 100644 --- a/docs/reference/cmean.html +++ b/docs/reference/cmean.html @@ -102,7 +102,7 @@

Examples -

Site built with pkgdown 2.1.0.

+

Site built with pkgdown 2.1.1.

diff --git a/docs/reference/cmedian.html b/docs/reference/cmedian.html index 8afa61e..df8b55f 100644 --- a/docs/reference/cmedian.html +++ b/docs/reference/cmedian.html @@ -100,7 +100,7 @@

Examples -

Site built with pkgdown 2.1.0.

+

Site built with pkgdown 2.1.1.

diff --git a/docs/reference/convert_snake_to_title_case.html b/docs/reference/convert_snake_to_title_case.html index 46ae38e..476d180 100644 --- a/docs/reference/convert_snake_to_title_case.html +++ b/docs/reference/convert_snake_to_title_case.html @@ -67,6 +67,7 @@

DetailsSee also

Other Utility Functions: generate_caption(), +get_attributes(), rand_walk_helper(), std_cum_max_augment(), std_cum_mean_augment(), @@ -99,7 +100,7 @@

Examples -

Site built with pkgdown 2.1.0.

+

Site built with pkgdown 2.1.1.

diff --git a/docs/reference/crange.html b/docs/reference/crange.html index 9a133fc..ed31fda 100644 --- a/docs/reference/crange.html +++ b/docs/reference/crange.html @@ -102,7 +102,7 @@

Examples -

Site built with pkgdown 2.1.0.

+

Site built with pkgdown 2.1.1.

diff --git a/docs/reference/csd.html b/docs/reference/csd.html index 76cb0f8..c7e8988 100644 --- a/docs/reference/csd.html +++ b/docs/reference/csd.html @@ -103,7 +103,7 @@

Examples -

Site built with pkgdown 2.1.0.

+

Site built with pkgdown 2.1.1.

diff --git a/docs/reference/cskewness.html b/docs/reference/cskewness.html index 66d992c..e77ebcf 100644 --- a/docs/reference/cskewness.html +++ b/docs/reference/cskewness.html @@ -104,7 +104,7 @@

Examples -

Site built with pkgdown 2.1.0.

+

Site built with pkgdown 2.1.1.

diff --git a/docs/reference/cvar.html b/docs/reference/cvar.html index 9d0bc62..1bb4478 100644 --- a/docs/reference/cvar.html +++ b/docs/reference/cvar.html @@ -104,7 +104,7 @@

Examples -

Site built with pkgdown 2.1.0.

+

Site built with pkgdown 2.1.1.

diff --git a/docs/reference/discrete_walk-1.png b/docs/reference/discrete_walk-1.png index 4c56c1f..2860520 100644 Binary files a/docs/reference/discrete_walk-1.png and b/docs/reference/discrete_walk-1.png differ diff --git a/docs/reference/discrete_walk.html b/docs/reference/discrete_walk.html index e623e31..7c48ae2 100644 --- a/docs/reference/discrete_walk.html +++ b/docs/reference/discrete_walk.html @@ -157,7 +157,7 @@

Examples -

Site built with pkgdown 2.1.0.

+

Site built with pkgdown 2.1.1.

diff --git a/docs/reference/euclidean_distance.html b/docs/reference/euclidean_distance.html index 9b28d7c..d953e5a 100644 --- a/docs/reference/euclidean_distance.html +++ b/docs/reference/euclidean_distance.html @@ -130,7 +130,7 @@

Examples -

Site built with pkgdown 2.1.0.

+

Site built with pkgdown 2.1.1.

diff --git a/docs/reference/generate_caption.html b/docs/reference/generate_caption.html index 005906e..b5dc6db 100644 --- a/docs/reference/generate_caption.html +++ b/docs/reference/generate_caption.html @@ -71,6 +71,7 @@

DetailsSee also

Other Utility Functions: convert_snake_to_title_case(), +get_attributes(), rand_walk_helper(), std_cum_max_augment(), std_cum_mean_augment(), @@ -104,7 +105,7 @@

Examples -

Site built with pkgdown 2.1.0.

+

Site built with pkgdown 2.1.1.

diff --git a/docs/reference/geometric_brownian_motion-1.png b/docs/reference/geometric_brownian_motion-1.png index 533081a..83bf62e 100644 Binary files a/docs/reference/geometric_brownian_motion-1.png and b/docs/reference/geometric_brownian_motion-1.png differ diff --git a/docs/reference/geometric_brownian_motion.html b/docs/reference/geometric_brownian_motion.html index d48b696..39baa04 100644 --- a/docs/reference/geometric_brownian_motion.html +++ b/docs/reference/geometric_brownian_motion.html @@ -165,7 +165,7 @@

Examples -

Site built with pkgdown 2.1.0.

+

Site built with pkgdown 2.1.1.

diff --git a/docs/reference/get_attributes.html b/docs/reference/get_attributes.html new file mode 100644 index 0000000..74c08ae --- /dev/null +++ b/docs/reference/get_attributes.html @@ -0,0 +1,147 @@ + +Get Attributes — get_attributes • RandomWalker + Skip to contents + + +
+
+
+ +
+

The get_attributes function takes an R object as input and +returns its attributes, omitting the row.names attribute.

+
+ +
+

Usage

+
get_attributes(.data)
+
+ +
+

Arguments

+ + +
.data
+

An R object from which attributes are to be extracted.

+ +
+
+

Value

+

A list of attributes of the input R object, excluding row.names.

+
+
+

Details

+

This function retrieves the attributes of a given R object, +excluding the row.names attribute.

+
+ +
+

Author

+

Steven P. Sanderson II, MPH

+
+ +
+

Examples

+
get_attributes(rw30())
+#> $names
+#> [1] "walk_number" "x"           "y"          
+#> 
+#> $class
+#> [1] "tbl_df"     "tbl"        "data.frame"
+#> 
+#> $num_walks
+#> [1] 30
+#> 
+#> $num_steps
+#> [1] 100
+#> 
+#> $mu
+#> [1] 0
+#> 
+#> $sd
+#> [1] 1
+#> 
+#> $fns
+#> [1] "rw30"
+#> 
+#> $dimension
+#> [1] 1
+#> 
+get_attributes(iris)
+#> $names
+#> [1] "Sepal.Length" "Sepal.Width"  "Petal.Length" "Petal.Width"  "Species"     
+#> 
+#> $class
+#> [1] "data.frame"
+#> 
+get_attributes(mtcars)
+#> $names
+#>  [1] "mpg"  "cyl"  "disp" "hp"   "drat" "wt"   "qsec" "vs"   "am"   "gear"
+#> [11] "carb"
+#> 
+#> $class
+#> [1] "data.frame"
+#> 
+
+
+
+
+ + +
+ + + + + + + diff --git a/docs/reference/index.html b/docs/reference/index.html index 26e3f72..a6e1c89 100644 --- a/docs/reference/index.html +++ b/docs/reference/index.html @@ -221,6 +221,12 @@

Helpers / Utilitiesget_attributes() + + +
Get Attributes
+
+ rand_walk_helper()
@@ -282,7 +288,7 @@

Statistic and Summary Functions diff --git a/docs/reference/kurtosis_vec.html b/docs/reference/kurtosis_vec.html index 9b78e40..2709266 100644 --- a/docs/reference/kurtosis_vec.html +++ b/docs/reference/kurtosis_vec.html @@ -107,7 +107,7 @@

Examples -

Site built with pkgdown 2.1.0.

+

Site built with pkgdown 2.1.1.

diff --git a/docs/reference/rand_walk_helper.html b/docs/reference/rand_walk_helper.html index 3dd2396..bf17b2c 100644 --- a/docs/reference/rand_walk_helper.html +++ b/docs/reference/rand_walk_helper.html @@ -76,6 +76,7 @@

See also

Other Utility Functions: convert_snake_to_title_case(), generate_caption(), +get_attributes(), std_cum_max_augment(), std_cum_mean_augment(), std_cum_min_augment(), @@ -122,7 +123,7 @@

Examples -

Site built with pkgdown 2.1.0.

+

Site built with pkgdown 2.1.1.

diff --git a/docs/reference/random_normal_drift_walk-1.png b/docs/reference/random_normal_drift_walk-1.png index c43daa5..05fb3c2 100644 Binary files a/docs/reference/random_normal_drift_walk-1.png and b/docs/reference/random_normal_drift_walk-1.png differ diff --git a/docs/reference/random_normal_drift_walk.html b/docs/reference/random_normal_drift_walk.html index c6ebfb8..bc8b989 100644 --- a/docs/reference/random_normal_drift_walk.html +++ b/docs/reference/random_normal_drift_walk.html @@ -140,7 +140,7 @@

Examples -

Site built with pkgdown 2.1.0.

+

Site built with pkgdown 2.1.1.

diff --git a/docs/reference/random_normal_walk-1.png b/docs/reference/random_normal_walk-1.png index a1f4fb8..5d841e2 100644 Binary files a/docs/reference/random_normal_walk-1.png and b/docs/reference/random_normal_walk-1.png differ diff --git a/docs/reference/random_normal_walk.html b/docs/reference/random_normal_walk.html index 2127016..0059cd9 100644 --- a/docs/reference/random_normal_walk.html +++ b/docs/reference/random_normal_walk.html @@ -189,7 +189,7 @@

Examples -

Site built with pkgdown 2.1.0.

+

Site built with pkgdown 2.1.1.

diff --git a/docs/reference/rw30-1.png b/docs/reference/rw30-1.png index f1fa901..582ad98 100644 Binary files a/docs/reference/rw30-1.png and b/docs/reference/rw30-1.png differ diff --git a/docs/reference/rw30.html b/docs/reference/rw30.html index 81ce26d..7de335c 100644 --- a/docs/reference/rw30.html +++ b/docs/reference/rw30.html @@ -110,7 +110,7 @@

Examples -

Site built with pkgdown 2.1.0.

+

Site built with pkgdown 2.1.1.

diff --git a/docs/reference/rw_range.html b/docs/reference/rw_range.html index 7b7616c..1eb9256 100644 --- a/docs/reference/rw_range.html +++ b/docs/reference/rw_range.html @@ -99,7 +99,7 @@

Examples -

Site built with pkgdown 2.1.0.

+

Site built with pkgdown 2.1.1.

diff --git a/docs/reference/skewness_vec.html b/docs/reference/skewness_vec.html index a4471f7..c9d907f 100644 --- a/docs/reference/skewness_vec.html +++ b/docs/reference/skewness_vec.html @@ -107,7 +107,7 @@

Examples -

Site built with pkgdown 2.1.0.

+

Site built with pkgdown 2.1.1.

diff --git a/docs/reference/std_cum_max_augment.html b/docs/reference/std_cum_max_augment.html index d6b1ec9..aa22c90 100644 --- a/docs/reference/std_cum_max_augment.html +++ b/docs/reference/std_cum_max_augment.html @@ -85,6 +85,7 @@

See also

Other Utility Functions: convert_snake_to_title_case(), generate_caption(), +get_attributes(), rand_walk_helper(), std_cum_mean_augment(), std_cum_min_augment(), @@ -129,7 +130,7 @@

Examples -

Site built with pkgdown 2.1.0.

+

Site built with pkgdown 2.1.1.

diff --git a/docs/reference/std_cum_mean_augment.html b/docs/reference/std_cum_mean_augment.html index 6da5ce8..02603a2 100644 --- a/docs/reference/std_cum_mean_augment.html +++ b/docs/reference/std_cum_mean_augment.html @@ -85,6 +85,7 @@

See also

Other Utility Functions: convert_snake_to_title_case(), generate_caption(), +get_attributes(), rand_walk_helper(), std_cum_max_augment(), std_cum_min_augment(), @@ -129,7 +130,7 @@

Examples -

Site built with pkgdown 2.1.0.

+

Site built with pkgdown 2.1.1.

diff --git a/docs/reference/std_cum_min_augment.html b/docs/reference/std_cum_min_augment.html index 0f09548..d9da514 100644 --- a/docs/reference/std_cum_min_augment.html +++ b/docs/reference/std_cum_min_augment.html @@ -85,6 +85,7 @@

See also

Other Utility Functions: convert_snake_to_title_case(), generate_caption(), +get_attributes(), rand_walk_helper(), std_cum_max_augment(), std_cum_mean_augment(), @@ -129,7 +130,7 @@

Examples -

Site built with pkgdown 2.1.0.

+

Site built with pkgdown 2.1.1.

diff --git a/docs/reference/std_cum_prod_augment.html b/docs/reference/std_cum_prod_augment.html index f56e667..2fc73a6 100644 --- a/docs/reference/std_cum_prod_augment.html +++ b/docs/reference/std_cum_prod_augment.html @@ -85,6 +85,7 @@

See also

Other Utility Functions: convert_snake_to_title_case(), generate_caption(), +get_attributes(), rand_walk_helper(), std_cum_max_augment(), std_cum_mean_augment(), @@ -129,7 +130,7 @@

Examples -

Site built with pkgdown 2.1.0.

+

Site built with pkgdown 2.1.1.

diff --git a/docs/reference/std_cum_sum_augment.html b/docs/reference/std_cum_sum_augment.html index 0f920bc..2b01125 100644 --- a/docs/reference/std_cum_sum_augment.html +++ b/docs/reference/std_cum_sum_augment.html @@ -85,6 +85,7 @@

See also

Other Utility Functions: convert_snake_to_title_case(), generate_caption(), +get_attributes(), rand_walk_helper(), std_cum_max_augment(), std_cum_mean_augment(), @@ -129,7 +130,7 @@

Examples -

Site built with pkgdown 2.1.0.

+

Site built with pkgdown 2.1.1.

diff --git a/docs/reference/summarize_walks.html b/docs/reference/summarize_walks.html index 4698a8b..fb2ac0e 100644 --- a/docs/reference/summarize_walks.html +++ b/docs/reference/summarize_walks.html @@ -161,7 +161,7 @@

Examples -

Site built with pkgdown 2.1.0.

+

Site built with pkgdown 2.1.1.

diff --git a/docs/reference/visualize_walks-1.png b/docs/reference/visualize_walks-1.png index 89d5a46..8955c65 100644 Binary files a/docs/reference/visualize_walks-1.png and b/docs/reference/visualize_walks-1.png differ diff --git a/docs/reference/visualize_walks-2.png b/docs/reference/visualize_walks-2.png index bc677c7..8a657e8 100644 Binary files a/docs/reference/visualize_walks-2.png and b/docs/reference/visualize_walks-2.png differ diff --git a/docs/reference/visualize_walks-3.png b/docs/reference/visualize_walks-3.png index 0228914..ea55eac 100644 Binary files a/docs/reference/visualize_walks-3.png and b/docs/reference/visualize_walks-3.png differ diff --git a/docs/reference/visualize_walks-4.png b/docs/reference/visualize_walks-4.png index 5409abf..2f7adfc 100644 Binary files a/docs/reference/visualize_walks-4.png and b/docs/reference/visualize_walks-4.png differ diff --git a/docs/reference/visualize_walks.html b/docs/reference/visualize_walks.html index 1f83f86..66ca186 100644 --- a/docs/reference/visualize_walks.html +++ b/docs/reference/visualize_walks.html @@ -131,7 +131,7 @@

Examples -

Site built with pkgdown 2.1.0.

+

Site built with pkgdown 2.1.1.

diff --git a/docs/search.json b/docs/search.json index 84396f3..72333fa 100644 --- a/docs/search.json +++ b/docs/search.json @@ -1 +1 @@ -[{"path":"https://www.spsanderson.com/RandomWalker/articles/getting-started.html","id":"random-walks","dir":"Articles","previous_headings":"","what":"Random Walks","title":"Getting Started with RandomWalker","text":"random walk? random walk mathematical concept describing path consisting succession random steps. step independent previous ones, direction distance step determined chance. simplest form random walk one-dimensional walk, object moves either forward backward equal probability step. random walk, average position object NN steps zero, average square distance starting point NN, meaning object typically N\\sqrt{N} steps away start NN steps. concept widely used various fields, including physics, economics, computer science, model phenomena particle diffusion, stock price movements, network topology. finance, random walk theory suggests stock prices move unpredictably, making impossible predict future prices based past movements. theory underpins Efficient Market Hypothesis, posits available information already reflected stock prices, thus making impossible consistently outperform market. higher dimensions, random walks exhibit complex geometric properties can used model intricate systems, behavior particles fluid structure networks. understanding random walks, researchers can gain insights various stochastic processes applications across different scientific practical domains. Now basic understanding concepts, let’s explore can create visualize random walks using RandomWalker package R.","code":""},{"path":"https://www.spsanderson.com/RandomWalker/articles/getting-started.html","id":"installation","dir":"Articles","previous_headings":"","what":"Installation","title":"Getting Started with RandomWalker","text":"can install released version RandomWalker CRAN : can install development version RandomWalker GitHub :","code":"install.packages(\"RandomWalker\") # install.packages(\"devtools\") devtools::install_github(\"spsanderson/RandomWalker\")"},{"path":"https://www.spsanderson.com/RandomWalker/articles/getting-started.html","id":"example-usage","dir":"Articles","previous_headings":"","what":"Example Usage","title":"Getting Started with RandomWalker","text":"Let’s start generating simple random walk using rw30() function RandomWalker package. function generates random walk 30 steps. output shows first 10 steps random walk. step represents position object moving forward backward one unit. rw30() function takes parameters generates 30 random walks 100 steps. uses rnorm() function generate random numbers normal distribution mean 0 standard deviation 1.","code":"rw30() |> head(10) #> # A tibble: 10 × 3 #> walk_number x y #> #> 1 1 1 0 #> 2 1 2 -1.40 #> 3 1 3 -1.14 #> 4 1 4 -3.58 #> 5 1 5 -3.59 #> 6 1 6 -2.97 #> 7 1 7 -1.82 #> 8 1 8 -3.64 #> 9 1 9 -3.89 #> 10 1 10 -4.13"},{"path":"https://www.spsanderson.com/RandomWalker/articles/getting-started.html","id":"attributes","dir":"Articles","previous_headings":"","what":"Attributes","title":"Getting Started with RandomWalker","text":"function RandomWalker package attributes can accessed using attributes() function. example, let’s look attributes rw30() function:","code":"atb <- attributes(rw30()) atb[!names(atb) %in% c(\"row.names\")] #> $names #> [1] \"walk_number\" \"x\" \"y\" #> #> $class #> [1] \"tbl_df\" \"tbl\" \"data.frame\" #> #> $num_walks #> [1] 30 #> #> $num_steps #> [1] 100 #> #> $mu #> [1] 0 #> #> $sd #> [1] 1 #> #> $fns #> [1] \"rw30\" #> #> $dimension #> [1] 1"},{"path":"https://www.spsanderson.com/RandomWalker/articles/getting-started.html","id":"visualizing-random-walks","dir":"Articles","previous_headings":"","what":"Visualizing Random Walks","title":"Getting Started with RandomWalker","text":"visualize random walk generated rw30() function, can use visualize_walks() function. function creates line plot showing path random walk time. plot shows path random walk time, x-axis representing number steps y-axis representing position object. random walk exhibits random pattern movement, object moving forward backward seemingly unpredictable manner.","code":"visualize_walks(rw30())"},{"path":"https://www.spsanderson.com/RandomWalker/articles/getting-started.html","id":"future-direction","dir":"Articles","previous_headings":"","what":"Future Direction","title":"Getting Started with RandomWalker","text":"now RandomWalker supports 1-dimensional random walks. future, plan extend package support higher-dimensional random walks provide additional functionalities analyzing visualizing random walks various contexts. hope vignette provided basic understanding random walks use RandomWalker package R. questions feedback, please feel free reach us.","code":""},{"path":"https://www.spsanderson.com/RandomWalker/articles/getting-started.html","id":"references","dir":"Articles","previous_headings":"","what":"References","title":"Getting Started with RandomWalker","text":"Issues Discussions Random Walks Wikipedia","code":""},{"path":"https://www.spsanderson.com/RandomWalker/authors.html","id":null,"dir":"","previous_headings":"","what":"Authors","title":"Authors and Citation","text":"Steven Sanderson. Author, maintainer, copyright holder. Antti Rask. Author, copyright holder.","code":""},{"path":"https://www.spsanderson.com/RandomWalker/authors.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"Authors and Citation","text":"Sanderson S, Rask (2024). RandomWalker: Generate Random Walks Compatible 'tidyverse'. R package version 0.1.0.9000, https://github.com/spsanderson/RandomWalker, https://www.spsanderson.com/RandomWalker/.","code":"@Manual{, title = {RandomWalker: Generate Random Walks Compatible with the 'tidyverse'}, author = {Steven Sanderson and Antti Rask}, year = {2024}, note = {R package version 0.1.0.9000, https://github.com/spsanderson/RandomWalker}, url = {https://www.spsanderson.com/RandomWalker/}, }"},{"path":"https://www.spsanderson.com/RandomWalker/index.html","id":"randomwalker-","dir":"","previous_headings":"","what":"Generate Random Walks Compatible with the tidyverse","title":"Generate Random Walks Compatible with the tidyverse","text":"goal RandomWalker allow users easily create Random Walks different types compatible tidyverse suite packages. package currently experimental stage development.","code":""},{"path":"https://www.spsanderson.com/RandomWalker/index.html","id":"installation","dir":"","previous_headings":"","what":"Installation","title":"Generate Random Walks Compatible with the tidyverse","text":"can install released version {TidyDensity} CRAN : can install development version RandomWalker GitHub :","code":"install.packages(\"RandomWalker\") # install.packages(\"devtools\") devtools::install_github(\"spsanderson/RandomWalker\")"},{"path":"https://www.spsanderson.com/RandomWalker/index.html","id":"example","dir":"","previous_headings":"","what":"Example","title":"Generate Random Walks Compatible with the tidyverse","text":"basic example shows solve common problem: basic visualization Random Walk:","code":"library(RandomWalker) ## basic example code rw30() |> head(10) #> # A tibble: 10 × 3 #> walk_number x y #> #> 1 1 1 0 #> 2 1 2 -0.895 #> 3 1 3 -1.21 #> 4 1 4 -0.805 #> 5 1 5 -1.42 #> 6 1 6 -2.50 #> 7 1 7 -2.58 #> 8 1 8 -3.19 #> 9 1 9 -3.46 #> 10 1 10 -3.90 rw30() |> visualize_walks()"},{"path":"https://www.spsanderson.com/RandomWalker/LICENSE.html","id":null,"dir":"","previous_headings":"","what":"MIT License","title":"MIT License","text":"Copyright (c) 2024 Steven P. Sanderson II, MPH Permission hereby granted, free charge, person obtaining copy software associated documentation files (“Software”), deal Software without restriction, including without limitation rights use, copy, modify, merge, publish, distribute, sublicense, /sell copies Software, permit persons Software furnished , subject following conditions: copyright notice permission notice shall included copies substantial portions Software. SOFTWARE PROVIDED “”, WITHOUT WARRANTY KIND, EXPRESS IMPLIED, INCLUDING LIMITED WARRANTIES MERCHANTABILITY, FITNESS PARTICULAR PURPOSE NONINFRINGEMENT. EVENT SHALL AUTHORS COPYRIGHT HOLDERS LIABLE CLAIM, DAMAGES LIABILITY, WHETHER ACTION CONTRACT, TORT OTHERWISE, ARISING , CONNECTION SOFTWARE USE DEALINGS SOFTWARE.","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/brownian_motion.html","id":null,"dir":"Reference","previous_headings":"","what":"Brownian Motion — brownian_motion","title":"Brownian Motion — brownian_motion","text":"Create Brownian Motion Tibble","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/brownian_motion.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Brownian Motion — brownian_motion","text":"","code":"brownian_motion( .num_walks = 25, .n = 100, .delta_time = 1, .initial_value = 0, .return_tibble = TRUE )"},{"path":"https://www.spsanderson.com/RandomWalker/reference/brownian_motion.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Brownian Motion — brownian_motion","text":".num_walks Total number simulations. .n Total time simulation. .delta_time Time step size. .initial_value Integer representing initial value. .return_tibble default TRUE. set FALSE object class matrix returned.","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/brownian_motion.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Brownian Motion — brownian_motion","text":"tibble/matrix","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/brownian_motion.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Brownian Motion — brownian_motion","text":"Brownian Motion, also known Wiener process, continuous-time random process describes random movement particles suspended fluid. named physicist Robert Brown, first described phenomenon 1827. equation Brownian Motion can represented : W(t) Brownian motion time t, W(0) initial value Brownian motion, sqrt(t) square root time, Z standard normal random variable. Brownian Motion numerous applications, including modeling stock prices financial markets, modeling particle movement fluids, modeling random walk processes general. useful tool probability theory statistical analysis.","code":"W(t) = W(0) + sqrt(t) * Z"},{"path":[]},{"path":"https://www.spsanderson.com/RandomWalker/reference/brownian_motion.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Brownian Motion — brownian_motion","text":"Steven P. Sanderson II, MPH","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/brownian_motion.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Brownian Motion — brownian_motion","text":"","code":"library(ggplot2) set.seed(123) brownian_motion() #> # A tibble: 2,525 × 6 #> walk_number x y cum_min cum_max cum_mean #> #> 1 1 1 0 0 0 0 #> 2 1 2 -0.560 -0.560 0 -0.280 #> 3 1 3 -0.791 -0.791 0 -0.450 #> 4 1 4 0.768 -0.791 0.768 -0.146 #> 5 1 5 0.839 -0.791 0.839 0.0511 #> 6 1 6 0.968 -0.791 0.968 0.204 #> 7 1 7 2.68 -0.791 2.68 0.558 #> 8 1 8 3.14 -0.791 3.14 0.881 #> 9 1 9 1.88 -0.791 3.14 0.992 #> 10 1 10 1.19 -0.791 3.14 1.01 #> # ℹ 2,515 more rows set.seed(123) brownian_motion() |> ggplot(aes(x = x, y = y, group = walk_number, color = walk_number)) + geom_line() + labs(title = \"Brownian Motion\", x = \"Time\", y = \"Value\") + theme_minimal() + theme(legend.position = \"none\")"},{"path":"https://www.spsanderson.com/RandomWalker/reference/cgmean.html","id":null,"dir":"Reference","previous_headings":"","what":"Cumulative Geometric Mean — cgmean","title":"Cumulative Geometric Mean — cgmean","text":"function return cumulative geometric mean vector.","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/cgmean.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Cumulative Geometric Mean — cgmean","text":"","code":"cgmean(.x)"},{"path":"https://www.spsanderson.com/RandomWalker/reference/cgmean.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Cumulative Geometric Mean — cgmean","text":".x numeric vector","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/cgmean.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Cumulative Geometric Mean — cgmean","text":"numeric vector","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/cgmean.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Cumulative Geometric Mean — cgmean","text":"function return cumulative geometric mean vector. exp(cummean(log(.x)))","code":""},{"path":[]},{"path":"https://www.spsanderson.com/RandomWalker/reference/cgmean.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Cumulative Geometric Mean — cgmean","text":"Steven P. Sanderson II, MPH","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/cgmean.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Cumulative Geometric Mean — cgmean","text":"","code":"x <- mtcars$mpg cgmean(x) #> [1] 21.00000 21.00000 21.58363 21.53757 20.93755 20.43547 19.41935 19.98155 #> [9] 20.27666 20.16633 19.93880 19.61678 19.42805 19.09044 18.33287 17.69470 #> [17] 17.50275 18.11190 18.61236 19.17879 19.28342 19.09293 18.90457 18.62961 #> [25] 18.65210 18.92738 19.15126 19.46993 19.33021 19.34242 19.18443 19.25006"},{"path":"https://www.spsanderson.com/RandomWalker/reference/chmean.html","id":null,"dir":"Reference","previous_headings":"","what":"Cumulative Harmonic Mean — chmean","title":"Cumulative Harmonic Mean — chmean","text":"function return cumulative harmonic mean vector.","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/chmean.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Cumulative Harmonic Mean — chmean","text":"","code":"chmean(.x)"},{"path":"https://www.spsanderson.com/RandomWalker/reference/chmean.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Cumulative Harmonic Mean — chmean","text":".x numeric vector","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/chmean.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Cumulative Harmonic Mean — chmean","text":"numeric vector","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/chmean.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Cumulative Harmonic Mean — chmean","text":"function return cumulative harmonic mean vector. 1 / (cumsum(1 / .x))","code":""},{"path":[]},{"path":"https://www.spsanderson.com/RandomWalker/reference/chmean.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Cumulative Harmonic Mean — chmean","text":"Steven P. Sanderson II, MPH","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/chmean.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Cumulative Harmonic Mean — chmean","text":"","code":"x <- mtcars$mpg chmean(x) #> [1] 21.0000000 10.5000000 7.1891892 5.3813575 4.1788087 3.3949947 #> [7] 2.7436247 2.4663044 2.2255626 1.9943841 1.7934398 1.6166494 #> [13] 1.4784877 1.3474251 1.1928760 1.0701322 0.9975150 0.9677213 #> [19] 0.9378663 0.9126181 0.8754572 0.8286539 0.7858140 0.7419753 #> [25] 0.7143688 0.6961523 0.6779989 0.6632076 0.6364908 0.6165699 #> [31] 0.5922267 0.5762786"},{"path":"https://www.spsanderson.com/RandomWalker/reference/ckurtosis.html","id":null,"dir":"Reference","previous_headings":"","what":"Cumulative Kurtosis — ckurtosis","title":"Cumulative Kurtosis — ckurtosis","text":"function return cumulative kurtosis vector.","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/ckurtosis.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Cumulative Kurtosis — ckurtosis","text":"","code":"ckurtosis(.x)"},{"path":"https://www.spsanderson.com/RandomWalker/reference/ckurtosis.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Cumulative Kurtosis — ckurtosis","text":".x numeric vector","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/ckurtosis.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Cumulative Kurtosis — ckurtosis","text":"numeric vector","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/ckurtosis.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Cumulative Kurtosis — ckurtosis","text":"function return cumulative kurtosis vector.","code":""},{"path":[]},{"path":"https://www.spsanderson.com/RandomWalker/reference/ckurtosis.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Cumulative Kurtosis — ckurtosis","text":"Steven P. Sanderson II, MPH","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/ckurtosis.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Cumulative Kurtosis — ckurtosis","text":"","code":"x <- mtcars$mpg ckurtosis(x) #> [1] NaN NaN 1.500000 2.189216 2.518932 1.786006 2.744467 2.724675 #> [9] 2.930885 2.988093 2.690270 2.269038 2.176622 1.992044 2.839430 2.481896 #> [17] 2.356826 3.877115 3.174702 2.896931 3.000743 3.091225 3.182071 3.212816 #> [25] 3.352916 3.015952 2.837139 2.535185 2.595908 2.691103 2.738468 2.799467"},{"path":"https://www.spsanderson.com/RandomWalker/reference/cmean.html","id":null,"dir":"Reference","previous_headings":"","what":"Cumulative Mean — cmean","title":"Cumulative Mean — cmean","text":"function return cumulative mean vector.","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/cmean.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Cumulative Mean — cmean","text":"","code":"cmean(.x)"},{"path":"https://www.spsanderson.com/RandomWalker/reference/cmean.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Cumulative Mean — cmean","text":".x numeric vector","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/cmean.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Cumulative Mean — cmean","text":"numeric vector","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/cmean.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Cumulative Mean — cmean","text":"function return cumulative mean vector. uses dplyr::cummean() basis function.","code":""},{"path":[]},{"path":"https://www.spsanderson.com/RandomWalker/reference/cmean.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Cumulative Mean — cmean","text":"Steven P. Sanderson II, MPH","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/cmean.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Cumulative Mean — cmean","text":"","code":"x <- mtcars$mpg cmean(x) #> [1] 21.00000 21.00000 21.60000 21.55000 20.98000 20.50000 19.61429 20.21250 #> [9] 20.50000 20.37000 20.13636 19.82500 19.63077 19.31429 18.72000 18.20000 #> [17] 17.99412 18.79444 19.40526 20.13000 20.19524 19.98182 19.77391 19.50417 #> [25] 19.49200 19.79231 20.02222 20.39286 20.23448 20.21667 20.04839 20.09062"},{"path":"https://www.spsanderson.com/RandomWalker/reference/cmedian.html","id":null,"dir":"Reference","previous_headings":"","what":"Cumulative Median — cmedian","title":"Cumulative Median — cmedian","text":"function return cumulative median vector.","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/cmedian.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Cumulative Median — cmedian","text":"","code":"cmedian(.x)"},{"path":"https://www.spsanderson.com/RandomWalker/reference/cmedian.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Cumulative Median — cmedian","text":".x numeric vector","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/cmedian.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Cumulative Median — cmedian","text":"numeric vector","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/cmedian.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Cumulative Median — cmedian","text":"function return cumulative median vector.","code":""},{"path":[]},{"path":"https://www.spsanderson.com/RandomWalker/reference/cmedian.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Cumulative Median — cmedian","text":"Steven P. Sanderson II, MPH","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/cmedian.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Cumulative Median — cmedian","text":"","code":"x <- mtcars$mpg cmedian(x) #> [1] 21.00 21.00 21.00 21.20 21.00 21.00 21.00 21.00 21.00 21.00 21.00 20.10 #> [13] 19.20 18.95 18.70 18.40 18.10 18.40 18.70 18.95 19.20 18.95 18.70 18.40 #> [25] 18.70 18.95 19.20 19.20 19.20 19.20 19.20 19.20"},{"path":"https://www.spsanderson.com/RandomWalker/reference/convert_snake_to_title_case.html","id":null,"dir":"Reference","previous_headings":"","what":"Helper function to convert a snake_case string to Title Case — convert_snake_to_title_case","title":"Helper function to convert a snake_case string to Title Case — convert_snake_to_title_case","text":"Converts snake_case string Title Case.","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/convert_snake_to_title_case.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Helper function to convert a snake_case string to Title Case — convert_snake_to_title_case","text":"","code":"convert_snake_to_title_case(string)"},{"path":"https://www.spsanderson.com/RandomWalker/reference/convert_snake_to_title_case.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Helper function to convert a snake_case string to Title Case — convert_snake_to_title_case","text":"string character string snake_case format.","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/convert_snake_to_title_case.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Helper function to convert a snake_case string to Title Case — convert_snake_to_title_case","text":"character string converted Title Case.","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/convert_snake_to_title_case.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Helper function to convert a snake_case string to Title Case — convert_snake_to_title_case","text":"function useful formatting strings readable way, especially dealing variable names identifiers use snake_case. function takes snake_case string converts Title Case. replaces underscores spaces, capitalizes first letter word, replaces substring \"cum\" \"cumulative\" better readability.","code":""},{"path":[]},{"path":"https://www.spsanderson.com/RandomWalker/reference/convert_snake_to_title_case.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Helper function to convert a snake_case string to Title Case — convert_snake_to_title_case","text":"Antti Lennart Rask","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/convert_snake_to_title_case.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Helper function to convert a snake_case string to Title Case — convert_snake_to_title_case","text":"","code":"convert_snake_to_title_case(\"hello_world\") # \"Hello World\" #> [1] \"Hello World\" convert_snake_to_title_case(\"this_is_a_test\") # \"This Is A Test\" #> [1] \"This Is A Test\" convert_snake_to_title_case(\"cumulative_sum\") # \"Cumulative Sum\" #> [1] \"Cumulative Sum\""},{"path":"https://www.spsanderson.com/RandomWalker/reference/crange.html","id":null,"dir":"Reference","previous_headings":"","what":"Cumulative Range — crange","title":"Cumulative Range — crange","text":"function return cumulative range vector.","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/crange.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Cumulative Range — crange","text":"","code":"crange(.x)"},{"path":"https://www.spsanderson.com/RandomWalker/reference/crange.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Cumulative Range — crange","text":".x numeric vector","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/crange.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Cumulative Range — crange","text":"numeric vector","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/crange.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Cumulative Range — crange","text":"function return cumulative range vector. uses max(.x[1:k]) - min(.x[1:k]) basis function.","code":""},{"path":[]},{"path":"https://www.spsanderson.com/RandomWalker/reference/crange.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Cumulative Range — crange","text":"Steven P. Sanderson II, MPH","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/crange.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Cumulative Range — crange","text":"","code":"x <- mtcars$mpg crange(x) #> [1] 0.0 0.0 1.8 1.8 4.1 4.7 8.5 10.1 10.1 10.1 10.1 10.1 10.1 10.1 14.0 #> [16] 14.0 14.0 22.0 22.0 23.5 23.5 23.5 23.5 23.5 23.5 23.5 23.5 23.5 23.5 23.5 #> [31] 23.5 23.5"},{"path":"https://www.spsanderson.com/RandomWalker/reference/csd.html","id":null,"dir":"Reference","previous_headings":"","what":"Cumulative Standard Deviation — csd","title":"Cumulative Standard Deviation — csd","text":"function return cumulative standard deviation vector.","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/csd.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Cumulative Standard Deviation — csd","text":"","code":"csd(.x)"},{"path":"https://www.spsanderson.com/RandomWalker/reference/csd.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Cumulative Standard Deviation — csd","text":".x numeric vector","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/csd.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Cumulative Standard Deviation — csd","text":"numeric vector. Note: first entry always NaN.","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/csd.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Cumulative Standard Deviation — csd","text":"function return cumulative standard deviation vector.","code":""},{"path":[]},{"path":"https://www.spsanderson.com/RandomWalker/reference/csd.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Cumulative Standard Deviation — csd","text":"Steven P. Sanderson II, MPH","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/csd.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Cumulative Standard Deviation — csd","text":"","code":"x <- mtcars$mpg csd(x) #> [1] NaN 0.0000000 1.0392305 0.8544004 1.4737707 1.7663522 2.8445436 #> [8] 3.1302385 3.0524580 2.9070986 2.8647069 2.9366416 2.8975233 3.0252418 #> [15] 3.7142967 4.1476098 4.1046423 5.2332053 5.7405452 6.4594362 6.3029736 #> [22] 6.2319940 6.1698105 6.1772007 6.0474457 6.1199296 6.1188444 6.3166405 #> [29] 6.2611772 6.1530527 6.1217574 6.0269481"},{"path":"https://www.spsanderson.com/RandomWalker/reference/cskewness.html","id":null,"dir":"Reference","previous_headings":"","what":"Cumulative Skewness — cskewness","title":"Cumulative Skewness — cskewness","text":"function return cumulative skewness vector.","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/cskewness.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Cumulative Skewness — cskewness","text":"","code":"cskewness(.x)"},{"path":"https://www.spsanderson.com/RandomWalker/reference/cskewness.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Cumulative Skewness — cskewness","text":".x numeric vector","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/cskewness.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Cumulative Skewness — cskewness","text":"numeric vector","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/cskewness.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Cumulative Skewness — cskewness","text":"function return cumulative skewness vector.","code":""},{"path":[]},{"path":"https://www.spsanderson.com/RandomWalker/reference/cskewness.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Cumulative Skewness — cskewness","text":"Steven P. Sanderson II, MPH","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/cskewness.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Cumulative Skewness — cskewness","text":"","code":"x <- mtcars$mpg cskewness(x) #> [1] NaN NaN 0.707106781 0.997869718 -0.502052297 #> [6] -0.258803244 -0.867969171 -0.628239920 -0.808101715 -0.695348960 #> [11] -0.469220594 -0.256323338 -0.091505282 0.002188142 -0.519593266 #> [16] -0.512660692 -0.379598706 0.614549281 0.581410573 0.649357202 #> [21] 0.631855977 0.706212631 0.775750182 0.821447605 0.844413861 #> [26] 0.716010069 0.614326432 0.525141032 0.582528820 0.601075783 #> [31] 0.652552397 0.640439864"},{"path":"https://www.spsanderson.com/RandomWalker/reference/cvar.html","id":null,"dir":"Reference","previous_headings":"","what":"Cumulative Variance — cvar","title":"Cumulative Variance — cvar","text":"function return cumulative variance vector.","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/cvar.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Cumulative Variance — cvar","text":"","code":"cvar(.x)"},{"path":"https://www.spsanderson.com/RandomWalker/reference/cvar.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Cumulative Variance — cvar","text":".x numeric vector","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/cvar.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Cumulative Variance — cvar","text":"numeric vector. Note: first entry always NaN.","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/cvar.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Cumulative Variance — cvar","text":"function return cumulative variance vector. exp(cummean(log(.x)))","code":""},{"path":[]},{"path":"https://www.spsanderson.com/RandomWalker/reference/cvar.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Cumulative Variance — cvar","text":"Steven P. Sanderson II, MPH","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/cvar.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Cumulative Variance — cvar","text":"","code":"x <- mtcars$mpg cvar(x) #> [1] NaN 0.000000 1.080000 0.730000 2.172000 3.120000 8.091429 #> [8] 9.798393 9.317500 8.451222 8.206545 8.623864 8.395641 9.152088 #> [15] 13.796000 17.202667 16.848088 27.386438 32.953860 41.724316 39.727476 #> [22] 38.837749 38.066561 38.157808 36.571600 37.453538 37.440256 39.899947 #> [29] 39.202340 37.860057 37.475914 36.324103"},{"path":"https://www.spsanderson.com/RandomWalker/reference/discrete_walk.html","id":null,"dir":"Reference","previous_headings":"","what":"Discrete Sampled Walk — discrete_walk","title":"Discrete Sampled Walk — discrete_walk","text":"discrete_walk function generates multiple random walks discrete time periods. step walk determined probabilistic sample specified upper lower bounds. function useful simulating stochastic processes, stock price movements scenarios outcomes determined random process.","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/discrete_walk.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Discrete Sampled Walk — discrete_walk","text":"","code":"discrete_walk( .num_walks = 25, .n = 100, .upper_bound = 1, .lower_bound = -1, .upper_probability = 0.5, .initial_value = 100 )"},{"path":"https://www.spsanderson.com/RandomWalker/reference/discrete_walk.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Discrete Sampled Walk — discrete_walk","text":".num_walks Total number simulations. .n Total time simulation. .upper_bound upper bound random walk. .lower_bound lower bound random walk. .upper_probability probability upper bound. Default 0.5. lower bound calculated 1 - .upper_probability. .initial_value initial value random walk. Default 100.","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/discrete_walk.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Discrete Sampled Walk — discrete_walk","text":"tibble containing simulated walks, columns walk number, time period, various cumulative metrics (sum, product, min, max).","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/discrete_walk.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Discrete Sampled Walk — discrete_walk","text":"function discrete_walk simulates random walks specified number simulations (.num_walks) given total time (.n). step walk either upper bound lower bound, determined probability (.upper_probability). initial value walk set user (.initial_value), cumulative sum, product, minimum, maximum steps calculated walk. results returned tibble detailed attributes, including parameters used simulation.","code":""},{"path":[]},{"path":"https://www.spsanderson.com/RandomWalker/reference/discrete_walk.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Discrete Sampled Walk — discrete_walk","text":"Steven P. Sanderson II, MPH","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/discrete_walk.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Discrete Sampled Walk — discrete_walk","text":"","code":"library(ggplot2) set.seed(123) discrete_walk() #> # A tibble: 2,500 × 8 #> walk_number x y cum_sum cum_prod cum_min cum_max cum_mean #> #> 1 1 1 -1 99 0 99 99 99 #> 2 1 2 1 100 0 99 101 100 #> 3 1 3 -1 99 0 99 101 99.7 #> 4 1 4 1 100 0 99 101 100 #> 5 1 5 1 101 0 99 101 100. #> 6 1 6 -1 100 0 99 101 100 #> 7 1 7 1 101 0 99 101 100. #> 8 1 8 1 102 0 99 101 100. #> 9 1 9 1 103 0 99 101 100. #> 10 1 10 -1 102 0 99 101 100. #> # ℹ 2,490 more rows set.seed(123) discrete_walk(.num_walks = 30, .n = 250, .upper_probability = 0.55) |> ggplot(aes(x = x, y = cum_sum)) + geom_line(aes(group = walk_number), alpha = .618, color = \"steelblue\") + theme_minimal() + theme(legend.position = \"none\") + geom_smooth(method = \"lm\", se = FALSE) #> `geom_smooth()` using formula = 'y ~ x'"},{"path":"https://www.spsanderson.com/RandomWalker/reference/euclidean_distance.html","id":null,"dir":"Reference","previous_headings":"","what":"Distance Calculations — euclidean_distance","title":"Distance Calculations — euclidean_distance","text":"function calculate Euclidean distance two vectors.","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/euclidean_distance.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Distance Calculations — euclidean_distance","text":"","code":"euclidean_distance(.data, .x, .y, .pull_vector = FALSE)"},{"path":"https://www.spsanderson.com/RandomWalker/reference/euclidean_distance.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Distance Calculations — euclidean_distance","text":".data data frame .x numeric vector .y numeric vector .pull_vector boolean TRUE FALSE. Default FALSE augment distance data frame. TRUE return vector distances return.","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/euclidean_distance.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Distance Calculations — euclidean_distance","text":"numeric Vector ditances","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/euclidean_distance.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Distance Calculations — euclidean_distance","text":"function calculate Euclidean distance two vectors. uses formula sqrt((x - lag(x))^2 + (y - lag(y))^2). function uses augments data frame new column called distance.","code":""},{"path":[]},{"path":"https://www.spsanderson.com/RandomWalker/reference/euclidean_distance.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Distance Calculations — euclidean_distance","text":"Steven P. Sanderson II, MPH","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/euclidean_distance.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Distance Calculations — euclidean_distance","text":"","code":"set.seed(123) df <- rw30() euclidean_distance(df, x, y) #> # A tibble: 3,000 × 4 #> walk_number x y distance #> #> 1 1 1 0 NA #> 2 1 2 -0.560 1.15 #> 3 1 3 -0.791 1.03 #> 4 1 4 0.768 1.85 #> 5 1 5 0.839 1.00 #> 6 1 6 0.968 1.01 #> 7 1 7 2.68 1.99 #> 8 1 8 3.14 1.10 #> 9 1 9 1.88 1.61 #> 10 1 10 1.19 1.21 #> # ℹ 2,990 more rows euclidean_distance(df, x, y, TRUE) |> head(10) #> [1] NA 1.146356 1.026149 1.851910 1.002483 1.008323 1.985308 1.101110 #> [9] 1.612569 1.213164"},{"path":"https://www.spsanderson.com/RandomWalker/reference/generate_caption.html","id":null,"dir":"Reference","previous_headings":"","what":"Helper function to generate a caption string based on provided attributes — generate_caption","title":"Helper function to generate a caption string based on provided attributes — generate_caption","text":"Generates caption string based provided attributes.","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/generate_caption.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Helper function to generate a caption string based on provided attributes — generate_caption","text":"","code":"generate_caption(attributes)"},{"path":"https://www.spsanderson.com/RandomWalker/reference/generate_caption.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Helper function to generate a caption string based on provided attributes — generate_caption","text":"attributes list containing various attributes may include dimension, num_steps, mu, sd.","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/generate_caption.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Helper function to generate a caption string based on provided attributes — generate_caption","text":"character string representing generated caption. attributes provided, returns empty string.","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/generate_caption.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Helper function to generate a caption string based on provided attributes — generate_caption","text":"function useful creating descriptive captions plots outputs based attributes provided. ensures non-null attributes included caption. function constructs caption string checking various attributes provided list. formats caption based presence specific attributes, dimensions, number steps, statistical parameters like mu standard deviation (sd).","code":""},{"path":[]},{"path":"https://www.spsanderson.com/RandomWalker/reference/generate_caption.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Helper function to generate a caption string based on provided attributes — generate_caption","text":"Antti Lennart Rask","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/generate_caption.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Helper function to generate a caption string based on provided attributes — generate_caption","text":"","code":"attrs <- list(dimension = 3, num_steps = 100, mu = 0.5, sd = 1.2) generate_caption(attrs) # \"3 dimensions, 100 steps, mu = 0.5, sd = 1.2.\" #> [1] \"3 dimensions, 100 steps, mu = 0.5, sd = 1.2.\" attrs <- list(dimension = NULL, num_steps = 50, mu = NULL, sd = 2.0) generate_caption(attrs) # \"50 steps, sd = 2.0.\" #> [1] \"50 steps, sd = 2.\""},{"path":"https://www.spsanderson.com/RandomWalker/reference/geometric_brownian_motion.html","id":null,"dir":"Reference","previous_headings":"","what":"Geometric Brownian Motion — geometric_brownian_motion","title":"Geometric Brownian Motion — geometric_brownian_motion","text":"Create Geometric Brownian Motion.","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/geometric_brownian_motion.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Geometric Brownian Motion — geometric_brownian_motion","text":"","code":"geometric_brownian_motion( .num_walks = 25, .n = 100, .mu = 0, .sigma = 0.1, .initial_value = 100, .delta_time = 0.003, .return_tibble = TRUE )"},{"path":"https://www.spsanderson.com/RandomWalker/reference/geometric_brownian_motion.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Geometric Brownian Motion — geometric_brownian_motion","text":".num_walks Total number simulations. .n Total time simulation, many n points time. .mu Expected return .sigma Volatility .initial_value Integer representing initial value. .delta_time Time step size. .return_tibble default TRUE. set FALSE object class matrix returned.","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/geometric_brownian_motion.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Geometric Brownian Motion — geometric_brownian_motion","text":"tibble/matrix","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/geometric_brownian_motion.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Geometric Brownian Motion — geometric_brownian_motion","text":"Geometric Brownian Motion (GBM) statistical method modeling evolution given financial asset time. type stochastic process, means system undergoes random changes time. GBM widely used field finance model behavior stock prices, foreign exchange rates, financial assets. based assumption asset's price follows random walk, meaning influenced number unpredictable factors market trends, news events, investor sentiment. equation GBM : S price asset, t time, m expected return asset, s volatility asset, dW small random change asset's price. GBM can used estimate likelihood different outcomes given asset, often used conjunction statistical methods make accurate predictions future performance asset. function provides ability simulating estimating parameters GBM process. can used analyze behavior financial assets make informed investment decisions.","code":"dS/S = mdt + sdW"},{"path":[]},{"path":"https://www.spsanderson.com/RandomWalker/reference/geometric_brownian_motion.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Geometric Brownian Motion — geometric_brownian_motion","text":"Steven P. Sanderson II, MPH","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/geometric_brownian_motion.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Geometric Brownian Motion — geometric_brownian_motion","text":"","code":"library(ggplot2) set.seed(123) geometric_brownian_motion() #> # A tibble: 2,525 × 6 #> walk_number x y cum_min cum_max cum_mean #> #> 1 1 1 100 200 200 200 #> 2 1 2 99.7 200. 200 200. #> 3 1 3 99.6 200. 200 200. #> 4 1 4 100. 200. 200. 200. #> 5 1 5 100. 200. 200. 200. #> 6 1 6 101. 200. 201. 200. #> 7 1 7 101. 200. 201. 200. #> 8 1 8 102. 200. 202. 200. #> 9 1 9 101. 200. 202. 201. #> 10 1 10 101. 200. 202. 201. #> # ℹ 2,515 more rows set.seed(123) geometric_brownian_motion() |> ggplot(aes(x = x, y = y, group = walk_number, color = walk_number)) + geom_line() + labs(title = \"Geometric Brownian Motion\", x = \"Time\", y = \"Value\") + theme_minimal() + theme(legend.position = \"none\")"},{"path":"https://www.spsanderson.com/RandomWalker/reference/kurtosis_vec.html","id":null,"dir":"Reference","previous_headings":"","what":"Compute Kurtosis of a Vector — kurtosis_vec","title":"Compute Kurtosis of a Vector — kurtosis_vec","text":"function takes vector input return kurtosis vector. length vector must least four numbers. kurtosis explains sharpness peak distribution data. ((1/n) * sum(x - mu})^4) / ((()1/n) * sum(x - mu)^2)^2","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/kurtosis_vec.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Compute Kurtosis of a Vector — kurtosis_vec","text":"","code":"kurtosis_vec(.x)"},{"path":"https://www.spsanderson.com/RandomWalker/reference/kurtosis_vec.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Compute Kurtosis of a Vector — kurtosis_vec","text":".x numeric vector length four .","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/kurtosis_vec.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Compute Kurtosis of a Vector — kurtosis_vec","text":"kurtosis vector","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/kurtosis_vec.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Compute Kurtosis of a Vector — kurtosis_vec","text":"function return kurtosis vector.","code":""},{"path":[]},{"path":"https://www.spsanderson.com/RandomWalker/reference/kurtosis_vec.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Compute Kurtosis of a Vector — kurtosis_vec","text":"Steven P. Sanderson II, MPH","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/kurtosis_vec.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Compute Kurtosis of a Vector — kurtosis_vec","text":"","code":"set.seed(123) kurtosis_vec(rnorm(100, 3, 2)) #> [1] 2.838947"},{"path":"https://www.spsanderson.com/RandomWalker/reference/name.html","id":null,"dir":"Reference","previous_headings":"","what":"Cumulative Range — name","title":"Cumulative Range — name","text":"function return cumulative range vector.","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/name.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Cumulative Range — name","text":".x numeric vector","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/name.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Cumulative Range — name","text":"numeric vector","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/name.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Cumulative Range — name","text":"function return cumulative range vector. uses max(.x[1:k]) - min(.x[1:k]) basis function.","code":""},{"path":[]},{"path":"https://www.spsanderson.com/RandomWalker/reference/name.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Cumulative Range — name","text":"Steven P. Sanderson II, MPH","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/name.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Cumulative Range — name","text":"","code":"x <- mtcars$mpg crange(x) #> [1] 0.0 0.0 1.8 1.8 4.1 4.7 8.5 10.1 10.1 10.1 10.1 10.1 10.1 10.1 14.0 #> [16] 14.0 14.0 22.0 22.0 23.5 23.5 23.5 23.5 23.5 23.5 23.5 23.5 23.5 23.5 23.5 #> [31] 23.5 23.5"},{"path":"https://www.spsanderson.com/RandomWalker/reference/random_normal_drift_walk.html","id":null,"dir":"Reference","previous_headings":"","what":"Generate Multiple Random Walks with Drift — random_normal_drift_walk","title":"Generate Multiple Random Walks with Drift — random_normal_drift_walk","text":"function generates specified number random walks, consisting specified number steps. steps generated normal distribution given mean standard deviation. additional drift term added step introduce consistent directional component walks.","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/random_normal_drift_walk.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Generate Multiple Random Walks with Drift — random_normal_drift_walk","text":"","code":"random_normal_drift_walk( .num_walks = 25, .n = 100, .mu = 0, .sd = 1, .drift = 0.1, .initial_value = 0 )"},{"path":"https://www.spsanderson.com/RandomWalker/reference/random_normal_drift_walk.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Generate Multiple Random Walks with Drift — random_normal_drift_walk","text":".num_walks Integer. number random walks generate. Default 25. .n Integer. number steps random walk. Default 100. .mu Numeric. mean normal distribution used generating steps. Default 0. .sd Numeric. standard deviation normal distribution used generating steps. Default 1. .drift Numeric. drift term added step. Default 0.1. .initial_value numeric value indicating initial value walks. Default 0.","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/random_normal_drift_walk.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Generate Multiple Random Walks with Drift — random_normal_drift_walk","text":"tibble long format columns walk_number, x (step index), y (walk value). tibble attributes number walks, number steps, mean, standard deviation, drift.","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/random_normal_drift_walk.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Generate Multiple Random Walks with Drift — random_normal_drift_walk","text":"function generates multiple random walks specified drift. walk generated using normal distribution steps, additional drift term added step.","code":""},{"path":[]},{"path":"https://www.spsanderson.com/RandomWalker/reference/random_normal_drift_walk.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Generate Multiple Random Walks with Drift — random_normal_drift_walk","text":"Steven P. Sanderson II, MPH","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/random_normal_drift_walk.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Generate Multiple Random Walks with Drift — random_normal_drift_walk","text":"","code":"library(ggplot2) set.seed(123) walks <- random_normal_drift_walk(.num_walks = 10, .n = 50, .mu = 0, .sd = 1.2, .drift = 0.05) ggplot(walks, aes(x = x, y = y, group = walk_number, color = walk_number)) + geom_line() + labs(title = \"Random Walks with Drift\", x = \"Time\", y = \"Value\") + theme_minimal() + theme(legend.position = \"none\")"},{"path":"https://www.spsanderson.com/RandomWalker/reference/random_normal_walk.html","id":null,"dir":"Reference","previous_headings":"","what":"Generate Multiple Random Normal Walks — random_normal_walk","title":"Generate Multiple Random Normal Walks — random_normal_walk","text":"random_normal_walk function useful simulating random processes can applied various fields finance, physics, biology model different stochastic behaviors.","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/random_normal_walk.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Generate Multiple Random Normal Walks — random_normal_walk","text":"","code":"random_normal_walk( .num_walks = 25, .n = 100, .mu = 0, .sd = 0.1, .initial_value = 0, .samp = TRUE, .replace = TRUE, .sample_size = 0.8 )"},{"path":"https://www.spsanderson.com/RandomWalker/reference/random_normal_walk.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Generate Multiple Random Normal Walks — random_normal_walk","text":".num_walks integer specifying number random walks generate. Default 25. .n integer specifying number steps walk. Default 100. .mu numeric value indicating mean normal distribution. Default 0. .sd numeric value indicating standard deviation normal distribution. Default 0.1. .initial_value numeric value indicating initial value walks. Default 0. .samp logical value indicating whether sample normal distribution values. Default TRUE. .replace logical value indicating whether sampling replacement. Default TRUE. .sample_size numeric value 0 1 specifying proportion .n sample. Default 0.8.","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/random_normal_walk.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Generate Multiple Random Normal Walks — random_normal_walk","text":"tibble containing generated random walks following columns: walk_number: Factor representing walk number. x: Step index. y: Normal distribution values. cum_sum: Cumulative sum y. cum_prod: Cumulative product y. cum_min: Cumulative minimum y. cum_max: Cumulative maximum y. tibble includes attributes function parameters.","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/random_normal_walk.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Generate Multiple Random Normal Walks — random_normal_walk","text":"function generates multiple random walks, sequences steps step random draw normal distribution. user can specify number walks, number steps walk, parameters normal distribution (mean standard deviation). function also allows sampling proportion steps optionally sampling replacement. output tibble includes several computed columns walk, cumulative sum, product, minimum, maximum steps.","code":""},{"path":[]},{"path":"https://www.spsanderson.com/RandomWalker/reference/random_normal_walk.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Generate Multiple Random Normal Walks — random_normal_walk","text":"Steven P. Sanderson II, MPH","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/random_normal_walk.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Generate Multiple Random Normal Walks — random_normal_walk","text":"","code":"library(ggplot2) # Generate 10 random walks with 50 steps each set.seed(123) random_normal_walk(.num_walks = 10, .n = 50) #> # A tibble: 400 × 8 #> walk_number x y cum_sum cum_prod cum_min cum_max cum_mean #> #> 1 1 1 0.125 0.125 0 0.125 0.125 0.125 #> 2 1 2 0.172 0.297 0 0.125 0.172 0.148 #> 3 1 3 -0.127 0.170 0 -0.127 0.172 0.0568 #> 4 1 4 -0.0218 0.149 0 -0.127 0.172 0.0371 #> 5 1 5 -0.0218 0.127 0 -0.127 0.172 0.0254 #> 6 1 6 -0.0306 0.0962 0 -0.127 0.172 0.0160 #> 7 1 7 0.0426 0.139 0 -0.127 0.172 0.0198 #> 8 1 8 0.0498 0.189 0 -0.127 0.172 0.0236 #> 9 1 9 0.0878 0.276 0 -0.127 0.172 0.0307 #> 10 1 10 0.00705 0.283 0 -0.127 0.172 0.0283 #> # ℹ 390 more rows # Generate random walks with different mean and standard deviation set.seed(123) random_normal_walk(.num_walks = 10, .n = 50, .samp = FALSE) #> # A tibble: 500 × 8 #> walk_number x y cum_sum cum_prod cum_min cum_max cum_mean #> #> 1 1 1 -0.0560 -0.0560 0 -0.0560 -0.0560 -0.0560 #> 2 1 2 -0.0230 -0.0791 0 -0.0560 -0.0230 -0.0395 #> 3 1 3 0.156 0.0768 0 -0.0560 0.156 0.0256 #> 4 1 4 0.00705 0.0839 0 -0.0560 0.156 0.0210 #> 5 1 5 0.0129 0.0968 0 -0.0560 0.156 0.0194 #> 6 1 6 0.172 0.268 0 -0.0560 0.172 0.0447 #> 7 1 7 0.0461 0.314 0 -0.0560 0.172 0.0449 #> 8 1 8 -0.127 0.188 0 -0.127 0.172 0.0235 #> 9 1 9 -0.0687 0.119 0 -0.127 0.172 0.0132 #> 10 1 10 -0.0446 0.0746 0 -0.127 0.172 0.00746 #> # ℹ 490 more rows set.seed(123) random_normal_walk(.num_walks = 2, .n = 100) |> ggplot(aes(x = x, y = y, group = walk_number, color = walk_number)) + geom_line() + labs(title = \"Random Normal Walk\", x = \"Time\", y = \"Value\") + theme_minimal() + theme(legend.position = \"none\")"},{"path":"https://www.spsanderson.com/RandomWalker/reference/rand_walk_helper.html","id":null,"dir":"Reference","previous_headings":"","what":"Random Walk Helper — rand_walk_helper","title":"Random Walk Helper — rand_walk_helper","text":"function help build random walks mutating data frame.","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/rand_walk_helper.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Random Walk Helper — rand_walk_helper","text":"","code":"rand_walk_helper(.data, .value)"},{"path":"https://www.spsanderson.com/RandomWalker/reference/rand_walk_helper.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Random Walk Helper — rand_walk_helper","text":".data data frame mutate. .value .initial_value use. passed random walk function called end user.","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/rand_walk_helper.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Random Walk Helper — rand_walk_helper","text":"modified data frame/tibble following columns added: cum_sum: Cumulative sum y. cum_prod: Cumulative product y. cum_min: Cumulative minimum y. cum_max: Cumulative maximum y. cum_mean: Cumulative mean y.","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/rand_walk_helper.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Random Walk Helper — rand_walk_helper","text":"function help build random walks mutating data frame. mutation adds following columns data frame: cum_sum, cum_prod, cum_min, cum_max, cum_mean. function used internally certain functions generate random walks.","code":""},{"path":[]},{"path":"https://www.spsanderson.com/RandomWalker/reference/rand_walk_helper.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Random Walk Helper — rand_walk_helper","text":"Steven P. Sanderson II, MPH","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/rand_walk_helper.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Random Walk Helper — rand_walk_helper","text":"","code":"df <- data.frame( walk_number = factor(rep(1L:25L, each = 30L)), x = rep(1L:30L, 25L), y = rnorm(750L, 0L, 1L) ) rand_walk_helper(df, 100) #> # A tibble: 750 × 8 #> walk_number x y cum_sum cum_prod cum_min cum_max cum_mean #> #> 1 1 1 0.551 101. 155. 101. 101. 101. #> 2 1 2 -2.09 98.5 -169. 97.9 101. 99.2 #> 3 1 3 -0.0249 98.4 -165. 97.9 101. 99.5 #> 4 1 4 0.888 99.3 -311. 97.9 101. 99.8 #> 5 1 5 -0.337 99.0 -206. 97.9 101. 99.8 #> 6 1 6 -1.03 98.0 6.33 97.9 101. 99.7 #> 7 1 7 0.431 98.4 9.05 97.9 101. 99.8 #> 8 1 8 0.209 98.6 10.9 97.9 101. 99.8 #> 9 1 9 -1.55 97.0 -6.00 97.9 101. 99.7 #> 10 1 10 -1.17 95.9 1.04 97.9 101. 99.6 #> # ℹ 740 more rows"},{"path":"https://www.spsanderson.com/RandomWalker/reference/rw30.html","id":null,"dir":"Reference","previous_headings":"","what":"Generate Random Walks — rw30","title":"Generate Random Walks — rw30","text":"Generate Random Walks","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/rw30.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Generate Random Walks — rw30","text":"","code":"rw30()"},{"path":"https://www.spsanderson.com/RandomWalker/reference/rw30.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Generate Random Walks — rw30","text":"tibble long format columns walk, x, value, representing random walks. Additionally, attributes num_walks, num_steps, mu, sd attached tibble.","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/rw30.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Generate Random Walks — rw30","text":"function generates random walks using normal distribution specified mean (mu) standard deviation (sd). walk generated independently stored tibble. resulting tibble pivoted long format easier analysis.","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/rw30.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Generate Random Walks — rw30","text":"Steven P. Sanderson II, MPH function generates 30 random walks 100 steps pivots result long format tibble.","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/rw30.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Generate Random Walks — rw30","text":"","code":"library(ggplot2) # Generate random walks and print the result set.seed(123) rw30() #> # A tibble: 3,000 × 3 #> walk_number x y #> #> 1 1 1 0 #> 2 1 2 -0.560 #> 3 1 3 -0.791 #> 4 1 4 0.768 #> 5 1 5 0.839 #> 6 1 6 0.968 #> 7 1 7 2.68 #> 8 1 8 3.14 #> 9 1 9 1.88 #> 10 1 10 1.19 #> # ℹ 2,990 more rows set.seed(123) rw30() |> ggplot(aes(x = x, y = y, color = walk_number, group = walk_number)) + geom_line() + theme_minimal() + theme(legend.position = \"none\") + labs( title = \"30 Random Walks\", x = \"Step\", y = \"Value\", color = \"Walk Number\" )"},{"path":"https://www.spsanderson.com/RandomWalker/reference/rw_range.html","id":null,"dir":"Reference","previous_headings":"","what":"Range — rw_range","title":"Range — rw_range","text":"function return range vector.","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/rw_range.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Range — rw_range","text":"","code":"rw_range(.x)"},{"path":"https://www.spsanderson.com/RandomWalker/reference/rw_range.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Range — rw_range","text":".x numeric vector","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/rw_range.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Range — rw_range","text":"numeric vector","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/rw_range.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Range — rw_range","text":"function return range vector. uses max(.x) - min(.x) basis function.","code":""},{"path":[]},{"path":"https://www.spsanderson.com/RandomWalker/reference/rw_range.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Range — rw_range","text":"Steven P. Sanderson II, MPH","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/rw_range.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Range — rw_range","text":"","code":"x <- mtcars$mpg rw_range(x) #> [1] 23.5"},{"path":"https://www.spsanderson.com/RandomWalker/reference/skewness_vec.html","id":null,"dir":"Reference","previous_headings":"","what":"Compute Skewness of a Vector — skewness_vec","title":"Compute Skewness of a Vector — skewness_vec","text":"function takes vector input return skewness vector. length vector must least four numbers. skewness explains 'tailedness' distribution data. ((1/n) * sum(x - mu})^3) / ((()1/n) * sum(x - mu)^2)^(3/2)","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/skewness_vec.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Compute Skewness of a Vector — skewness_vec","text":"","code":"skewness_vec(.x)"},{"path":"https://www.spsanderson.com/RandomWalker/reference/skewness_vec.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Compute Skewness of a Vector — skewness_vec","text":".x numeric vector length four .","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/skewness_vec.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Compute Skewness of a Vector — skewness_vec","text":"skewness vector","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/skewness_vec.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Compute Skewness of a Vector — skewness_vec","text":"function return skewness vector.","code":""},{"path":[]},{"path":"https://www.spsanderson.com/RandomWalker/reference/skewness_vec.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Compute Skewness of a Vector — skewness_vec","text":"Steven P. Sanderson II, MPH","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/skewness_vec.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Compute Skewness of a Vector — skewness_vec","text":"","code":"set.seed(123) skewness_vec(rnorm(100, 3, 2)) #> [1] 0.06049948"},{"path":"https://www.spsanderson.com/RandomWalker/reference/std_cum_max_augment.html","id":null,"dir":"Reference","previous_headings":"","what":"Augment Cumulative Maximum — std_cum_max_augment","title":"Augment Cumulative Maximum — std_cum_max_augment","text":"function augments data frame adding cumulative maximum columns specified variables.","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/std_cum_max_augment.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Augment Cumulative Maximum — std_cum_max_augment","text":"","code":"std_cum_max_augment(.data, .value, .names = \"auto\", .initial_value = 0)"},{"path":"https://www.spsanderson.com/RandomWalker/reference/std_cum_max_augment.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Augment Cumulative Maximum — std_cum_max_augment","text":".data data frame augment. .value column name names compute cumulative maximum. .names Optional. character vector names new cumulative maximum columns. Defaults \"auto\", generates names based original column names. .initial_value numeric value start cumulative maximum . Defaults 0.","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/std_cum_max_augment.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Augment Cumulative Maximum — std_cum_max_augment","text":"tibble original data additional columns containing cumulative maximums.","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/std_cum_max_augment.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Augment Cumulative Maximum — std_cum_max_augment","text":"function takes data frame column name (names) computes cumulative maximum specified column, starting initial value. column names provided, throw error.","code":""},{"path":[]},{"path":"https://www.spsanderson.com/RandomWalker/reference/std_cum_max_augment.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Augment Cumulative Maximum — std_cum_max_augment","text":"Steven P. Sanderson II, MPH","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/std_cum_max_augment.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Augment Cumulative Maximum — std_cum_max_augment","text":"","code":"df <- data.frame(x = c(1, 3, 2, 5, 4), y = c(10, 7, 6, 12, 5)) std_cum_max_augment(df, .value = x) #> # A tibble: 5 × 3 #> x y cum_max_x #> #> 1 1 10 1 #> 2 3 7 3 #> 3 2 6 3 #> 4 5 12 5 #> 5 4 5 5 std_cum_max_augment(df, .value = y, .names = c(\"cummax_y\")) #> # A tibble: 5 × 3 #> x y cummax_y #> #> 1 1 10 10 #> 2 3 7 10 #> 3 2 6 10 #> 4 5 12 12 #> 5 4 5 12"},{"path":"https://www.spsanderson.com/RandomWalker/reference/std_cum_mean_augment.html","id":null,"dir":"Reference","previous_headings":"","what":"Augment Cumulative Sum — std_cum_mean_augment","title":"Augment Cumulative Sum — std_cum_mean_augment","text":"function augments data frame adding cumulative mean columns specified variables.","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/std_cum_mean_augment.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Augment Cumulative Sum — std_cum_mean_augment","text":"","code":"std_cum_mean_augment(.data, .value, .names = \"auto\", .initial_value = 0)"},{"path":"https://www.spsanderson.com/RandomWalker/reference/std_cum_mean_augment.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Augment Cumulative Sum — std_cum_mean_augment","text":".data data frame augment. .value column name names compute cumulative mean. .names Optional. character vector names new cumulative mean columns. Defaults \"auto\", generates names based original column names. .initial_value numeric value start cumulative mean . Defaults 0.","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/std_cum_mean_augment.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Augment Cumulative Sum — std_cum_mean_augment","text":"tibble original data additional columns containing cumulative means.","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/std_cum_mean_augment.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Augment Cumulative Sum — std_cum_mean_augment","text":"function takes data frame column name (names) computes cumulative mean specified column, starting initial value. column names provided, throw error.","code":""},{"path":[]},{"path":"https://www.spsanderson.com/RandomWalker/reference/std_cum_mean_augment.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Augment Cumulative Sum — std_cum_mean_augment","text":"Steven P. Sanderson II, MPH","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/std_cum_mean_augment.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Augment Cumulative Sum — std_cum_mean_augment","text":"","code":"df <- data.frame(x = c(1, 2, 3, 4, 5), y = c(10, 20, 30, 40, 50)) std_cum_mean_augment(df, .value = x) #> # A tibble: 5 × 3 #> x y cum_mean_x #> #> 1 1 10 1 #> 2 2 20 1.5 #> 3 3 30 2 #> 4 4 40 2.5 #> 5 5 50 3 std_cum_mean_augment(df, .value = y, .names = c(\"cummean_y\")) #> # A tibble: 5 × 3 #> x y cummean_y #> #> 1 1 10 10 #> 2 2 20 15 #> 3 3 30 20 #> 4 4 40 25 #> 5 5 50 30"},{"path":"https://www.spsanderson.com/RandomWalker/reference/std_cum_min_augment.html","id":null,"dir":"Reference","previous_headings":"","what":"Augment Cumulative Minimum — std_cum_min_augment","title":"Augment Cumulative Minimum — std_cum_min_augment","text":"function augments data frame adding cumulative minimum columns specified variables.","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/std_cum_min_augment.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Augment Cumulative Minimum — std_cum_min_augment","text":"","code":"std_cum_min_augment(.data, .value, .names = \"auto\", .initial_value = 0)"},{"path":"https://www.spsanderson.com/RandomWalker/reference/std_cum_min_augment.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Augment Cumulative Minimum — std_cum_min_augment","text":".data data frame augment. .value column name names compute cumulative minimum. .names Optional. character vector names new cumulative minimum columns. Defaults \"auto\", generates names based original column names. .initial_value numeric value start cumulative minimum . Defaults 0.","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/std_cum_min_augment.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Augment Cumulative Minimum — std_cum_min_augment","text":"tibble original data additional columns containing cumulative minimums.","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/std_cum_min_augment.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Augment Cumulative Minimum — std_cum_min_augment","text":"function takes data frame column name (names) computes cumulative minimum specified column, starting initial value. column names provided, throw error.","code":""},{"path":[]},{"path":"https://www.spsanderson.com/RandomWalker/reference/std_cum_min_augment.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Augment Cumulative Minimum — std_cum_min_augment","text":"Steven P. Sanderson II, MPH","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/std_cum_min_augment.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Augment Cumulative Minimum — std_cum_min_augment","text":"","code":"df <- data.frame(x = c(5, 3, 8, 1, 4), y = c(10, 7, 6, 12, 5)) std_cum_min_augment(df, .value = x) #> # A tibble: 5 × 3 #> x y cum_min_x #> #> 1 5 10 5 #> 2 3 7 3 #> 3 8 6 3 #> 4 1 12 1 #> 5 4 5 1 std_cum_min_augment(df, .value = y, .names = c(\"cummin_y\")) #> # A tibble: 5 × 3 #> x y cummin_y #> #> 1 5 10 10 #> 2 3 7 7 #> 3 8 6 6 #> 4 1 12 6 #> 5 4 5 5"},{"path":"https://www.spsanderson.com/RandomWalker/reference/std_cum_prod_augment.html","id":null,"dir":"Reference","previous_headings":"","what":"Augment Cumulative Product — std_cum_prod_augment","title":"Augment Cumulative Product — std_cum_prod_augment","text":"function augments data frame adding cumulative product columns specified variables.","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/std_cum_prod_augment.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Augment Cumulative Product — std_cum_prod_augment","text":"","code":"std_cum_prod_augment(.data, .value, .names = \"auto\", .initial_value = 1)"},{"path":"https://www.spsanderson.com/RandomWalker/reference/std_cum_prod_augment.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Augment Cumulative Product — std_cum_prod_augment","text":".data data frame augment. .value column name names compute cumulative product. .names Optional. character vector names new cumulative product columns. Defaults \"auto\", generates names based original column names. .initial_value numeric value start cumulative product . Defaults 1.","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/std_cum_prod_augment.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Augment Cumulative Product — std_cum_prod_augment","text":"tibble original data additional columns containing cumulative products.","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/std_cum_prod_augment.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Augment Cumulative Product — std_cum_prod_augment","text":"function takes data frame column name (names) computes cumulative product specified column, starting initial value. column names provided, throw error.","code":""},{"path":[]},{"path":"https://www.spsanderson.com/RandomWalker/reference/std_cum_prod_augment.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Augment Cumulative Product — std_cum_prod_augment","text":"Steven P. Sanderson II, MPH","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/std_cum_prod_augment.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Augment Cumulative Product — std_cum_prod_augment","text":"","code":"df <- data.frame(x = 1:5, y = 6:10) std_cum_prod_augment(df, .value = x) #> # A tibble: 5 × 3 #> x y cum_prod_x #> #> 1 1 6 2 #> 2 2 7 6 #> 3 3 8 24 #> 4 4 9 120 #> 5 5 10 720 std_cum_prod_augment(df, .value = y, .names = c(\"cumprod_y\")) #> # A tibble: 5 × 3 #> x y cumprod_y #> #> 1 1 6 7 #> 2 2 7 56 #> 3 3 8 504 #> 4 4 9 5040 #> 5 5 10 55440"},{"path":"https://www.spsanderson.com/RandomWalker/reference/std_cum_sum_augment.html","id":null,"dir":"Reference","previous_headings":"","what":"Augment Cumulative Sum — std_cum_sum_augment","title":"Augment Cumulative Sum — std_cum_sum_augment","text":"function augments data frame adding cumulative sum columns specified variables.","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/std_cum_sum_augment.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Augment Cumulative Sum — std_cum_sum_augment","text":"","code":"std_cum_sum_augment(.data, .value, .names = \"auto\", .initial_value = 0)"},{"path":"https://www.spsanderson.com/RandomWalker/reference/std_cum_sum_augment.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Augment Cumulative Sum — std_cum_sum_augment","text":".data data frame augment. .value column name names compute cumulative sum. .names Optional. character vector names new cumulative sum columns. Defaults \"auto\", generates names based original column names. .initial_value numeric value start cumulative sum . Defaults 0.","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/std_cum_sum_augment.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Augment Cumulative Sum — std_cum_sum_augment","text":"tibble original data additional columns containing cumulative sums.","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/std_cum_sum_augment.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Augment Cumulative Sum — std_cum_sum_augment","text":"function takes data frame column name (names) computes cumulative sum specified column, starting initial value. column names provided, throw error.","code":""},{"path":[]},{"path":"https://www.spsanderson.com/RandomWalker/reference/std_cum_sum_augment.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Augment Cumulative Sum — std_cum_sum_augment","text":"Steven P. Sanderson II, MPH","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/std_cum_sum_augment.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Augment Cumulative Sum — std_cum_sum_augment","text":"","code":"df <- data.frame(x = 1:5, y = 6:10) std_cum_sum_augment(df, .value = x) #> # A tibble: 5 × 3 #> x y cum_sum_x #> #> 1 1 6 1 #> 2 2 7 3 #> 3 3 8 6 #> 4 4 9 10 #> 5 5 10 15 std_cum_sum_augment(df, .value = y, .names = c(\"cumsum_y\")) #> # A tibble: 5 × 3 #> x y cumsum_y #> #> 1 1 6 6 #> 2 2 7 13 #> 3 3 8 21 #> 4 4 9 30 #> 5 5 10 40"},{"path":"https://www.spsanderson.com/RandomWalker/reference/summarize_walks.html","id":null,"dir":"Reference","previous_headings":"","what":"Summarize Walks Data — summarize_walks","title":"Summarize Walks Data — summarize_walks","text":"Summarizes random walk data computing statistical measures.","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/summarize_walks.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Summarize Walks Data — summarize_walks","text":"","code":"summarize_walks(.data, .value, .group_var) summarise_walks(.data, .value, .group_var)"},{"path":"https://www.spsanderson.com/RandomWalker/reference/summarize_walks.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Summarize Walks Data — summarize_walks","text":".data data frame tibble containing random walk data. .value column name (unquoted) representing value summarize. .group_var column name (unquoted) representing grouping variable.","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/summarize_walks.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Summarize Walks Data — summarize_walks","text":"tibble containing summarized statistics group, including mean, median, range, quantiles, variance, standard deviation, .","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/summarize_walks.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Summarize Walks Data — summarize_walks","text":"function requires input data frame contains column named 'walk_number' value summarize provided. computes statistics mean, median, variance, quantiles specified value variable. #' function summarizes data frame containing random walk data computing various statistical measures specified value variable, grouped specified grouping variable. checks necessary attributes ensures data frame structured correctly.","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/summarize_walks.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Summarize Walks Data — summarize_walks","text":"Steven P. Sanderson II, MPH","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/summarize_walks.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Summarize Walks Data — summarize_walks","text":"","code":"library(dplyr) #> #> Attaching package: 'dplyr' #> The following objects are masked from 'package:stats': #> #> filter, lag #> The following objects are masked from 'package:base': #> #> intersect, setdiff, setequal, union # Example data frame walk_data <- random_normal_walk(.initial_value = 100) # Summarize the walks summarize_walks(walk_data, cum_sum, walk_number) |> glimpse() #> Registered S3 method overwritten by 'quantmod': #> method from #> as.zoo.data.frame zoo #> Rows: 25 #> Columns: 17 #> $ walk_number 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, … #> $ fns \"random_normal_walk\", \"random_normal_walk\", \"random_nor… #> $ fns_name \"Random Normal Walk\", \"Random Normal Walk\", \"Random Nor… #> $ dimensions 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1… #> $ mean_val 100.10659, 99.82922, 99.52922, 98.75850, 100.85864, 100… #> $ median 100.07614, 99.81004, 99.46064, 98.59080, 100.87054, 99.… #> $ range 1.4702499, 0.7206181, 0.9869902, 1.9579304, 1.4119450, … #> $ quantile_lo 99.47986, 99.56809, 99.17375, 98.08058, 100.38400, 99.6… #> $ quantile_hi 100.79633, 100.17122, 100.01265, 99.74580, 101.37084, 1… #> $ variance 0.14913626, 0.02532646, 0.07434017, 0.24369466, 0.10788… #> $ sd 0.3861816, 0.1591429, 0.2726539, 0.4936544, 0.3284642, … #> $ min_val 99.43543, 99.49121, 99.05844, 98.04468, 100.10611, 99.6… #> $ max_val 100.90568, 100.21183, 100.04543, 100.00261, 101.51805, … #> $ harmonic_mean 100.10512, 99.82897, 99.52849, 98.75607, 100.85759, 100… #> $ geometric_mean 100.10585, 99.82910, 99.52885, 98.75728, 100.85812, 100… #> $ skewness 0.18662786, 0.34427100, 0.42980993, 0.41718949, -0.0445… #> $ kurtosis -0.9483369, -0.1798819, -1.1319872, -0.8449953, -0.9673… summarize_walks(walk_data, y) |> glimpse() #> Warning: There was 1 warning in `dplyr::summarize()`. #> ℹ In argument: `geometric_mean = exp(mean(log(y)))`. #> Caused by warning in `log()`: #> ! NaNs produced #> Rows: 1 #> Columns: 16 #> $ fns \"random_normal_walk\" #> $ fns_name \"Random Normal Walk\" #> $ dimensions 1 #> $ mean_val -0.002189823 #> $ median -0.005327023 #> $ range 0.6899619 #> $ quantile_lo -0.1991602 #> $ quantile_hi 0.1989294 #> $ variance 0.01035473 #> $ sd 0.1017582 #> $ min_val -0.3047861 #> $ max_val 0.3851758 #> $ harmonic_mean -0.01258915 #> $ geometric_mean NaN #> $ skewness 0.1464476 #> $ kurtosis 0.09097494 # Example with missing value variable # summarize_walks(walk_data, NULL, group) # This will trigger an error."},{"path":"https://www.spsanderson.com/RandomWalker/reference/visualize_walks.html","id":null,"dir":"Reference","previous_headings":"","what":"Visualize Walks — visualize_walks","title":"Visualize Walks — visualize_walks","text":"visualize_walks() visualizes output random walk functions RandomWalker package, resulting one ggplot2 plots put together patchwork composed 1 patches.","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/visualize_walks.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Visualize Walks — visualize_walks","text":"","code":"visualize_walks(.data, .alpha = 0.7)"},{"path":"https://www.spsanderson.com/RandomWalker/reference/visualize_walks.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Visualize Walks — visualize_walks","text":".data input data. Assumed created one random walk functions RandomWalker package, can data frame tibble contains columns walk_number, x, one numeric columns like x, cum_sum, cum_prod, cum_min, cum_max cum_mean, instance. .alpha alpha value line charts visualization. Values range 0 1. Default 0.7.","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/visualize_walks.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Visualize Walks — visualize_walks","text":"patchwork composed 1 patches","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/visualize_walks.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Visualize Walks — visualize_walks","text":"visualize_walks() generates visualizations random walks generated random walk functions RandomWalker package. functions moment writing: brownian_motion() discrete_walk() geometric_brownian_motion() random_normal_drift_walk() random_normal_walk() rw30() possible read , can check rest documentation current situation. visualization function meant easy use. parameters needed, can set .alpha default value 0.7 liking. can combine function many tidyverse functions (either ). one example .","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/visualize_walks.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Visualize Walks — visualize_walks","text":"Antti Lennart Rask","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/visualize_walks.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Visualize Walks — visualize_walks","text":"","code":"# Generate random walks and visualize the result set.seed(123) rw30() |> visualize_walks() # Set the alpha value to be other than the default 0.7 set.seed(123) rw30() |> visualize_walks(.alpha = 0.5) # Use the function with an input that has alternatives for y set.seed(123) random_normal_walk() |> visualize_walks() # Use the pluck function from purrr to pick just one visualization set.seed(123) random_normal_walk() |> visualize_walks() |> purrr::pluck(2)"},{"path":[]},{"path":"https://www.spsanderson.com/RandomWalker/news/index.html","id":"breaking-changes-development-version","dir":"Changelog","previous_headings":"","what":"Breaking Changes","title":"RandomWalker (development version)","text":"None","code":""},{"path":"https://www.spsanderson.com/RandomWalker/news/index.html","id":"new-features-development-version","dir":"Changelog","previous_headings":"","what":"New Features","title":"RandomWalker (development version)","text":"Fix #92 - Add Function std_cum_sum_augment() calculate cumulative sum random walk 2 Fix #93 - Add Function std_cum_prod_augment() calculate cumulative product random walk Fix #94 - Add Function std_cum_min_augment() calculate cumulative minimum random walk Fix #95 - Add Function std_cum_max_augment() calculate cumulative maximum random walk Fix #96 - Add Function std_cum_mean_augment() calculate cumulative mean random walk","code":""},{"path":"https://www.spsanderson.com/RandomWalker/news/index.html","id":"minor-improvements-and-fixes-development-version","dir":"Changelog","previous_headings":"","what":"Minor Improvements and Fixes","title":"RandomWalker (development version)","text":"None","code":""},{"path":"https://www.spsanderson.com/RandomWalker/news/index.html","id":"randomwalker-010","dir":"Changelog","previous_headings":"","what":"RandomWalker 0.1.0","title":"RandomWalker 0.1.0","text":"CRAN release: 2024-09-15","code":""},{"path":"https://www.spsanderson.com/RandomWalker/news/index.html","id":"breaking-changes-0-1-0","dir":"Changelog","previous_headings":"","what":"Breaking Changes","title":"RandomWalker 0.1.0","text":"None","code":""},{"path":"https://www.spsanderson.com/RandomWalker/news/index.html","id":"new-features-0-1-0","dir":"Changelog","previous_headings":"","what":"New Features","title":"RandomWalker 0.1.0","text":"Fix #9 - Add Function rw30() generate 30 random walks 100 steps Fix #17 - Add Function geometric_brownian_motion() generate Geometric Brownian Motion Fix #18 - Add Function random_normal_drift_walk() generate Random Walk Drift Fix #16 - Add Function brownian_motion() generate Brownian Motion Fix #13 - Add Function random_normal_walk() generate Random Walk Fix #30 - Add Function discrete_walk() generate Discrete Random Walk Fix #43 - Add vectorized functions Fix #44 - Add Function internal_rand_walk_helper() help generate common columns random walks. Fix #34 - Add Function euclidean_distance() calculate Euclidean distance random walk. Fix #33 - Add Function visualize_walks() visualize random walks. Fix #66 - Add Function summarize_walks() summarize random walks.","code":""},{"path":"https://www.spsanderson.com/RandomWalker/news/index.html","id":"minor-improvements-and-fixes-0-1-0","dir":"Changelog","previous_headings":"","what":"Minor Improvements and Fixes","title":"RandomWalker 0.1.0","text":"None","code":""}] +[{"path":"https://www.spsanderson.com/RandomWalker/articles/getting-started.html","id":"random-walks","dir":"Articles","previous_headings":"","what":"Random Walks","title":"Getting Started with RandomWalker","text":"random walk? random walk mathematical concept describing path consisting succession random steps. step independent previous ones, direction distance step determined chance. simplest form random walk one-dimensional walk, object moves either forward backward equal probability step. random walk, average position object NN steps zero, average square distance starting point NN, meaning object typically N\\sqrt{N} steps away start NN steps. concept widely used various fields, including physics, economics, computer science, model phenomena particle diffusion, stock price movements, network topology. finance, random walk theory suggests stock prices move unpredictably, making impossible predict future prices based past movements. theory underpins Efficient Market Hypothesis, posits available information already reflected stock prices, thus making impossible consistently outperform market. higher dimensions, random walks exhibit complex geometric properties can used model intricate systems, behavior particles fluid structure networks. understanding random walks, researchers can gain insights various stochastic processes applications across different scientific practical domains. Now basic understanding concepts, let’s explore can create visualize random walks using RandomWalker package R.","code":""},{"path":"https://www.spsanderson.com/RandomWalker/articles/getting-started.html","id":"installation","dir":"Articles","previous_headings":"","what":"Installation","title":"Getting Started with RandomWalker","text":"can install released version RandomWalker CRAN : can install development version RandomWalker GitHub :","code":"install.packages(\"RandomWalker\") # install.packages(\"devtools\") devtools::install_github(\"spsanderson/RandomWalker\")"},{"path":"https://www.spsanderson.com/RandomWalker/articles/getting-started.html","id":"example-usage","dir":"Articles","previous_headings":"","what":"Example Usage","title":"Getting Started with RandomWalker","text":"Let’s start generating simple random walk using rw30() function RandomWalker package. function generates random walk 30 steps. output shows first 10 steps random walk. step represents position object moving forward backward one unit. rw30() function takes parameters generates 30 random walks 100 steps. uses rnorm() function generate random numbers normal distribution mean 0 standard deviation 1.","code":"rw30() |> head(10) #> # A tibble: 10 × 3 #> walk_number x y #> #> 1 1 1 0 #> 2 1 2 -1.40 #> 3 1 3 -1.14 #> 4 1 4 -3.58 #> 5 1 5 -3.59 #> 6 1 6 -2.97 #> 7 1 7 -1.82 #> 8 1 8 -3.64 #> 9 1 9 -3.89 #> 10 1 10 -4.13"},{"path":"https://www.spsanderson.com/RandomWalker/articles/getting-started.html","id":"attributes","dir":"Articles","previous_headings":"","what":"Attributes","title":"Getting Started with RandomWalker","text":"function RandomWalker package attributes can accessed using attributes() function. example, let’s look attributes rw30() function:","code":"atb <- attributes(rw30()) atb[!names(atb) %in% c(\"row.names\")] #> $names #> [1] \"walk_number\" \"x\" \"y\" #> #> $class #> [1] \"tbl_df\" \"tbl\" \"data.frame\" #> #> $num_walks #> [1] 30 #> #> $num_steps #> [1] 100 #> #> $mu #> [1] 0 #> #> $sd #> [1] 1 #> #> $fns #> [1] \"rw30\" #> #> $dimension #> [1] 1"},{"path":"https://www.spsanderson.com/RandomWalker/articles/getting-started.html","id":"visualizing-random-walks","dir":"Articles","previous_headings":"","what":"Visualizing Random Walks","title":"Getting Started with RandomWalker","text":"visualize random walk generated rw30() function, can use visualize_walks() function. function creates line plot showing path random walk time. plot shows path random walk time, x-axis representing number steps y-axis representing position object. random walk exhibits random pattern movement, object moving forward backward seemingly unpredictable manner.","code":"visualize_walks(rw30())"},{"path":"https://www.spsanderson.com/RandomWalker/articles/getting-started.html","id":"future-direction","dir":"Articles","previous_headings":"","what":"Future Direction","title":"Getting Started with RandomWalker","text":"now RandomWalker supports 1-dimensional random walks. future, plan extend package support higher-dimensional random walks provide additional functionalities analyzing visualizing random walks various contexts. hope vignette provided basic understanding random walks use RandomWalker package R. questions feedback, please feel free reach us.","code":""},{"path":"https://www.spsanderson.com/RandomWalker/articles/getting-started.html","id":"references","dir":"Articles","previous_headings":"","what":"References","title":"Getting Started with RandomWalker","text":"Issues Discussions Random Walks Wikipedia","code":""},{"path":"https://www.spsanderson.com/RandomWalker/authors.html","id":null,"dir":"","previous_headings":"","what":"Authors","title":"Authors and Citation","text":"Steven Sanderson. Author, maintainer, copyright holder. Antti Rask. Author, copyright holder.","code":""},{"path":"https://www.spsanderson.com/RandomWalker/authors.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"Authors and Citation","text":"Sanderson S, Rask (2024). RandomWalker: Generate Random Walks Compatible 'tidyverse'. R package version 0.1.0.9000, https://github.com/spsanderson/RandomWalker, https://www.spsanderson.com/RandomWalker/.","code":"@Manual{, title = {RandomWalker: Generate Random Walks Compatible with the 'tidyverse'}, author = {Steven Sanderson and Antti Rask}, year = {2024}, note = {R package version 0.1.0.9000, https://github.com/spsanderson/RandomWalker}, url = {https://www.spsanderson.com/RandomWalker/}, }"},{"path":"https://www.spsanderson.com/RandomWalker/index.html","id":"randomwalker-","dir":"","previous_headings":"","what":"Generate Random Walks Compatible with the tidyverse","title":"Generate Random Walks Compatible with the tidyverse","text":"goal RandomWalker allow users easily create Random Walks different types compatible tidyverse suite packages. package currently experimental stage development.","code":""},{"path":"https://www.spsanderson.com/RandomWalker/index.html","id":"installation","dir":"","previous_headings":"","what":"Installation","title":"Generate Random Walks Compatible with the tidyverse","text":"can install released version {TidyDensity} CRAN : can install development version RandomWalker GitHub :","code":"install.packages(\"RandomWalker\") # install.packages(\"devtools\") devtools::install_github(\"spsanderson/RandomWalker\")"},{"path":"https://www.spsanderson.com/RandomWalker/index.html","id":"example","dir":"","previous_headings":"","what":"Example","title":"Generate Random Walks Compatible with the tidyverse","text":"basic example shows solve common problem: basic visualization Random Walk:","code":"library(RandomWalker) ## basic example code rw30() |> head(10) #> # A tibble: 10 × 3 #> walk_number x y #> #> 1 1 1 0 #> 2 1 2 -0.895 #> 3 1 3 -1.21 #> 4 1 4 -0.805 #> 5 1 5 -1.42 #> 6 1 6 -2.50 #> 7 1 7 -2.58 #> 8 1 8 -3.19 #> 9 1 9 -3.46 #> 10 1 10 -3.90 rw30() |> visualize_walks()"},{"path":"https://www.spsanderson.com/RandomWalker/LICENSE.html","id":null,"dir":"","previous_headings":"","what":"MIT License","title":"MIT License","text":"Copyright (c) 2024 Steven P. Sanderson II, MPH Permission hereby granted, free charge, person obtaining copy software associated documentation files (“Software”), deal Software without restriction, including without limitation rights use, copy, modify, merge, publish, distribute, sublicense, /sell copies Software, permit persons Software furnished , subject following conditions: copyright notice permission notice shall included copies substantial portions Software. SOFTWARE PROVIDED “”, WITHOUT WARRANTY KIND, EXPRESS IMPLIED, INCLUDING LIMITED WARRANTIES MERCHANTABILITY, FITNESS PARTICULAR PURPOSE NONINFRINGEMENT. EVENT SHALL AUTHORS COPYRIGHT HOLDERS LIABLE CLAIM, DAMAGES LIABILITY, WHETHER ACTION CONTRACT, TORT OTHERWISE, ARISING , CONNECTION SOFTWARE USE DEALINGS SOFTWARE.","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/brownian_motion.html","id":null,"dir":"Reference","previous_headings":"","what":"Brownian Motion — brownian_motion","title":"Brownian Motion — brownian_motion","text":"Create Brownian Motion Tibble","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/brownian_motion.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Brownian Motion — brownian_motion","text":"","code":"brownian_motion( .num_walks = 25, .n = 100, .delta_time = 1, .initial_value = 0, .return_tibble = TRUE )"},{"path":"https://www.spsanderson.com/RandomWalker/reference/brownian_motion.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Brownian Motion — brownian_motion","text":".num_walks Total number simulations. .n Total time simulation. .delta_time Time step size. .initial_value Integer representing initial value. .return_tibble default TRUE. set FALSE object class matrix returned.","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/brownian_motion.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Brownian Motion — brownian_motion","text":"tibble/matrix","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/brownian_motion.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Brownian Motion — brownian_motion","text":"Brownian Motion, also known Wiener process, continuous-time random process describes random movement particles suspended fluid. named physicist Robert Brown, first described phenomenon 1827. equation Brownian Motion can represented : W(t) Brownian motion time t, W(0) initial value Brownian motion, sqrt(t) square root time, Z standard normal random variable. Brownian Motion numerous applications, including modeling stock prices financial markets, modeling particle movement fluids, modeling random walk processes general. useful tool probability theory statistical analysis.","code":"W(t) = W(0) + sqrt(t) * Z"},{"path":[]},{"path":"https://www.spsanderson.com/RandomWalker/reference/brownian_motion.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Brownian Motion — brownian_motion","text":"Steven P. Sanderson II, MPH","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/brownian_motion.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Brownian Motion — brownian_motion","text":"","code":"library(ggplot2) set.seed(123) brownian_motion() #> # A tibble: 2,525 × 6 #> walk_number x y cum_min cum_max cum_mean #> #> 1 1 1 0 0 0 0 #> 2 1 2 -0.560 -0.560 0 -0.280 #> 3 1 3 -0.791 -0.791 0 -0.450 #> 4 1 4 0.768 -0.791 0.768 -0.146 #> 5 1 5 0.839 -0.791 0.839 0.0511 #> 6 1 6 0.968 -0.791 0.968 0.204 #> 7 1 7 2.68 -0.791 2.68 0.558 #> 8 1 8 3.14 -0.791 3.14 0.881 #> 9 1 9 1.88 -0.791 3.14 0.992 #> 10 1 10 1.19 -0.791 3.14 1.01 #> # ℹ 2,515 more rows set.seed(123) brownian_motion() |> ggplot(aes(x = x, y = y, group = walk_number, color = walk_number)) + geom_line() + labs(title = \"Brownian Motion\", x = \"Time\", y = \"Value\") + theme_minimal() + theme(legend.position = \"none\")"},{"path":"https://www.spsanderson.com/RandomWalker/reference/cgmean.html","id":null,"dir":"Reference","previous_headings":"","what":"Cumulative Geometric Mean — cgmean","title":"Cumulative Geometric Mean — cgmean","text":"function return cumulative geometric mean vector.","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/cgmean.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Cumulative Geometric Mean — cgmean","text":"","code":"cgmean(.x)"},{"path":"https://www.spsanderson.com/RandomWalker/reference/cgmean.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Cumulative Geometric Mean — cgmean","text":".x numeric vector","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/cgmean.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Cumulative Geometric Mean — cgmean","text":"numeric vector","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/cgmean.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Cumulative Geometric Mean — cgmean","text":"function return cumulative geometric mean vector. exp(cummean(log(.x)))","code":""},{"path":[]},{"path":"https://www.spsanderson.com/RandomWalker/reference/cgmean.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Cumulative Geometric Mean — cgmean","text":"Steven P. Sanderson II, MPH","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/cgmean.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Cumulative Geometric Mean — cgmean","text":"","code":"x <- mtcars$mpg cgmean(x) #> [1] 21.00000 21.00000 21.58363 21.53757 20.93755 20.43547 19.41935 19.98155 #> [9] 20.27666 20.16633 19.93880 19.61678 19.42805 19.09044 18.33287 17.69470 #> [17] 17.50275 18.11190 18.61236 19.17879 19.28342 19.09293 18.90457 18.62961 #> [25] 18.65210 18.92738 19.15126 19.46993 19.33021 19.34242 19.18443 19.25006"},{"path":"https://www.spsanderson.com/RandomWalker/reference/chmean.html","id":null,"dir":"Reference","previous_headings":"","what":"Cumulative Harmonic Mean — chmean","title":"Cumulative Harmonic Mean — chmean","text":"function return cumulative harmonic mean vector.","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/chmean.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Cumulative Harmonic Mean — chmean","text":"","code":"chmean(.x)"},{"path":"https://www.spsanderson.com/RandomWalker/reference/chmean.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Cumulative Harmonic Mean — chmean","text":".x numeric vector","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/chmean.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Cumulative Harmonic Mean — chmean","text":"numeric vector","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/chmean.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Cumulative Harmonic Mean — chmean","text":"function return cumulative harmonic mean vector. 1 / (cumsum(1 / .x))","code":""},{"path":[]},{"path":"https://www.spsanderson.com/RandomWalker/reference/chmean.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Cumulative Harmonic Mean — chmean","text":"Steven P. Sanderson II, MPH","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/chmean.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Cumulative Harmonic Mean — chmean","text":"","code":"x <- mtcars$mpg chmean(x) #> [1] 21.0000000 10.5000000 7.1891892 5.3813575 4.1788087 3.3949947 #> [7] 2.7436247 2.4663044 2.2255626 1.9943841 1.7934398 1.6166494 #> [13] 1.4784877 1.3474251 1.1928760 1.0701322 0.9975150 0.9677213 #> [19] 0.9378663 0.9126181 0.8754572 0.8286539 0.7858140 0.7419753 #> [25] 0.7143688 0.6961523 0.6779989 0.6632076 0.6364908 0.6165699 #> [31] 0.5922267 0.5762786"},{"path":"https://www.spsanderson.com/RandomWalker/reference/ckurtosis.html","id":null,"dir":"Reference","previous_headings":"","what":"Cumulative Kurtosis — ckurtosis","title":"Cumulative Kurtosis — ckurtosis","text":"function return cumulative kurtosis vector.","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/ckurtosis.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Cumulative Kurtosis — ckurtosis","text":"","code":"ckurtosis(.x)"},{"path":"https://www.spsanderson.com/RandomWalker/reference/ckurtosis.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Cumulative Kurtosis — ckurtosis","text":".x numeric vector","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/ckurtosis.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Cumulative Kurtosis — ckurtosis","text":"numeric vector","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/ckurtosis.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Cumulative Kurtosis — ckurtosis","text":"function return cumulative kurtosis vector.","code":""},{"path":[]},{"path":"https://www.spsanderson.com/RandomWalker/reference/ckurtosis.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Cumulative Kurtosis — ckurtosis","text":"Steven P. Sanderson II, MPH","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/ckurtosis.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Cumulative Kurtosis — ckurtosis","text":"","code":"x <- mtcars$mpg ckurtosis(x) #> [1] NaN NaN 1.500000 2.189216 2.518932 1.786006 2.744467 2.724675 #> [9] 2.930885 2.988093 2.690270 2.269038 2.176622 1.992044 2.839430 2.481896 #> [17] 2.356826 3.877115 3.174702 2.896931 3.000743 3.091225 3.182071 3.212816 #> [25] 3.352916 3.015952 2.837139 2.535185 2.595908 2.691103 2.738468 2.799467"},{"path":"https://www.spsanderson.com/RandomWalker/reference/cmean.html","id":null,"dir":"Reference","previous_headings":"","what":"Cumulative Mean — cmean","title":"Cumulative Mean — cmean","text":"function return cumulative mean vector.","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/cmean.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Cumulative Mean — cmean","text":"","code":"cmean(.x)"},{"path":"https://www.spsanderson.com/RandomWalker/reference/cmean.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Cumulative Mean — cmean","text":".x numeric vector","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/cmean.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Cumulative Mean — cmean","text":"numeric vector","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/cmean.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Cumulative Mean — cmean","text":"function return cumulative mean vector. uses dplyr::cummean() basis function.","code":""},{"path":[]},{"path":"https://www.spsanderson.com/RandomWalker/reference/cmean.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Cumulative Mean — cmean","text":"Steven P. Sanderson II, MPH","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/cmean.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Cumulative Mean — cmean","text":"","code":"x <- mtcars$mpg cmean(x) #> [1] 21.00000 21.00000 21.60000 21.55000 20.98000 20.50000 19.61429 20.21250 #> [9] 20.50000 20.37000 20.13636 19.82500 19.63077 19.31429 18.72000 18.20000 #> [17] 17.99412 18.79444 19.40526 20.13000 20.19524 19.98182 19.77391 19.50417 #> [25] 19.49200 19.79231 20.02222 20.39286 20.23448 20.21667 20.04839 20.09062"},{"path":"https://www.spsanderson.com/RandomWalker/reference/cmedian.html","id":null,"dir":"Reference","previous_headings":"","what":"Cumulative Median — cmedian","title":"Cumulative Median — cmedian","text":"function return cumulative median vector.","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/cmedian.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Cumulative Median — cmedian","text":"","code":"cmedian(.x)"},{"path":"https://www.spsanderson.com/RandomWalker/reference/cmedian.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Cumulative Median — cmedian","text":".x numeric vector","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/cmedian.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Cumulative Median — cmedian","text":"numeric vector","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/cmedian.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Cumulative Median — cmedian","text":"function return cumulative median vector.","code":""},{"path":[]},{"path":"https://www.spsanderson.com/RandomWalker/reference/cmedian.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Cumulative Median — cmedian","text":"Steven P. Sanderson II, MPH","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/cmedian.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Cumulative Median — cmedian","text":"","code":"x <- mtcars$mpg cmedian(x) #> [1] 21.00 21.00 21.00 21.20 21.00 21.00 21.00 21.00 21.00 21.00 21.00 20.10 #> [13] 19.20 18.95 18.70 18.40 18.10 18.40 18.70 18.95 19.20 18.95 18.70 18.40 #> [25] 18.70 18.95 19.20 19.20 19.20 19.20 19.20 19.20"},{"path":"https://www.spsanderson.com/RandomWalker/reference/convert_snake_to_title_case.html","id":null,"dir":"Reference","previous_headings":"","what":"Helper function to convert a snake_case string to Title Case — convert_snake_to_title_case","title":"Helper function to convert a snake_case string to Title Case — convert_snake_to_title_case","text":"Converts snake_case string Title Case.","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/convert_snake_to_title_case.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Helper function to convert a snake_case string to Title Case — convert_snake_to_title_case","text":"","code":"convert_snake_to_title_case(string)"},{"path":"https://www.spsanderson.com/RandomWalker/reference/convert_snake_to_title_case.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Helper function to convert a snake_case string to Title Case — convert_snake_to_title_case","text":"string character string snake_case format.","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/convert_snake_to_title_case.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Helper function to convert a snake_case string to Title Case — convert_snake_to_title_case","text":"character string converted Title Case.","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/convert_snake_to_title_case.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Helper function to convert a snake_case string to Title Case — convert_snake_to_title_case","text":"function useful formatting strings readable way, especially dealing variable names identifiers use snake_case. function takes snake_case string converts Title Case. replaces underscores spaces, capitalizes first letter word, replaces substring \"cum\" \"cumulative\" better readability.","code":""},{"path":[]},{"path":"https://www.spsanderson.com/RandomWalker/reference/convert_snake_to_title_case.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Helper function to convert a snake_case string to Title Case — convert_snake_to_title_case","text":"Antti Lennart Rask","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/convert_snake_to_title_case.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Helper function to convert a snake_case string to Title Case — convert_snake_to_title_case","text":"","code":"convert_snake_to_title_case(\"hello_world\") # \"Hello World\" #> [1] \"Hello World\" convert_snake_to_title_case(\"this_is_a_test\") # \"This Is A Test\" #> [1] \"This Is A Test\" convert_snake_to_title_case(\"cumulative_sum\") # \"Cumulative Sum\" #> [1] \"Cumulative Sum\""},{"path":"https://www.spsanderson.com/RandomWalker/reference/crange.html","id":null,"dir":"Reference","previous_headings":"","what":"Cumulative Range — crange","title":"Cumulative Range — crange","text":"function return cumulative range vector.","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/crange.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Cumulative Range — crange","text":"","code":"crange(.x)"},{"path":"https://www.spsanderson.com/RandomWalker/reference/crange.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Cumulative Range — crange","text":".x numeric vector","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/crange.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Cumulative Range — crange","text":"numeric vector","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/crange.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Cumulative Range — crange","text":"function return cumulative range vector. uses max(.x[1:k]) - min(.x[1:k]) basis function.","code":""},{"path":[]},{"path":"https://www.spsanderson.com/RandomWalker/reference/crange.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Cumulative Range — crange","text":"Steven P. Sanderson II, MPH","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/crange.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Cumulative Range — crange","text":"","code":"x <- mtcars$mpg crange(x) #> [1] 0.0 0.0 1.8 1.8 4.1 4.7 8.5 10.1 10.1 10.1 10.1 10.1 10.1 10.1 14.0 #> [16] 14.0 14.0 22.0 22.0 23.5 23.5 23.5 23.5 23.5 23.5 23.5 23.5 23.5 23.5 23.5 #> [31] 23.5 23.5"},{"path":"https://www.spsanderson.com/RandomWalker/reference/csd.html","id":null,"dir":"Reference","previous_headings":"","what":"Cumulative Standard Deviation — csd","title":"Cumulative Standard Deviation — csd","text":"function return cumulative standard deviation vector.","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/csd.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Cumulative Standard Deviation — csd","text":"","code":"csd(.x)"},{"path":"https://www.spsanderson.com/RandomWalker/reference/csd.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Cumulative Standard Deviation — csd","text":".x numeric vector","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/csd.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Cumulative Standard Deviation — csd","text":"numeric vector. Note: first entry always NaN.","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/csd.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Cumulative Standard Deviation — csd","text":"function return cumulative standard deviation vector.","code":""},{"path":[]},{"path":"https://www.spsanderson.com/RandomWalker/reference/csd.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Cumulative Standard Deviation — csd","text":"Steven P. Sanderson II, MPH","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/csd.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Cumulative Standard Deviation — csd","text":"","code":"x <- mtcars$mpg csd(x) #> [1] NaN 0.0000000 1.0392305 0.8544004 1.4737707 1.7663522 2.8445436 #> [8] 3.1302385 3.0524580 2.9070986 2.8647069 2.9366416 2.8975233 3.0252418 #> [15] 3.7142967 4.1476098 4.1046423 5.2332053 5.7405452 6.4594362 6.3029736 #> [22] 6.2319940 6.1698105 6.1772007 6.0474457 6.1199296 6.1188444 6.3166405 #> [29] 6.2611772 6.1530527 6.1217574 6.0269481"},{"path":"https://www.spsanderson.com/RandomWalker/reference/cskewness.html","id":null,"dir":"Reference","previous_headings":"","what":"Cumulative Skewness — cskewness","title":"Cumulative Skewness — cskewness","text":"function return cumulative skewness vector.","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/cskewness.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Cumulative Skewness — cskewness","text":"","code":"cskewness(.x)"},{"path":"https://www.spsanderson.com/RandomWalker/reference/cskewness.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Cumulative Skewness — cskewness","text":".x numeric vector","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/cskewness.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Cumulative Skewness — cskewness","text":"numeric vector","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/cskewness.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Cumulative Skewness — cskewness","text":"function return cumulative skewness vector.","code":""},{"path":[]},{"path":"https://www.spsanderson.com/RandomWalker/reference/cskewness.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Cumulative Skewness — cskewness","text":"Steven P. Sanderson II, MPH","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/cskewness.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Cumulative Skewness — cskewness","text":"","code":"x <- mtcars$mpg cskewness(x) #> [1] NaN NaN 0.707106781 0.997869718 -0.502052297 #> [6] -0.258803244 -0.867969171 -0.628239920 -0.808101715 -0.695348960 #> [11] -0.469220594 -0.256323338 -0.091505282 0.002188142 -0.519593266 #> [16] -0.512660692 -0.379598706 0.614549281 0.581410573 0.649357202 #> [21] 0.631855977 0.706212631 0.775750182 0.821447605 0.844413861 #> [26] 0.716010069 0.614326432 0.525141032 0.582528820 0.601075783 #> [31] 0.652552397 0.640439864"},{"path":"https://www.spsanderson.com/RandomWalker/reference/cvar.html","id":null,"dir":"Reference","previous_headings":"","what":"Cumulative Variance — cvar","title":"Cumulative Variance — cvar","text":"function return cumulative variance vector.","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/cvar.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Cumulative Variance — cvar","text":"","code":"cvar(.x)"},{"path":"https://www.spsanderson.com/RandomWalker/reference/cvar.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Cumulative Variance — cvar","text":".x numeric vector","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/cvar.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Cumulative Variance — cvar","text":"numeric vector. Note: first entry always NaN.","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/cvar.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Cumulative Variance — cvar","text":"function return cumulative variance vector. exp(cummean(log(.x)))","code":""},{"path":[]},{"path":"https://www.spsanderson.com/RandomWalker/reference/cvar.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Cumulative Variance — cvar","text":"Steven P. Sanderson II, MPH","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/cvar.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Cumulative Variance — cvar","text":"","code":"x <- mtcars$mpg cvar(x) #> [1] NaN 0.000000 1.080000 0.730000 2.172000 3.120000 8.091429 #> [8] 9.798393 9.317500 8.451222 8.206545 8.623864 8.395641 9.152088 #> [15] 13.796000 17.202667 16.848088 27.386438 32.953860 41.724316 39.727476 #> [22] 38.837749 38.066561 38.157808 36.571600 37.453538 37.440256 39.899947 #> [29] 39.202340 37.860057 37.475914 36.324103"},{"path":"https://www.spsanderson.com/RandomWalker/reference/discrete_walk.html","id":null,"dir":"Reference","previous_headings":"","what":"Discrete Sampled Walk — discrete_walk","title":"Discrete Sampled Walk — discrete_walk","text":"discrete_walk function generates multiple random walks discrete time periods. step walk determined probabilistic sample specified upper lower bounds. function useful simulating stochastic processes, stock price movements scenarios outcomes determined random process.","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/discrete_walk.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Discrete Sampled Walk — discrete_walk","text":"","code":"discrete_walk( .num_walks = 25, .n = 100, .upper_bound = 1, .lower_bound = -1, .upper_probability = 0.5, .initial_value = 100 )"},{"path":"https://www.spsanderson.com/RandomWalker/reference/discrete_walk.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Discrete Sampled Walk — discrete_walk","text":".num_walks Total number simulations. .n Total time simulation. .upper_bound upper bound random walk. .lower_bound lower bound random walk. .upper_probability probability upper bound. Default 0.5. lower bound calculated 1 - .upper_probability. .initial_value initial value random walk. Default 100.","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/discrete_walk.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Discrete Sampled Walk — discrete_walk","text":"tibble containing simulated walks, columns walk number, time period, various cumulative metrics (sum, product, min, max).","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/discrete_walk.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Discrete Sampled Walk — discrete_walk","text":"function discrete_walk simulates random walks specified number simulations (.num_walks) given total time (.n). step walk either upper bound lower bound, determined probability (.upper_probability). initial value walk set user (.initial_value), cumulative sum, product, minimum, maximum steps calculated walk. results returned tibble detailed attributes, including parameters used simulation.","code":""},{"path":[]},{"path":"https://www.spsanderson.com/RandomWalker/reference/discrete_walk.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Discrete Sampled Walk — discrete_walk","text":"Steven P. Sanderson II, MPH","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/discrete_walk.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Discrete Sampled Walk — discrete_walk","text":"","code":"library(ggplot2) set.seed(123) discrete_walk() #> # A tibble: 2,500 × 8 #> walk_number x y cum_sum cum_prod cum_min cum_max cum_mean #> #> 1 1 1 -1 99 0 99 99 99 #> 2 1 2 1 100 0 99 101 100 #> 3 1 3 -1 99 0 99 101 99.7 #> 4 1 4 1 100 0 99 101 100 #> 5 1 5 1 101 0 99 101 100. #> 6 1 6 -1 100 0 99 101 100 #> 7 1 7 1 101 0 99 101 100. #> 8 1 8 1 102 0 99 101 100. #> 9 1 9 1 103 0 99 101 100. #> 10 1 10 -1 102 0 99 101 100. #> # ℹ 2,490 more rows set.seed(123) discrete_walk(.num_walks = 30, .n = 250, .upper_probability = 0.55) |> ggplot(aes(x = x, y = cum_sum)) + geom_line(aes(group = walk_number), alpha = .618, color = \"steelblue\") + theme_minimal() + theme(legend.position = \"none\") + geom_smooth(method = \"lm\", se = FALSE) #> `geom_smooth()` using formula = 'y ~ x'"},{"path":"https://www.spsanderson.com/RandomWalker/reference/euclidean_distance.html","id":null,"dir":"Reference","previous_headings":"","what":"Distance Calculations — euclidean_distance","title":"Distance Calculations — euclidean_distance","text":"function calculate Euclidean distance two vectors.","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/euclidean_distance.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Distance Calculations — euclidean_distance","text":"","code":"euclidean_distance(.data, .x, .y, .pull_vector = FALSE)"},{"path":"https://www.spsanderson.com/RandomWalker/reference/euclidean_distance.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Distance Calculations — euclidean_distance","text":".data data frame .x numeric vector .y numeric vector .pull_vector boolean TRUE FALSE. Default FALSE augment distance data frame. TRUE return vector distances return.","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/euclidean_distance.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Distance Calculations — euclidean_distance","text":"numeric Vector ditances","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/euclidean_distance.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Distance Calculations — euclidean_distance","text":"function calculate Euclidean distance two vectors. uses formula sqrt((x - lag(x))^2 + (y - lag(y))^2). function uses augments data frame new column called distance.","code":""},{"path":[]},{"path":"https://www.spsanderson.com/RandomWalker/reference/euclidean_distance.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Distance Calculations — euclidean_distance","text":"Steven P. Sanderson II, MPH","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/euclidean_distance.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Distance Calculations — euclidean_distance","text":"","code":"set.seed(123) df <- rw30() euclidean_distance(df, x, y) #> # A tibble: 3,000 × 4 #> walk_number x y distance #> #> 1 1 1 0 NA #> 2 1 2 -0.560 1.15 #> 3 1 3 -0.791 1.03 #> 4 1 4 0.768 1.85 #> 5 1 5 0.839 1.00 #> 6 1 6 0.968 1.01 #> 7 1 7 2.68 1.99 #> 8 1 8 3.14 1.10 #> 9 1 9 1.88 1.61 #> 10 1 10 1.19 1.21 #> # ℹ 2,990 more rows euclidean_distance(df, x, y, TRUE) |> head(10) #> [1] NA 1.146356 1.026149 1.851910 1.002483 1.008323 1.985308 1.101110 #> [9] 1.612569 1.213164"},{"path":"https://www.spsanderson.com/RandomWalker/reference/generate_caption.html","id":null,"dir":"Reference","previous_headings":"","what":"Helper function to generate a caption string based on provided attributes — generate_caption","title":"Helper function to generate a caption string based on provided attributes — generate_caption","text":"Generates caption string based provided attributes.","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/generate_caption.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Helper function to generate a caption string based on provided attributes — generate_caption","text":"","code":"generate_caption(attributes)"},{"path":"https://www.spsanderson.com/RandomWalker/reference/generate_caption.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Helper function to generate a caption string based on provided attributes — generate_caption","text":"attributes list containing various attributes may include dimension, num_steps, mu, sd.","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/generate_caption.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Helper function to generate a caption string based on provided attributes — generate_caption","text":"character string representing generated caption. attributes provided, returns empty string.","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/generate_caption.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Helper function to generate a caption string based on provided attributes — generate_caption","text":"function useful creating descriptive captions plots outputs based attributes provided. ensures non-null attributes included caption. function constructs caption string checking various attributes provided list. formats caption based presence specific attributes, dimensions, number steps, statistical parameters like mu standard deviation (sd).","code":""},{"path":[]},{"path":"https://www.spsanderson.com/RandomWalker/reference/generate_caption.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Helper function to generate a caption string based on provided attributes — generate_caption","text":"Antti Lennart Rask","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/generate_caption.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Helper function to generate a caption string based on provided attributes — generate_caption","text":"","code":"attrs <- list(dimension = 3, num_steps = 100, mu = 0.5, sd = 1.2) generate_caption(attrs) # \"3 dimensions, 100 steps, mu = 0.5, sd = 1.2.\" #> [1] \"3 dimensions, 100 steps, mu = 0.5, sd = 1.2.\" attrs <- list(dimension = NULL, num_steps = 50, mu = NULL, sd = 2.0) generate_caption(attrs) # \"50 steps, sd = 2.0.\" #> [1] \"50 steps, sd = 2.\""},{"path":"https://www.spsanderson.com/RandomWalker/reference/geometric_brownian_motion.html","id":null,"dir":"Reference","previous_headings":"","what":"Geometric Brownian Motion — geometric_brownian_motion","title":"Geometric Brownian Motion — geometric_brownian_motion","text":"Create Geometric Brownian Motion.","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/geometric_brownian_motion.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Geometric Brownian Motion — geometric_brownian_motion","text":"","code":"geometric_brownian_motion( .num_walks = 25, .n = 100, .mu = 0, .sigma = 0.1, .initial_value = 100, .delta_time = 0.003, .return_tibble = TRUE )"},{"path":"https://www.spsanderson.com/RandomWalker/reference/geometric_brownian_motion.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Geometric Brownian Motion — geometric_brownian_motion","text":".num_walks Total number simulations. .n Total time simulation, many n points time. .mu Expected return .sigma Volatility .initial_value Integer representing initial value. .delta_time Time step size. .return_tibble default TRUE. set FALSE object class matrix returned.","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/geometric_brownian_motion.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Geometric Brownian Motion — geometric_brownian_motion","text":"tibble/matrix","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/geometric_brownian_motion.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Geometric Brownian Motion — geometric_brownian_motion","text":"Geometric Brownian Motion (GBM) statistical method modeling evolution given financial asset time. type stochastic process, means system undergoes random changes time. GBM widely used field finance model behavior stock prices, foreign exchange rates, financial assets. based assumption asset's price follows random walk, meaning influenced number unpredictable factors market trends, news events, investor sentiment. equation GBM : S price asset, t time, m expected return asset, s volatility asset, dW small random change asset's price. GBM can used estimate likelihood different outcomes given asset, often used conjunction statistical methods make accurate predictions future performance asset. function provides ability simulating estimating parameters GBM process. can used analyze behavior financial assets make informed investment decisions.","code":"dS/S = mdt + sdW"},{"path":[]},{"path":"https://www.spsanderson.com/RandomWalker/reference/geometric_brownian_motion.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Geometric Brownian Motion — geometric_brownian_motion","text":"Steven P. Sanderson II, MPH","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/geometric_brownian_motion.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Geometric Brownian Motion — geometric_brownian_motion","text":"","code":"library(ggplot2) set.seed(123) geometric_brownian_motion() #> # A tibble: 2,525 × 6 #> walk_number x y cum_min cum_max cum_mean #> #> 1 1 1 100 200 200 200 #> 2 1 2 99.7 200. 200 200. #> 3 1 3 99.6 200. 200 200. #> 4 1 4 100. 200. 200. 200. #> 5 1 5 100. 200. 200. 200. #> 6 1 6 101. 200. 201. 200. #> 7 1 7 101. 200. 201. 200. #> 8 1 8 102. 200. 202. 200. #> 9 1 9 101. 200. 202. 201. #> 10 1 10 101. 200. 202. 201. #> # ℹ 2,515 more rows set.seed(123) geometric_brownian_motion() |> ggplot(aes(x = x, y = y, group = walk_number, color = walk_number)) + geom_line() + labs(title = \"Geometric Brownian Motion\", x = \"Time\", y = \"Value\") + theme_minimal() + theme(legend.position = \"none\")"},{"path":"https://www.spsanderson.com/RandomWalker/reference/get_attributes.html","id":null,"dir":"Reference","previous_headings":"","what":"Get Attributes — get_attributes","title":"Get Attributes — get_attributes","text":"get_attributes function takes R object input returns attributes, omitting row.names attribute.","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/get_attributes.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get Attributes — get_attributes","text":"","code":"get_attributes(.data)"},{"path":"https://www.spsanderson.com/RandomWalker/reference/get_attributes.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get Attributes — get_attributes","text":".data R object attributes extracted.","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/get_attributes.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get Attributes — get_attributes","text":"list attributes input R object, excluding row.names.","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/get_attributes.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Get Attributes — get_attributes","text":"function retrieves attributes given R object, excluding row.names attribute.","code":""},{"path":[]},{"path":"https://www.spsanderson.com/RandomWalker/reference/get_attributes.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Get Attributes — get_attributes","text":"Steven P. Sanderson II, MPH","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/get_attributes.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Get Attributes — get_attributes","text":"","code":"get_attributes(rw30()) #> $names #> [1] \"walk_number\" \"x\" \"y\" #> #> $class #> [1] \"tbl_df\" \"tbl\" \"data.frame\" #> #> $num_walks #> [1] 30 #> #> $num_steps #> [1] 100 #> #> $mu #> [1] 0 #> #> $sd #> [1] 1 #> #> $fns #> [1] \"rw30\" #> #> $dimension #> [1] 1 #> get_attributes(iris) #> $names #> [1] \"Sepal.Length\" \"Sepal.Width\" \"Petal.Length\" \"Petal.Width\" \"Species\" #> #> $class #> [1] \"data.frame\" #> get_attributes(mtcars) #> $names #> [1] \"mpg\" \"cyl\" \"disp\" \"hp\" \"drat\" \"wt\" \"qsec\" \"vs\" \"am\" \"gear\" #> [11] \"carb\" #> #> $class #> [1] \"data.frame\" #>"},{"path":"https://www.spsanderson.com/RandomWalker/reference/kurtosis_vec.html","id":null,"dir":"Reference","previous_headings":"","what":"Compute Kurtosis of a Vector — kurtosis_vec","title":"Compute Kurtosis of a Vector — kurtosis_vec","text":"function takes vector input return kurtosis vector. length vector must least four numbers. kurtosis explains sharpness peak distribution data. ((1/n) * sum(x - mu})^4) / ((()1/n) * sum(x - mu)^2)^2","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/kurtosis_vec.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Compute Kurtosis of a Vector — kurtosis_vec","text":"","code":"kurtosis_vec(.x)"},{"path":"https://www.spsanderson.com/RandomWalker/reference/kurtosis_vec.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Compute Kurtosis of a Vector — kurtosis_vec","text":".x numeric vector length four .","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/kurtosis_vec.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Compute Kurtosis of a Vector — kurtosis_vec","text":"kurtosis vector","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/kurtosis_vec.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Compute Kurtosis of a Vector — kurtosis_vec","text":"function return kurtosis vector.","code":""},{"path":[]},{"path":"https://www.spsanderson.com/RandomWalker/reference/kurtosis_vec.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Compute Kurtosis of a Vector — kurtosis_vec","text":"Steven P. Sanderson II, MPH","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/kurtosis_vec.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Compute Kurtosis of a Vector — kurtosis_vec","text":"","code":"set.seed(123) kurtosis_vec(rnorm(100, 3, 2)) #> [1] 2.838947"},{"path":"https://www.spsanderson.com/RandomWalker/reference/name.html","id":null,"dir":"Reference","previous_headings":"","what":"Cumulative Range — name","title":"Cumulative Range — name","text":"function return cumulative range vector.","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/name.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Cumulative Range — name","text":".x numeric vector","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/name.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Cumulative Range — name","text":"numeric vector","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/name.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Cumulative Range — name","text":"function return cumulative range vector. uses max(.x[1:k]) - min(.x[1:k]) basis function.","code":""},{"path":[]},{"path":"https://www.spsanderson.com/RandomWalker/reference/name.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Cumulative Range — name","text":"Steven P. Sanderson II, MPH","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/name.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Cumulative Range — name","text":"","code":"x <- mtcars$mpg crange(x) #> [1] 0.0 0.0 1.8 1.8 4.1 4.7 8.5 10.1 10.1 10.1 10.1 10.1 10.1 10.1 14.0 #> [16] 14.0 14.0 22.0 22.0 23.5 23.5 23.5 23.5 23.5 23.5 23.5 23.5 23.5 23.5 23.5 #> [31] 23.5 23.5"},{"path":"https://www.spsanderson.com/RandomWalker/reference/random_normal_drift_walk.html","id":null,"dir":"Reference","previous_headings":"","what":"Generate Multiple Random Walks with Drift — random_normal_drift_walk","title":"Generate Multiple Random Walks with Drift — random_normal_drift_walk","text":"function generates specified number random walks, consisting specified number steps. steps generated normal distribution given mean standard deviation. additional drift term added step introduce consistent directional component walks.","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/random_normal_drift_walk.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Generate Multiple Random Walks with Drift — random_normal_drift_walk","text":"","code":"random_normal_drift_walk( .num_walks = 25, .n = 100, .mu = 0, .sd = 1, .drift = 0.1, .initial_value = 0 )"},{"path":"https://www.spsanderson.com/RandomWalker/reference/random_normal_drift_walk.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Generate Multiple Random Walks with Drift — random_normal_drift_walk","text":".num_walks Integer. number random walks generate. Default 25. .n Integer. number steps random walk. Default 100. .mu Numeric. mean normal distribution used generating steps. Default 0. .sd Numeric. standard deviation normal distribution used generating steps. Default 1. .drift Numeric. drift term added step. Default 0.1. .initial_value numeric value indicating initial value walks. Default 0.","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/random_normal_drift_walk.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Generate Multiple Random Walks with Drift — random_normal_drift_walk","text":"tibble long format columns walk_number, x (step index), y (walk value). tibble attributes number walks, number steps, mean, standard deviation, drift.","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/random_normal_drift_walk.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Generate Multiple Random Walks with Drift — random_normal_drift_walk","text":"function generates multiple random walks specified drift. walk generated using normal distribution steps, additional drift term added step.","code":""},{"path":[]},{"path":"https://www.spsanderson.com/RandomWalker/reference/random_normal_drift_walk.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Generate Multiple Random Walks with Drift — random_normal_drift_walk","text":"Steven P. Sanderson II, MPH","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/random_normal_drift_walk.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Generate Multiple Random Walks with Drift — random_normal_drift_walk","text":"","code":"library(ggplot2) set.seed(123) walks <- random_normal_drift_walk(.num_walks = 10, .n = 50, .mu = 0, .sd = 1.2, .drift = 0.05) ggplot(walks, aes(x = x, y = y, group = walk_number, color = walk_number)) + geom_line() + labs(title = \"Random Walks with Drift\", x = \"Time\", y = \"Value\") + theme_minimal() + theme(legend.position = \"none\")"},{"path":"https://www.spsanderson.com/RandomWalker/reference/random_normal_walk.html","id":null,"dir":"Reference","previous_headings":"","what":"Generate Multiple Random Normal Walks — random_normal_walk","title":"Generate Multiple Random Normal Walks — random_normal_walk","text":"random_normal_walk function useful simulating random processes can applied various fields finance, physics, biology model different stochastic behaviors.","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/random_normal_walk.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Generate Multiple Random Normal Walks — random_normal_walk","text":"","code":"random_normal_walk( .num_walks = 25, .n = 100, .mu = 0, .sd = 0.1, .initial_value = 0, .samp = TRUE, .replace = TRUE, .sample_size = 0.8 )"},{"path":"https://www.spsanderson.com/RandomWalker/reference/random_normal_walk.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Generate Multiple Random Normal Walks — random_normal_walk","text":".num_walks integer specifying number random walks generate. Default 25. .n integer specifying number steps walk. Default 100. .mu numeric value indicating mean normal distribution. Default 0. .sd numeric value indicating standard deviation normal distribution. Default 0.1. .initial_value numeric value indicating initial value walks. Default 0. .samp logical value indicating whether sample normal distribution values. Default TRUE. .replace logical value indicating whether sampling replacement. Default TRUE. .sample_size numeric value 0 1 specifying proportion .n sample. Default 0.8.","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/random_normal_walk.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Generate Multiple Random Normal Walks — random_normal_walk","text":"tibble containing generated random walks following columns: walk_number: Factor representing walk number. x: Step index. y: Normal distribution values. cum_sum: Cumulative sum y. cum_prod: Cumulative product y. cum_min: Cumulative minimum y. cum_max: Cumulative maximum y. tibble includes attributes function parameters.","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/random_normal_walk.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Generate Multiple Random Normal Walks — random_normal_walk","text":"function generates multiple random walks, sequences steps step random draw normal distribution. user can specify number walks, number steps walk, parameters normal distribution (mean standard deviation). function also allows sampling proportion steps optionally sampling replacement. output tibble includes several computed columns walk, cumulative sum, product, minimum, maximum steps.","code":""},{"path":[]},{"path":"https://www.spsanderson.com/RandomWalker/reference/random_normal_walk.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Generate Multiple Random Normal Walks — random_normal_walk","text":"Steven P. Sanderson II, MPH","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/random_normal_walk.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Generate Multiple Random Normal Walks — random_normal_walk","text":"","code":"library(ggplot2) # Generate 10 random walks with 50 steps each set.seed(123) random_normal_walk(.num_walks = 10, .n = 50) #> # A tibble: 400 × 8 #> walk_number x y cum_sum cum_prod cum_min cum_max cum_mean #> #> 1 1 1 0.125 0.125 0 0.125 0.125 0.125 #> 2 1 2 0.172 0.297 0 0.125 0.172 0.148 #> 3 1 3 -0.127 0.170 0 -0.127 0.172 0.0568 #> 4 1 4 -0.0218 0.149 0 -0.127 0.172 0.0371 #> 5 1 5 -0.0218 0.127 0 -0.127 0.172 0.0254 #> 6 1 6 -0.0306 0.0962 0 -0.127 0.172 0.0160 #> 7 1 7 0.0426 0.139 0 -0.127 0.172 0.0198 #> 8 1 8 0.0498 0.189 0 -0.127 0.172 0.0236 #> 9 1 9 0.0878 0.276 0 -0.127 0.172 0.0307 #> 10 1 10 0.00705 0.283 0 -0.127 0.172 0.0283 #> # ℹ 390 more rows # Generate random walks with different mean and standard deviation set.seed(123) random_normal_walk(.num_walks = 10, .n = 50, .samp = FALSE) #> # A tibble: 500 × 8 #> walk_number x y cum_sum cum_prod cum_min cum_max cum_mean #> #> 1 1 1 -0.0560 -0.0560 0 -0.0560 -0.0560 -0.0560 #> 2 1 2 -0.0230 -0.0791 0 -0.0560 -0.0230 -0.0395 #> 3 1 3 0.156 0.0768 0 -0.0560 0.156 0.0256 #> 4 1 4 0.00705 0.0839 0 -0.0560 0.156 0.0210 #> 5 1 5 0.0129 0.0968 0 -0.0560 0.156 0.0194 #> 6 1 6 0.172 0.268 0 -0.0560 0.172 0.0447 #> 7 1 7 0.0461 0.314 0 -0.0560 0.172 0.0449 #> 8 1 8 -0.127 0.188 0 -0.127 0.172 0.0235 #> 9 1 9 -0.0687 0.119 0 -0.127 0.172 0.0132 #> 10 1 10 -0.0446 0.0746 0 -0.127 0.172 0.00746 #> # ℹ 490 more rows set.seed(123) random_normal_walk(.num_walks = 2, .n = 100) |> ggplot(aes(x = x, y = y, group = walk_number, color = walk_number)) + geom_line() + labs(title = \"Random Normal Walk\", x = \"Time\", y = \"Value\") + theme_minimal() + theme(legend.position = \"none\")"},{"path":"https://www.spsanderson.com/RandomWalker/reference/rand_walk_helper.html","id":null,"dir":"Reference","previous_headings":"","what":"Random Walk Helper — rand_walk_helper","title":"Random Walk Helper — rand_walk_helper","text":"function help build random walks mutating data frame.","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/rand_walk_helper.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Random Walk Helper — rand_walk_helper","text":"","code":"rand_walk_helper(.data, .value)"},{"path":"https://www.spsanderson.com/RandomWalker/reference/rand_walk_helper.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Random Walk Helper — rand_walk_helper","text":".data data frame mutate. .value .initial_value use. passed random walk function called end user.","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/rand_walk_helper.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Random Walk Helper — rand_walk_helper","text":"modified data frame/tibble following columns added: cum_sum: Cumulative sum y. cum_prod: Cumulative product y. cum_min: Cumulative minimum y. cum_max: Cumulative maximum y. cum_mean: Cumulative mean y.","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/rand_walk_helper.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Random Walk Helper — rand_walk_helper","text":"function help build random walks mutating data frame. mutation adds following columns data frame: cum_sum, cum_prod, cum_min, cum_max, cum_mean. function used internally certain functions generate random walks.","code":""},{"path":[]},{"path":"https://www.spsanderson.com/RandomWalker/reference/rand_walk_helper.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Random Walk Helper — rand_walk_helper","text":"Steven P. Sanderson II, MPH","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/rand_walk_helper.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Random Walk Helper — rand_walk_helper","text":"","code":"df <- data.frame( walk_number = factor(rep(1L:25L, each = 30L)), x = rep(1L:30L, 25L), y = rnorm(750L, 0L, 1L) ) rand_walk_helper(df, 100) #> # A tibble: 750 × 8 #> walk_number x y cum_sum cum_prod cum_min cum_max cum_mean #> #> 1 1 1 0.551 101. 155. 101. 101. 101. #> 2 1 2 -2.09 98.5 -169. 97.9 101. 99.2 #> 3 1 3 -0.0249 98.4 -165. 97.9 101. 99.5 #> 4 1 4 0.888 99.3 -311. 97.9 101. 99.8 #> 5 1 5 -0.337 99.0 -206. 97.9 101. 99.8 #> 6 1 6 -1.03 98.0 6.33 97.9 101. 99.7 #> 7 1 7 0.431 98.4 9.05 97.9 101. 99.8 #> 8 1 8 0.209 98.6 10.9 97.9 101. 99.8 #> 9 1 9 -1.55 97.0 -6.00 97.9 101. 99.7 #> 10 1 10 -1.17 95.9 1.04 97.9 101. 99.6 #> # ℹ 740 more rows"},{"path":"https://www.spsanderson.com/RandomWalker/reference/rw30.html","id":null,"dir":"Reference","previous_headings":"","what":"Generate Random Walks — rw30","title":"Generate Random Walks — rw30","text":"Generate Random Walks","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/rw30.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Generate Random Walks — rw30","text":"","code":"rw30()"},{"path":"https://www.spsanderson.com/RandomWalker/reference/rw30.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Generate Random Walks — rw30","text":"tibble long format columns walk, x, value, representing random walks. Additionally, attributes num_walks, num_steps, mu, sd attached tibble.","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/rw30.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Generate Random Walks — rw30","text":"function generates random walks using normal distribution specified mean (mu) standard deviation (sd). walk generated independently stored tibble. resulting tibble pivoted long format easier analysis.","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/rw30.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Generate Random Walks — rw30","text":"Steven P. Sanderson II, MPH function generates 30 random walks 100 steps pivots result long format tibble.","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/rw30.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Generate Random Walks — rw30","text":"","code":"library(ggplot2) # Generate random walks and print the result set.seed(123) rw30() #> # A tibble: 3,000 × 3 #> walk_number x y #> #> 1 1 1 0 #> 2 1 2 -0.560 #> 3 1 3 -0.791 #> 4 1 4 0.768 #> 5 1 5 0.839 #> 6 1 6 0.968 #> 7 1 7 2.68 #> 8 1 8 3.14 #> 9 1 9 1.88 #> 10 1 10 1.19 #> # ℹ 2,990 more rows set.seed(123) rw30() |> ggplot(aes(x = x, y = y, color = walk_number, group = walk_number)) + geom_line() + theme_minimal() + theme(legend.position = \"none\") + labs( title = \"30 Random Walks\", x = \"Step\", y = \"Value\", color = \"Walk Number\" )"},{"path":"https://www.spsanderson.com/RandomWalker/reference/rw_range.html","id":null,"dir":"Reference","previous_headings":"","what":"Range — rw_range","title":"Range — rw_range","text":"function return range vector.","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/rw_range.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Range — rw_range","text":"","code":"rw_range(.x)"},{"path":"https://www.spsanderson.com/RandomWalker/reference/rw_range.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Range — rw_range","text":".x numeric vector","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/rw_range.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Range — rw_range","text":"numeric vector","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/rw_range.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Range — rw_range","text":"function return range vector. uses max(.x) - min(.x) basis function.","code":""},{"path":[]},{"path":"https://www.spsanderson.com/RandomWalker/reference/rw_range.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Range — rw_range","text":"Steven P. Sanderson II, MPH","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/rw_range.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Range — rw_range","text":"","code":"x <- mtcars$mpg rw_range(x) #> [1] 23.5"},{"path":"https://www.spsanderson.com/RandomWalker/reference/skewness_vec.html","id":null,"dir":"Reference","previous_headings":"","what":"Compute Skewness of a Vector — skewness_vec","title":"Compute Skewness of a Vector — skewness_vec","text":"function takes vector input return skewness vector. length vector must least four numbers. skewness explains 'tailedness' distribution data. ((1/n) * sum(x - mu})^3) / ((()1/n) * sum(x - mu)^2)^(3/2)","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/skewness_vec.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Compute Skewness of a Vector — skewness_vec","text":"","code":"skewness_vec(.x)"},{"path":"https://www.spsanderson.com/RandomWalker/reference/skewness_vec.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Compute Skewness of a Vector — skewness_vec","text":".x numeric vector length four .","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/skewness_vec.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Compute Skewness of a Vector — skewness_vec","text":"skewness vector","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/skewness_vec.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Compute Skewness of a Vector — skewness_vec","text":"function return skewness vector.","code":""},{"path":[]},{"path":"https://www.spsanderson.com/RandomWalker/reference/skewness_vec.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Compute Skewness of a Vector — skewness_vec","text":"Steven P. Sanderson II, MPH","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/skewness_vec.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Compute Skewness of a Vector — skewness_vec","text":"","code":"set.seed(123) skewness_vec(rnorm(100, 3, 2)) #> [1] 0.06049948"},{"path":"https://www.spsanderson.com/RandomWalker/reference/std_cum_max_augment.html","id":null,"dir":"Reference","previous_headings":"","what":"Augment Cumulative Maximum — std_cum_max_augment","title":"Augment Cumulative Maximum — std_cum_max_augment","text":"function augments data frame adding cumulative maximum columns specified variables.","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/std_cum_max_augment.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Augment Cumulative Maximum — std_cum_max_augment","text":"","code":"std_cum_max_augment(.data, .value, .names = \"auto\", .initial_value = 0)"},{"path":"https://www.spsanderson.com/RandomWalker/reference/std_cum_max_augment.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Augment Cumulative Maximum — std_cum_max_augment","text":".data data frame augment. .value column name names compute cumulative maximum. .names Optional. character vector names new cumulative maximum columns. Defaults \"auto\", generates names based original column names. .initial_value numeric value start cumulative maximum . Defaults 0.","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/std_cum_max_augment.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Augment Cumulative Maximum — std_cum_max_augment","text":"tibble original data additional columns containing cumulative maximums.","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/std_cum_max_augment.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Augment Cumulative Maximum — std_cum_max_augment","text":"function takes data frame column name (names) computes cumulative maximum specified column, starting initial value. column names provided, throw error.","code":""},{"path":[]},{"path":"https://www.spsanderson.com/RandomWalker/reference/std_cum_max_augment.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Augment Cumulative Maximum — std_cum_max_augment","text":"Steven P. Sanderson II, MPH","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/std_cum_max_augment.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Augment Cumulative Maximum — std_cum_max_augment","text":"","code":"df <- data.frame(x = c(1, 3, 2, 5, 4), y = c(10, 7, 6, 12, 5)) std_cum_max_augment(df, .value = x) #> # A tibble: 5 × 3 #> x y cum_max_x #> #> 1 1 10 1 #> 2 3 7 3 #> 3 2 6 3 #> 4 5 12 5 #> 5 4 5 5 std_cum_max_augment(df, .value = y, .names = c(\"cummax_y\")) #> # A tibble: 5 × 3 #> x y cummax_y #> #> 1 1 10 10 #> 2 3 7 10 #> 3 2 6 10 #> 4 5 12 12 #> 5 4 5 12"},{"path":"https://www.spsanderson.com/RandomWalker/reference/std_cum_mean_augment.html","id":null,"dir":"Reference","previous_headings":"","what":"Augment Cumulative Sum — std_cum_mean_augment","title":"Augment Cumulative Sum — std_cum_mean_augment","text":"function augments data frame adding cumulative mean columns specified variables.","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/std_cum_mean_augment.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Augment Cumulative Sum — std_cum_mean_augment","text":"","code":"std_cum_mean_augment(.data, .value, .names = \"auto\", .initial_value = 0)"},{"path":"https://www.spsanderson.com/RandomWalker/reference/std_cum_mean_augment.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Augment Cumulative Sum — std_cum_mean_augment","text":".data data frame augment. .value column name names compute cumulative mean. .names Optional. character vector names new cumulative mean columns. Defaults \"auto\", generates names based original column names. .initial_value numeric value start cumulative mean . Defaults 0.","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/std_cum_mean_augment.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Augment Cumulative Sum — std_cum_mean_augment","text":"tibble original data additional columns containing cumulative means.","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/std_cum_mean_augment.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Augment Cumulative Sum — std_cum_mean_augment","text":"function takes data frame column name (names) computes cumulative mean specified column, starting initial value. column names provided, throw error.","code":""},{"path":[]},{"path":"https://www.spsanderson.com/RandomWalker/reference/std_cum_mean_augment.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Augment Cumulative Sum — std_cum_mean_augment","text":"Steven P. Sanderson II, MPH","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/std_cum_mean_augment.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Augment Cumulative Sum — std_cum_mean_augment","text":"","code":"df <- data.frame(x = c(1, 2, 3, 4, 5), y = c(10, 20, 30, 40, 50)) std_cum_mean_augment(df, .value = x) #> # A tibble: 5 × 3 #> x y cum_mean_x #> #> 1 1 10 1 #> 2 2 20 1.5 #> 3 3 30 2 #> 4 4 40 2.5 #> 5 5 50 3 std_cum_mean_augment(df, .value = y, .names = c(\"cummean_y\")) #> # A tibble: 5 × 3 #> x y cummean_y #> #> 1 1 10 10 #> 2 2 20 15 #> 3 3 30 20 #> 4 4 40 25 #> 5 5 50 30"},{"path":"https://www.spsanderson.com/RandomWalker/reference/std_cum_min_augment.html","id":null,"dir":"Reference","previous_headings":"","what":"Augment Cumulative Minimum — std_cum_min_augment","title":"Augment Cumulative Minimum — std_cum_min_augment","text":"function augments data frame adding cumulative minimum columns specified variables.","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/std_cum_min_augment.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Augment Cumulative Minimum — std_cum_min_augment","text":"","code":"std_cum_min_augment(.data, .value, .names = \"auto\", .initial_value = 0)"},{"path":"https://www.spsanderson.com/RandomWalker/reference/std_cum_min_augment.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Augment Cumulative Minimum — std_cum_min_augment","text":".data data frame augment. .value column name names compute cumulative minimum. .names Optional. character vector names new cumulative minimum columns. Defaults \"auto\", generates names based original column names. .initial_value numeric value start cumulative minimum . Defaults 0.","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/std_cum_min_augment.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Augment Cumulative Minimum — std_cum_min_augment","text":"tibble original data additional columns containing cumulative minimums.","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/std_cum_min_augment.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Augment Cumulative Minimum — std_cum_min_augment","text":"function takes data frame column name (names) computes cumulative minimum specified column, starting initial value. column names provided, throw error.","code":""},{"path":[]},{"path":"https://www.spsanderson.com/RandomWalker/reference/std_cum_min_augment.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Augment Cumulative Minimum — std_cum_min_augment","text":"Steven P. Sanderson II, MPH","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/std_cum_min_augment.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Augment Cumulative Minimum — std_cum_min_augment","text":"","code":"df <- data.frame(x = c(5, 3, 8, 1, 4), y = c(10, 7, 6, 12, 5)) std_cum_min_augment(df, .value = x) #> # A tibble: 5 × 3 #> x y cum_min_x #> #> 1 5 10 5 #> 2 3 7 3 #> 3 8 6 3 #> 4 1 12 1 #> 5 4 5 1 std_cum_min_augment(df, .value = y, .names = c(\"cummin_y\")) #> # A tibble: 5 × 3 #> x y cummin_y #> #> 1 5 10 10 #> 2 3 7 7 #> 3 8 6 6 #> 4 1 12 6 #> 5 4 5 5"},{"path":"https://www.spsanderson.com/RandomWalker/reference/std_cum_prod_augment.html","id":null,"dir":"Reference","previous_headings":"","what":"Augment Cumulative Product — std_cum_prod_augment","title":"Augment Cumulative Product — std_cum_prod_augment","text":"function augments data frame adding cumulative product columns specified variables.","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/std_cum_prod_augment.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Augment Cumulative Product — std_cum_prod_augment","text":"","code":"std_cum_prod_augment(.data, .value, .names = \"auto\", .initial_value = 1)"},{"path":"https://www.spsanderson.com/RandomWalker/reference/std_cum_prod_augment.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Augment Cumulative Product — std_cum_prod_augment","text":".data data frame augment. .value column name names compute cumulative product. .names Optional. character vector names new cumulative product columns. Defaults \"auto\", generates names based original column names. .initial_value numeric value start cumulative product . Defaults 1.","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/std_cum_prod_augment.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Augment Cumulative Product — std_cum_prod_augment","text":"tibble original data additional columns containing cumulative products.","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/std_cum_prod_augment.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Augment Cumulative Product — std_cum_prod_augment","text":"function takes data frame column name (names) computes cumulative product specified column, starting initial value. column names provided, throw error.","code":""},{"path":[]},{"path":"https://www.spsanderson.com/RandomWalker/reference/std_cum_prod_augment.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Augment Cumulative Product — std_cum_prod_augment","text":"Steven P. Sanderson II, MPH","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/std_cum_prod_augment.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Augment Cumulative Product — std_cum_prod_augment","text":"","code":"df <- data.frame(x = 1:5, y = 6:10) std_cum_prod_augment(df, .value = x) #> # A tibble: 5 × 3 #> x y cum_prod_x #> #> 1 1 6 2 #> 2 2 7 6 #> 3 3 8 24 #> 4 4 9 120 #> 5 5 10 720 std_cum_prod_augment(df, .value = y, .names = c(\"cumprod_y\")) #> # A tibble: 5 × 3 #> x y cumprod_y #> #> 1 1 6 7 #> 2 2 7 56 #> 3 3 8 504 #> 4 4 9 5040 #> 5 5 10 55440"},{"path":"https://www.spsanderson.com/RandomWalker/reference/std_cum_sum_augment.html","id":null,"dir":"Reference","previous_headings":"","what":"Augment Cumulative Sum — std_cum_sum_augment","title":"Augment Cumulative Sum — std_cum_sum_augment","text":"function augments data frame adding cumulative sum columns specified variables.","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/std_cum_sum_augment.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Augment Cumulative Sum — std_cum_sum_augment","text":"","code":"std_cum_sum_augment(.data, .value, .names = \"auto\", .initial_value = 0)"},{"path":"https://www.spsanderson.com/RandomWalker/reference/std_cum_sum_augment.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Augment Cumulative Sum — std_cum_sum_augment","text":".data data frame augment. .value column name names compute cumulative sum. .names Optional. character vector names new cumulative sum columns. Defaults \"auto\", generates names based original column names. .initial_value numeric value start cumulative sum . Defaults 0.","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/std_cum_sum_augment.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Augment Cumulative Sum — std_cum_sum_augment","text":"tibble original data additional columns containing cumulative sums.","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/std_cum_sum_augment.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Augment Cumulative Sum — std_cum_sum_augment","text":"function takes data frame column name (names) computes cumulative sum specified column, starting initial value. column names provided, throw error.","code":""},{"path":[]},{"path":"https://www.spsanderson.com/RandomWalker/reference/std_cum_sum_augment.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Augment Cumulative Sum — std_cum_sum_augment","text":"Steven P. Sanderson II, MPH","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/std_cum_sum_augment.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Augment Cumulative Sum — std_cum_sum_augment","text":"","code":"df <- data.frame(x = 1:5, y = 6:10) std_cum_sum_augment(df, .value = x) #> # A tibble: 5 × 3 #> x y cum_sum_x #> #> 1 1 6 1 #> 2 2 7 3 #> 3 3 8 6 #> 4 4 9 10 #> 5 5 10 15 std_cum_sum_augment(df, .value = y, .names = c(\"cumsum_y\")) #> # A tibble: 5 × 3 #> x y cumsum_y #> #> 1 1 6 6 #> 2 2 7 13 #> 3 3 8 21 #> 4 4 9 30 #> 5 5 10 40"},{"path":"https://www.spsanderson.com/RandomWalker/reference/summarize_walks.html","id":null,"dir":"Reference","previous_headings":"","what":"Summarize Walks Data — summarize_walks","title":"Summarize Walks Data — summarize_walks","text":"Summarizes random walk data computing statistical measures.","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/summarize_walks.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Summarize Walks Data — summarize_walks","text":"","code":"summarize_walks(.data, .value, .group_var) summarise_walks(.data, .value, .group_var)"},{"path":"https://www.spsanderson.com/RandomWalker/reference/summarize_walks.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Summarize Walks Data — summarize_walks","text":".data data frame tibble containing random walk data. .value column name (unquoted) representing value summarize. .group_var column name (unquoted) representing grouping variable.","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/summarize_walks.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Summarize Walks Data — summarize_walks","text":"tibble containing summarized statistics group, including mean, median, range, quantiles, variance, standard deviation, .","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/summarize_walks.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Summarize Walks Data — summarize_walks","text":"function requires input data frame contains column named 'walk_number' value summarize provided. computes statistics mean, median, variance, quantiles specified value variable. #' function summarizes data frame containing random walk data computing various statistical measures specified value variable, grouped specified grouping variable. checks necessary attributes ensures data frame structured correctly.","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/summarize_walks.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Summarize Walks Data — summarize_walks","text":"Steven P. Sanderson II, MPH","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/summarize_walks.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Summarize Walks Data — summarize_walks","text":"","code":"library(dplyr) #> #> Attaching package: 'dplyr' #> The following objects are masked from 'package:stats': #> #> filter, lag #> The following objects are masked from 'package:base': #> #> intersect, setdiff, setequal, union # Example data frame walk_data <- random_normal_walk(.initial_value = 100) # Summarize the walks summarize_walks(walk_data, cum_sum, walk_number) |> glimpse() #> Registered S3 method overwritten by 'quantmod': #> method from #> as.zoo.data.frame zoo #> Rows: 25 #> Columns: 17 #> $ walk_number 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, … #> $ fns \"random_normal_walk\", \"random_normal_walk\", \"random_nor… #> $ fns_name \"Random Normal Walk\", \"Random Normal Walk\", \"Random Nor… #> $ dimensions 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1… #> $ mean_val 100.10659, 99.82922, 99.52922, 98.75850, 100.85864, 100… #> $ median 100.07614, 99.81004, 99.46064, 98.59080, 100.87054, 99.… #> $ range 1.4702499, 0.7206181, 0.9869902, 1.9579304, 1.4119450, … #> $ quantile_lo 99.47986, 99.56809, 99.17375, 98.08058, 100.38400, 99.6… #> $ quantile_hi 100.79633, 100.17122, 100.01265, 99.74580, 101.37084, 1… #> $ variance 0.14913626, 0.02532646, 0.07434017, 0.24369466, 0.10788… #> $ sd 0.3861816, 0.1591429, 0.2726539, 0.4936544, 0.3284642, … #> $ min_val 99.43543, 99.49121, 99.05844, 98.04468, 100.10611, 99.6… #> $ max_val 100.90568, 100.21183, 100.04543, 100.00261, 101.51805, … #> $ harmonic_mean 100.10512, 99.82897, 99.52849, 98.75607, 100.85759, 100… #> $ geometric_mean 100.10585, 99.82910, 99.52885, 98.75728, 100.85812, 100… #> $ skewness 0.18662786, 0.34427100, 0.42980993, 0.41718949, -0.0445… #> $ kurtosis -0.9483369, -0.1798819, -1.1319872, -0.8449953, -0.9673… summarize_walks(walk_data, y) |> glimpse() #> Warning: There was 1 warning in `dplyr::summarize()`. #> ℹ In argument: `geometric_mean = exp(mean(log(y)))`. #> Caused by warning in `log()`: #> ! NaNs produced #> Rows: 1 #> Columns: 16 #> $ fns \"random_normal_walk\" #> $ fns_name \"Random Normal Walk\" #> $ dimensions 1 #> $ mean_val -0.002189823 #> $ median -0.005327023 #> $ range 0.6899619 #> $ quantile_lo -0.1991602 #> $ quantile_hi 0.1989294 #> $ variance 0.01035473 #> $ sd 0.1017582 #> $ min_val -0.3047861 #> $ max_val 0.3851758 #> $ harmonic_mean -0.01258915 #> $ geometric_mean NaN #> $ skewness 0.1464476 #> $ kurtosis 0.09097494 # Example with missing value variable # summarize_walks(walk_data, NULL, group) # This will trigger an error."},{"path":"https://www.spsanderson.com/RandomWalker/reference/visualize_walks.html","id":null,"dir":"Reference","previous_headings":"","what":"Visualize Walks — visualize_walks","title":"Visualize Walks — visualize_walks","text":"visualize_walks() visualizes output random walk functions RandomWalker package, resulting one ggplot2 plots put together patchwork composed 1 patches.","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/visualize_walks.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Visualize Walks — visualize_walks","text":"","code":"visualize_walks(.data, .alpha = 0.7)"},{"path":"https://www.spsanderson.com/RandomWalker/reference/visualize_walks.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Visualize Walks — visualize_walks","text":".data input data. Assumed created one random walk functions RandomWalker package, can data frame tibble contains columns walk_number, x, one numeric columns like x, cum_sum, cum_prod, cum_min, cum_max cum_mean, instance. .alpha alpha value line charts visualization. Values range 0 1. Default 0.7.","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/visualize_walks.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Visualize Walks — visualize_walks","text":"patchwork composed 1 patches","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/visualize_walks.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Visualize Walks — visualize_walks","text":"visualize_walks() generates visualizations random walks generated random walk functions RandomWalker package. functions moment writing: brownian_motion() discrete_walk() geometric_brownian_motion() random_normal_drift_walk() random_normal_walk() rw30() possible read , can check rest documentation current situation. visualization function meant easy use. parameters needed, can set .alpha default value 0.7 liking. can combine function many tidyverse functions (either ). one example .","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/visualize_walks.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Visualize Walks — visualize_walks","text":"Antti Lennart Rask","code":""},{"path":"https://www.spsanderson.com/RandomWalker/reference/visualize_walks.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Visualize Walks — visualize_walks","text":"","code":"# Generate random walks and visualize the result set.seed(123) rw30() |> visualize_walks() # Set the alpha value to be other than the default 0.7 set.seed(123) rw30() |> visualize_walks(.alpha = 0.5) # Use the function with an input that has alternatives for y set.seed(123) random_normal_walk() |> visualize_walks() # Use the pluck function from purrr to pick just one visualization set.seed(123) random_normal_walk() |> visualize_walks() |> purrr::pluck(2)"},{"path":[]},{"path":"https://www.spsanderson.com/RandomWalker/news/index.html","id":"breaking-changes-development-version","dir":"Changelog","previous_headings":"","what":"Breaking Changes","title":"RandomWalker (development version)","text":"None","code":""},{"path":"https://www.spsanderson.com/RandomWalker/news/index.html","id":"new-features-development-version","dir":"Changelog","previous_headings":"","what":"New Features","title":"RandomWalker (development version)","text":"Fix #92 - Add Function std_cum_sum_augment() calculate cumulative sum random walk. Fix #93 - Add Function std_cum_prod_augment() calculate cumulative product random walk. Fix #94 - Add Function std_cum_min_augment() calculate cumulative minimum random walk. Fix #95 - Add Function std_cum_max_augment() calculate cumulative maximum random walk. Fix #96 - Add Function std_cum_mean_augment() calculate cumulative mean random walk. Fix #113 - Add Function get_attributes() get attributes without row.names","code":""},{"path":"https://www.spsanderson.com/RandomWalker/news/index.html","id":"minor-improvements-and-fixes-development-version","dir":"Changelog","previous_headings":"","what":"Minor Improvements and Fixes","title":"RandomWalker (development version)","text":"None","code":""},{"path":"https://www.spsanderson.com/RandomWalker/news/index.html","id":"randomwalker-010","dir":"Changelog","previous_headings":"","what":"RandomWalker 0.1.0","title":"RandomWalker 0.1.0","text":"CRAN release: 2024-09-15","code":""},{"path":"https://www.spsanderson.com/RandomWalker/news/index.html","id":"breaking-changes-0-1-0","dir":"Changelog","previous_headings":"","what":"Breaking Changes","title":"RandomWalker 0.1.0","text":"None","code":""},{"path":"https://www.spsanderson.com/RandomWalker/news/index.html","id":"new-features-0-1-0","dir":"Changelog","previous_headings":"","what":"New Features","title":"RandomWalker 0.1.0","text":"Fix #9 - Add Function rw30() generate 30 random walks 100 steps Fix #17 - Add Function geometric_brownian_motion() generate Geometric Brownian Motion Fix #18 - Add Function random_normal_drift_walk() generate Random Walk Drift Fix #16 - Add Function brownian_motion() generate Brownian Motion Fix #13 - Add Function random_normal_walk() generate Random Walk Fix #30 - Add Function discrete_walk() generate Discrete Random Walk Fix #43 - Add vectorized functions Fix #44 - Add Function internal_rand_walk_helper() help generate common columns random walks. Fix #34 - Add Function euclidean_distance() calculate Euclidean distance random walk. Fix #33 - Add Function visualize_walks() visualize random walks. Fix #66 - Add Function summarize_walks() summarize random walks.","code":""},{"path":"https://www.spsanderson.com/RandomWalker/news/index.html","id":"minor-improvements-and-fixes-0-1-0","dir":"Changelog","previous_headings":"","what":"Minor Improvements and Fixes","title":"RandomWalker 0.1.0","text":"None","code":""}] diff --git a/docs/sitemap.xml b/docs/sitemap.xml index 2196eff..f5c7087 100644 --- a/docs/sitemap.xml +++ b/docs/sitemap.xml @@ -22,6 +22,7 @@ https://www.spsanderson.com/RandomWalker/reference/euclidean_distance.html https://www.spsanderson.com/RandomWalker/reference/generate_caption.html https://www.spsanderson.com/RandomWalker/reference/geometric_brownian_motion.html +https://www.spsanderson.com/RandomWalker/reference/get_attributes.html https://www.spsanderson.com/RandomWalker/reference/index.html https://www.spsanderson.com/RandomWalker/reference/internal_rand_walk_helper.html https://www.spsanderson.com/RandomWalker/reference/kurtosis_vec.html