Skip to content

Commit

Permalink
Merge pull request #141 from spsanderson/development
Browse files Browse the repository at this point in the history
Development
  • Loading branch information
spsanderson authored Nov 25, 2024
2 parents 87de259 + 2340479 commit 17054b5
Show file tree
Hide file tree
Showing 63 changed files with 10,392 additions and 68 deletions.
17 changes: 16 additions & 1 deletion R/gen-brown-motion-geometric.R
Original file line number Diff line number Diff line change
Expand Up @@ -158,10 +158,25 @@ geometric_brownian_motion <- function(.num_walks = 25, .n = 100,
res <- purrr::map(1:num_sims, ~ generate_gbm(.x)) |>
dplyr::bind_rows() |>
dplyr::select(walk_number, step_number, dplyr::all_of(dim_names)) |>
dplyr::mutate(walk_number = factor(walk_number, levels = 1:num_sims)) |>
dplyr::mutate(walk_number = factor(walk_number, levels = 1:num_sims))
res <- res |>
dplyr::group_by(walk_number) |>
std_cum_sum_augment(.value = dplyr::all_of(dim_names), .initial_value = initial_value) |>
dplyr::ungroup()
res <- res |>
dplyr::group_by(walk_number) |>
std_cum_prod_augment(.value = dplyr::all_of(dim_names), .initial_value = initial_value) |>
dplyr::ungroup()
res <- res |>
dplyr::group_by(walk_number) |>
std_cum_min_augment(.value = dplyr::all_of(dim_names), .initial_value = initial_value) |>
dplyr::ungroup()
res <- res |>
dplyr::group_by(walk_number) |>
std_cum_max_augment(.value = dplyr::all_of(dim_names), .initial_value = initial_value) |>
dplyr::ungroup()
res <- res |>
dplyr::group_by(walk_number) |>
std_cum_mean_augment(.value = dplyr::all_of(dim_names), .initial_value = initial_value) |>
dplyr::ungroup()

Expand Down
15 changes: 14 additions & 1 deletion R/gen-brown-motion.R
Original file line number Diff line number Diff line change
Expand Up @@ -137,12 +137,25 @@ brownian_motion <- function(.num_walks = 25, .n = 100, .delta_time = 1,
res <- purrr::map(1:num_sims, ~ generate_brownian_motion(.x)) |>
dplyr::bind_rows() |>
dplyr::select(walk_number, step_number, dplyr::any_of(dim_names)) |>
dplyr::mutate(walk_number = factor(walk_number, levels = 1:num_sims)) |>
dplyr::mutate(walk_number = factor(walk_number, levels = 1:num_sims))
res <- res |>
dplyr::group_by(walk_number) |>
std_cum_sum_augment(.value = dplyr::all_of(dim_names), .initial_value = initial_value) |>
dplyr::ungroup()
res <- res |>
dplyr::group_by(walk_number) |>
std_cum_prod_augment(.value = dplyr::all_of(dim_names), .initial_value = initial_value) |>
dplyr::ungroup()
res <- res |>
dplyr::group_by(walk_number) |>
std_cum_min_augment(.value = dplyr::all_of(dim_names), .initial_value = initial_value) |>
dplyr::ungroup()
res <- res |>
dplyr::group_by(walk_number) |>
std_cum_max_augment(.value = dplyr::all_of(dim_names), .initial_value = initial_value) |>
dplyr::ungroup()
res <- res |>
dplyr::group_by(walk_number) |>
std_cum_mean_augment(.value = dplyr::all_of(dim_names), .initial_value = initial_value) |>
dplyr::ungroup()

Expand Down
16 changes: 15 additions & 1 deletion R/gen-discrete-walk.R
Original file line number Diff line number Diff line change
Expand Up @@ -182,11 +182,25 @@ discrete_walk <- function(.num_walks = 25, .n = 100, .upper_bound = 1,
res <- dplyr::bind_rows(walks, .id = "walk_number") |>
dplyr::mutate(walk_number = factor(walk_number, levels = 1:num_walks)) |>
dplyr::group_by(walk_number) |>
dplyr::select(walk_number, step_number, dplyr::all_of(dim_names)) |>
dplyr::select(walk_number, step_number, dplyr::all_of(dim_names))
res <- res |>
dplyr::group_by(walk_number) |>
std_cum_sum_augment(.value = dplyr::all_of(dim_names), .initial_value = initial_value) |>
dplyr::ungroup()
res <- res |>
dplyr::group_by(walk_number) |>
std_cum_prod_augment(.value = dplyr::all_of(dim_names), .initial_value = initial_value) |>
dplyr::ungroup()
res <- res |>
dplyr::group_by(walk_number) |>
std_cum_min_augment(.value = dplyr::all_of(dim_names), .initial_value = initial_value) |>
dplyr::ungroup()
res <- res |>
dplyr::group_by(walk_number) |>
std_cum_max_augment(.value = dplyr::all_of(dim_names), .initial_value = initial_value) |>
dplyr::ungroup()
res <- res |>
dplyr::group_by(walk_number) |>
std_cum_mean_augment(.value = dplyr::all_of(dim_names), .initial_value = initial_value) |>
dplyr::ungroup()

Expand Down
16 changes: 15 additions & 1 deletion R/gen-random-normal-walk-drift.R
Original file line number Diff line number Diff line change
Expand Up @@ -137,11 +137,25 @@ random_normal_drift_walk <- function(.num_walks = 25, .n = 100, .mu = 0, .sd = 1
dplyr::mutate(walk_number = factor(walk_number, levels = 1:num_walks)) |>
dplyr::group_by(walk_number) |>
dplyr::mutate(step_number = 1:num_steps) |>
dplyr::select(walk_number, step_number, dplyr::all_of(dim_names)) |>
dplyr::select(walk_number, step_number, dplyr::all_of(dim_names))
res <- res |>
dplyr::group_by(walk_number) |>
std_cum_sum_augment(.value = dplyr::all_of(dim_names), .initial_value = initial_value) |>
dplyr::ungroup()
res <- res |>
dplyr::group_by(walk_number) |>
std_cum_prod_augment(.value = dplyr::all_of(dim_names), .initial_value = initial_value) |>
dplyr::ungroup()
res <- res |>
dplyr::group_by(walk_number) |>
std_cum_min_augment(.value = dplyr::all_of(dim_names), .initial_value = initial_value) |>
dplyr::ungroup()
res <- res |>
dplyr::group_by(walk_number) |>
std_cum_max_augment(.value = dplyr::all_of(dim_names), .initial_value = initial_value) |>
dplyr::ungroup()
res <- res |>
dplyr::group_by(walk_number) |>
std_cum_mean_augment(.value = dplyr::all_of(dim_names), .initial_value = initial_value) |>
dplyr::ungroup()

Expand Down
15 changes: 14 additions & 1 deletion R/gen-random-normal-walk.R
Original file line number Diff line number Diff line change
Expand Up @@ -129,12 +129,25 @@ random_normal_walk <- function(.num_walks = 25, .n = 100, .mu = 0, .sd = 0.1,
# Generate all walks
res <- purrr::map_dfr(1:num_walks, generate_walk)
res <- res |>
dplyr::mutate(walk_number = factor(walk_number, levels = 1:num_walks)) |>
dplyr::mutate(walk_number = factor(walk_number, levels = 1:num_walks))
res <- res |>
dplyr::group_by(walk_number) |>
std_cum_sum_augment(.value = dplyr::all_of(dim_names), .initial_value = initial_value) |>
dplyr::ungroup()
res <- res |>
dplyr::group_by(walk_number) |>
std_cum_prod_augment(.value = dplyr::all_of(dim_names), .initial_value = initial_value) |>
dplyr::ungroup()
res <- res |>
dplyr::group_by(walk_number) |>
std_cum_min_augment(.value = dplyr::all_of(dim_names), .initial_value = initial_value) |>
dplyr::ungroup()
res <- res |>
dplyr::group_by(walk_number) |>
std_cum_max_augment(.value = dplyr::all_of(dim_names), .initial_value = initial_value) |>
dplyr::ungroup()
res <- res |>
dplyr::group_by(walk_number) |>
std_cum_mean_augment(.value = dplyr::all_of(dim_names), .initial_value = initial_value) |>
dplyr::ungroup()

Expand Down
4 changes: 2 additions & 2 deletions docs/404.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/LICENSE-text.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/LICENSE.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions docs/articles/getting-started.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 17054b5

Please sign in to comment.